1 from .common
import InfoExtractor
2 from ..utils
import ExtractorError
, base_url
, int_or_none
, url_basename
3 from ..utils
.traversal
import traverse_obj
6 class Vbox7IE(InfoExtractor
):
9 (?:[^/]+\.)?vbox7\.com/
19 _EMBED_REGEX
= [r
'<iframe[^>]+src=(?P<q>["\'])(?P
<url
>(?
:https?
:)?
//vbox7\
.com
/emb
/external\
.php
.+?
)(?P
=q
)']
20 _GEO_COUNTRIES = ['BG
']
22 'url
': 'http
://vbox7
.com
/play
:0946fff23c
',
23 'md5
': '50ca1f78345a9c15391af47d8062d074
',
27 'title
': 'Борисов
: Притеснен съм за бъдещето на България
',
28 'description
': 'По думите му е опасно страната ни да бъде обявена за
"сигурна"',
29 'thumbnail
': r're
:^https?
://.*\
.jpg$
',
30 'timestamp
': 1470982814,
31 'upload_date
': '20160812',
32 'uploader
': 'zdraveibulgaria
',
37 'url
': 'http
://vbox7
.com
/play
:249bb972c2
',
38 'md5
': 'da1dd2eb245200cb86e6d09d43232116
',
42 'title
': 'Смях
! Чудо
- чист за секунди
- Скрита камера
',
43 'uploader
': 'svideteliat_ot_varshava
',
45 'timestamp
': 1360215023,
46 'thumbnail
': 'https
://i49
.vbox7
.com
/o
/249/249bb972c20
.jpg
',
47 'description
': 'Смях
! Чудо
- чист за секунди
- Скрита камера
',
48 'upload_date
': '20130207',
51 'expected_warnings
': ['Failed to download m3u8 information
'],
53 'url
': 'http
://vbox7
.com
/emb
/external
.php?vid
=a240d20f9c
&autoplay
=1',
54 'only_matching
': True,
56 'url
': 'http
://i49
.vbox7
.com
/player
/ext
.swf?vid
=0946fff23c
&autoplay
=1',
57 'only_matching
': True,
60 def _real_extract(self, url):
61 video_id = self._match_id(url)
63 data = self._download_json(
64 'https
://www
.vbox7
.com
/aj
/player
/item
/options
', video_id,
65 query={'vid
': video_id})['options
']
67 src_url = data.get('src
')
68 if src_url in (None, '', 'blank
'):
69 raise ExtractorError('Video
is unavailable
', expected=True)
71 fmt_base = url_basename(src_url).rsplit('.', 1)[0].rsplit('_
', 1)[0]
73 self.raise_geo_restricted()
75 fmt_base = base_url(src_url) + fmt_base
77 formats = self._extract_m3u8_formats(
78 f'{fmt_base}
.m3u8
', video_id, m3u8_id='hls
', fatal=False)
79 # TODO: Add MPD formats, when dash range support is added
80 for res in traverse_obj(data, ('resolutions
', lambda _, v: v != 0, {int})):
82 'url
': f'{fmt_base}_{res}
.mp4
',
83 'format_id
': f'http
-{res}
',
90 **self._search_json_ld(self._download_webpage(
91 f'https
://www
.vbox7
.com
/play
:{video_id}
', video_id, fatal=False) or '', video_id, fatal=False),
92 **traverse_obj(data, {
93 'title
': ('title
', {str}),
94 'uploader
': ('uploader
', {str}),
95 'duration
': ('duration
', {int_or_none}),