]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/esri.py
3 from .common
import InfoExtractor
4 from ..compat
import compat_urlparse
12 class EsriVideoIE(InfoExtractor
):
13 _VALID_URL
= r
'https?://video\.esri\.com/watch/(?P<id>[0-9]+)'
15 'url': 'https://video.esri.com/watch/1124/arcgis-online-_dash_-developing-applications',
16 'md5': 'd4aaf1408b221f1b38227a9bbaeb95bc',
20 'title': 'ArcGIS Online - Developing Applications',
21 'description': 'Jeremy Bartley demonstrates how to develop applications with ArcGIS Online.',
22 'thumbnail': r
're:^https?://.*\.jpg$',
24 'upload_date': '20120419',
28 def _real_extract(self
, url
):
29 video_id
= self
._match
_id
(url
)
31 webpage
= self
._download
_webpage
(url
, video_id
)
34 for width
, height
, content
in re
.findall(
35 r
'(?s)<li><strong>(\d+)x(\d+):</strong>(.+?)</li>', webpage
):
36 for video_url
, ext
, filesize
in re
.findall(
37 r
'<a[^>]+href="([^"]+)">([^<]+) \(([^<]+)\)</a>', content
):
39 'url': compat_urlparse
.urljoin(url
, video_url
),
41 'format_id': '%s-%s' % (ext
.lower(), height
),
43 'height': int(height
),
44 'filesize_approx': parse_filesize(filesize
),
47 title
= self
._html
_search
_meta
('title', webpage
, 'title')
48 description
= self
._html
_search
_meta
(
49 'description', webpage
, 'description', fatal
=False)
51 thumbnail
= self
._html
_search
_meta
('thumbnail', webpage
, 'thumbnail', fatal
=False)
53 thumbnail
= re
.sub(r
'_[st]\.jpg$', '_x.jpg', thumbnail
)
55 duration
= int_or_none(self
._search
_regex
(
56 [r
'var\s+videoSeconds\s*=\s*(\d+)', r
"'duration'\s*:\s*(\d+)"],
57 webpage
, 'duration', fatal
=False))
59 upload_date
= unified_strdate(self
._html
_search
_meta
(
60 'last-modified', webpage
, 'upload date', fatal
=False))
65 'description': description
,
66 'thumbnail': thumbnail
,
68 'upload_date': upload_date
,