]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/vupload.py
1 from .common
import InfoExtractor
11 class VuploadIE(InfoExtractor
):
12 _VALID_URL
= r
'https://vupload\.com/v/(?P<id>[a-z0-9]+)'
14 'url': 'https://vupload.com/v/u28d0pl2tphy',
15 'md5': '9b42a4a193cca64d80248e58527d83c8',
19 'description': 'md5:e9e6c0045c78cbf0d5bb19a55ce199fb',
20 'title': 'md5:e9e6c0045c78cbf0d5bb19a55ce199fb',
24 def _real_extract(self
, url
):
25 video_id
= self
._match
_id
(url
)
26 webpage
= self
._download
_webpage
(url
, video_id
)
28 title
= self
._html
_extract
_title
(webpage
)
29 video_json
= self
._parse
_json
(self
._html
_search
_regex
(r
'sources:\s*(.+?]),', webpage
, 'video'), video_id
, transform_source
=js_to_json
)
31 for source
in video_json
:
32 if source
['src'].endswith('.m3u8'):
33 formats
.extend(self
._extract
_m
3u8_formats
(source
['src'], video_id
, m3u8_id
='hls'))
34 duration
= parse_duration(self
._html
_search
_regex
(
35 r
'<i\s*class=["\']fad\s
*fa
-clock
["\']></i>\s*([\d:]+)\s*</div>', webpage, 'duration', fatal=False))
36 filesize_approx = parse_filesize(self._html_search_regex(
37 r'<i\s*class=["\']fad\s
*fa
-save
["\']></i>\s*([^<]+)\s*</div>', webpage, 'filesize', fatal=False))
38 extra_video_info = extract_attributes(self._html_search_regex(
39 r'(<video[^>]+>)', webpage, 'video_info', fatal=False))
40 description = self._html_search_meta('description', webpage)
46 'filesize_approx': filesize_approx,
47 'width': int_or_none(extra_video_info.get('width')),
48 'height': int_or_none(extra_video_info.get('height')),
49 'format_id': extra_video_info.get('height', '') + 'p',
51 'description': description,