]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/vbox7.py
bef6394626d4eca25785d35199c1092f69f45b54
2 from __future__
import unicode_literals
6 from .common
import InfoExtractor
7 from ..utils
import ExtractorError
10 class Vbox7IE(InfoExtractor
):
13 (?:[^/]+\.)?vbox7\.com/
24 'url': 'http://vbox7.com/play:0946fff23c',
25 'md5': 'a60f9ab3a3a2f013ef9a967d5f7be5bf',
29 'title': 'Борисов: Притеснен съм за бъдещето на България',
30 'description': 'По думите му е опасно страната ни да бъде обявена за "сигурна"',
31 'thumbnail': r
're:^https?://.*\.jpg$',
32 'timestamp': 1470982814,
33 'upload_date': '20160812',
34 'uploader': 'zdraveibulgaria',
37 'proxy': '127.0.0.1:8118',
40 'url': 'http://vbox7.com/play:249bb972c2',
41 'md5': '99f65c0c9ef9b682b97313e052734c3f',
45 'title': 'Смях! Чудо - чист за секунди - Скрита камера',
47 'skip': 'georestricted',
49 'url': 'http://vbox7.com/emb/external.php?vid=a240d20f9c&autoplay=1',
50 'only_matching': True,
52 'url': 'http://i49.vbox7.com/player/ext.swf?vid=0946fff23c&autoplay=1',
53 'only_matching': True,
57 def _extract_url(webpage
):
59 r
'<iframe[^>]+src=(?P<q>["\'])(?P
<url
>(?
:https?
:)?
//vbox7\
.com
/emb
/external\
.php
.+?
)(?P
=q
)',
62 return mobj.group('url
')
64 def _real_extract(self, url):
65 video_id = self._match_id(url)
67 response = self._download_json(
68 'https
://www
.vbox7
.com
/ajax
/video
/nextvideo
.php?vid
=%s' % video_id,
71 if 'error
' in response:
73 '%s said
: %s' % (self.IE_NAME, response['error
']), expected=True)
75 video = response['options
']
77 title = video['title
']
78 video_url = video['src
']
80 if '/na
.mp4
' in video_url:
81 self.raise_geo_restricted()
83 uploader = video.get('uploader
')
85 webpage = self._download_webpage(
86 'http
://vbox7
.com
/play
:%s' % video_id, video_id, fatal=None)
91 info = self._search_json_ld(
92 webpage.replace('"/*@context"', '"@context"'), video_id,
100 'thumbnail
': self._proto_relative_url(
101 info.get('thumbnail
') or self._og_search_thumbnail(webpage),