]>
jfr.im git - yt-dlp.git/blob - youtube_dl/extractor/vbox7.py
2 from __future__
import unicode_literals
4 from .common
import InfoExtractor
5 from ..compat
import compat_urlparse
13 class Vbox7IE(InfoExtractor
):
14 _VALID_URL
= r
'https?://(?:www\.)?vbox7\.com/play:(?P<id>[^/]+)'
16 'url': 'http://vbox7.com/play:0946fff23c',
17 'md5': 'a60f9ab3a3a2f013ef9a967d5f7be5bf',
21 'title': 'Борисов: Притеснен съм за бъдещето на България',
24 'url': 'http://vbox7.com/play:249bb972c2',
25 'md5': '99f65c0c9ef9b682b97313e052734c3f',
29 'title': 'Смях! Чудо - чист за секунди - Скрита камера',
31 'skip': 'georestricted',
34 def _real_extract(self
, url
):
35 video_id
= self
._match
_id
(url
)
37 webpage
= self
._download
_webpage
(url
, video_id
)
39 title
= self
._html
_search
_regex
(
40 r
'<title>(.*)</title>', webpage
, 'title').split('/')[0].strip()
42 video_url
= self
._search
_regex
(
43 r
'src\s*:\s*(["\'])(?P
<url
>.+?
.mp4
.*?
)\
1',
44 webpage, 'video url
', default=None, group='url
')
46 thumbnail_url = self._og_search_thumbnail(webpage)
49 info_response = self._download_webpage(
50 'http
://vbox7
.com
/play
/magare
.do
', video_id,
51 'Downloading info webpage
',
52 data=urlencode_postdata({'as3': '1', 'vid': video_id}),
53 headers={'Content-Type': 'application/x-www-form-urlencoded'})
54 final_url, thumbnail_url = map(
55 lambda x: x.split('=')[1], info_response.split('&'))
57 if '/na
.mp4
' in video_url:
58 self.raise_geo_restricted()
62 'url
': self._proto_relative_url(video_url, 'http
:'),
64 'thumbnail
': thumbnail_url,