projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a7b8467
)
Sportbox source fix. HD videos support.
author
Vitaliy Syrchikov
<maddoger@gmail.com>
Fri, 15 May 2015 13:53:05 +0000
(17:53 +0400)
committer
Vitaliy Syrchikov
<maddoger@gmail.com>
Fri, 15 May 2015 13:53:05 +0000
(17:53 +0400)
youtube_dl/extractor/sportbox.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/sportbox.py
b/youtube_dl/extractor/sportbox.py
index 8302205438eb2687b6d13fb38e8853ec7068f8f5..695b3ff825288d620865a8b8cc65a7b378ed8e5b 100644
(file)
--- a/
youtube_dl/extractor/sportbox.py
+++ b/
youtube_dl/extractor/sportbox.py
@@
-14,7
+14,7
@@
class SportBoxIE(InfoExtractor):
_VALID_URL = r'https?://news\.sportbox\.ru/(?:[^/]+/)+spbvideo_NI\d+_(?P<display_id>.+)'
_TESTS = [
{
_VALID_URL = r'https?://news\.sportbox\.ru/(?:[^/]+/)+spbvideo_NI\d+_(?P<display_id>.+)'
_TESTS = [
{
- 'url': 'http://news.sportbox.ru/Vidy_sporta/Avtosport/Rossijskij/spbvideo_NI483529_Gonka-2-zaezd-Obyedinenniy-2000-klassi-Turing-i-S',
+ 'url': 'http://news.sportbox.ru/Vidy_sporta/Avtosport/Rossijskij/spbvideo_NI483529_Gonka-2-zaezd-Obyedinenniy-2000-klassi-Turing-i-S',
'md5': 'ff56a598c2cf411a9a38a69709e97079',
'info_dict': {
'id': '80822',
'md5': 'ff56a598c2cf411a9a38a69709e97079',
'info_dict': {
'id': '80822',
@@
-42,11
+42,15
@@
class SportBoxIE(InfoExtractor):
webpage = self._download_webpage(url, display_id)
webpage = self._download_webpage(url, display_id)
- video_id = self._search_regex(
- r'src="/vdl/player/media/(\d+)"', webpage, 'video id')
+ sobj = re.search(r'src="/vdl/player/(?P<media_type>\w+)/(?P<video_id>\d+)"', webpage)
+ if (sobj):
+ video_id = sobj.group('video_id')
+ media_type = sobj.group('media_type')
+ else:
+ raise RegexNotFoundError('Unable to extract video_id')
player = self._download_webpage(
player = self._download_webpage(
- 'http://news.sportbox.ru/vdl/player/
media/%s' % video_id
,
+ 'http://news.sportbox.ru/vdl/player/
%s/%s' % (media_type, video_id)
,
display_id, 'Downloading player webpage')
hls = self._search_regex(
display_id, 'Downloading player webpage')
hls = self._search_regex(