projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[tvplay] Adapt _VALID_URL and test case to domain name change
[youtube-dl]
/
youtube_dl
/
extractor
/
rtve.py
diff --git
a/youtube_dl/extractor/rtve.py
b/youtube_dl/extractor/rtve.py
index e60f85b5b4842d90b49aeec9aa87da8def92d4f9..b42442d127c13e69fc81cb27e71cf117d2cb96b2 100644
(file)
--- a/
youtube_dl/extractor/rtve.py
+++ b/
youtube_dl/extractor/rtve.py
@@
-8,8
+8,9
@@
import time
from .common import InfoExtractor
from ..compat import compat_urlparse
from ..utils import (
from .common import InfoExtractor
from ..compat import compat_urlparse
from ..utils import (
-
struct_unpack
,
+
float_or_none
,
remove_end,
remove_end,
+ struct_unpack,
)
)
@@
-67,6
+68,7
@@
class RTVEALaCartaIE(InfoExtractor):
'id': '2491869',
'ext': 'mp4',
'title': 'Balonmano - Swiss Cup masculina. Final: España-Suecia',
'id': '2491869',
'ext': 'mp4',
'title': 'Balonmano - Swiss Cup masculina. Final: España-Suecia',
+ 'duration': 5024.566,
},
}, {
'note': 'Live stream',
},
}, {
'note': 'Live stream',
@@
-102,14
+104,28
@@
class RTVEALaCartaIE(InfoExtractor):
video_url = compat_urlparse.urljoin(
'http://mvod1.akcdn.rtve.es/', video_path)
video_url = compat_urlparse.urljoin(
'http://mvod1.akcdn.rtve.es/', video_path)
+ subtitles = None
+ if info.get('sbtFile') is not None:
+ subtitles = self.extract_subtitles(video_id, info['sbtFile'])
+
return {
'id': video_id,
'title': info['title'],
'url': video_url,
'thumbnail': info.get('image'),
'page_url': url,
return {
'id': video_id,
'title': info['title'],
'url': video_url,
'thumbnail': info.get('image'),
'page_url': url,
+ 'subtitles': subtitles,
+ 'duration': float_or_none(info.get('duration'), scale=1000),
}
}
+ def _get_subtitles(self, video_id, sub_file):
+ subs = self._download_json(
+ sub_file + '.json', video_id,
+ 'Downloading subtitles info')['page']['items']
+ return dict(
+ (s['lang'], [{'ext': 'vtt', 'url': s['src']}])
+ for s in subs)
+
class RTVELiveIE(InfoExtractor):
IE_NAME = 'rtve.es:live'
class RTVELiveIE(InfoExtractor):
IE_NAME = 'rtve.es:live'