projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Unify coding cookie
[youtube-dl]
/
youtube_dl
/
extractor
/
vbox7.py
diff --git
a/youtube_dl/extractor/vbox7.py
b/youtube_dl/extractor/vbox7.py
index fa7899e6dbd779fa824e1c4cdfdf16b76a8716eb..a1e0851b7424e4c73cd34b72c02f16bc1905b6ce 100644
(file)
--- a/
youtube_dl/extractor/vbox7.py
+++ b/
youtube_dl/extractor/vbox7.py
@@
-1,12
+1,14
@@
-#
en
coding: utf-8
+# coding: utf-8
from __future__ import unicode_literals
from __future__ import unicode_literals
+import re
+
from .common import InfoExtractor
from ..utils import urlencode_postdata
class Vbox7IE(InfoExtractor):
from .common import InfoExtractor
from ..utils import urlencode_postdata
class Vbox7IE(InfoExtractor):
- _VALID_URL = r'https?://(?:www\.)?vbox7\.com/
play:(?P<id>[^/
]+)'
+ _VALID_URL = r'https?://(?:www\.)?vbox7\.com/
(?:play:|emb/external\.php\?.*?\bvid=)(?P<id>[\da-fA-F
]+)'
_TESTS = [{
'url': 'http://vbox7.com/play:0946fff23c',
'md5': 'a60f9ab3a3a2f013ef9a967d5f7be5bf',
_TESTS = [{
'url': 'http://vbox7.com/play:0946fff23c',
'md5': 'a60f9ab3a3a2f013ef9a967d5f7be5bf',
@@
-24,15
+26,27
@@
class Vbox7IE(InfoExtractor):
'title': 'Смях! Чудо - чист за секунди - Скрита камера',
},
'skip': 'georestricted',
'title': 'Смях! Чудо - чист за секунди - Скрита камера',
},
'skip': 'georestricted',
+ }, {
+ 'url': 'http://vbox7.com/emb/external.php?vid=a240d20f9c&autoplay=1',
+ 'only_matching': True,
}]
}]
+ @staticmethod
+ def _extract_url(webpage):
+ mobj = re.search(
+ '<iframe[^>]+src=(?P<q>["\'])(?P<url>(?:https?:)?//vbox7\.com/emb/external\.php.+?)(?P=q)',
+ webpage)
+ if mobj:
+ return mobj.group('url')
+
def _real_extract(self, url):
video_id = self._match_id(url)
def _real_extract(self, url):
video_id = self._match_id(url)
- webpage = self._download_webpage(url, video_id)
+ webpage = self._download_webpage(
+ 'http://vbox7.com/play:%s' % video_id, video_id)
title = self._html_search_regex(
title = self._html_search_regex(
- r'<title>(.
*
)</title>', webpage, 'title').split('/')[0].strip()
+ r'<title>(.
+?
)</title>', webpage, 'title').split('/')[0].strip()
video_url = self._search_regex(
r'src\s*:\s*(["\'])(?P<url>.+?.mp4.*?)\1',
video_url = self._search_regex(
r'src\s*:\s*(["\'])(?P<url>.+?.mp4.*?)\1',