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