projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
dc4e4f9
)
[streamcz] Add support for subtitles
author
Ondřej Caletka
<ondrej@caletka.cz>
Sun, 21 May 2017 08:41:52 +0000
(10:41 +0200)
committer
Sergey M
<dstftw@gmail.com>
Sun, 21 May 2017 08:41:52 +0000
(15:41 +0700)
youtube_dl/extractor/streamcz.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/streamcz.py
b/youtube_dl/extractor/streamcz.py
index 9e533103c88b93157efdd28d7765a7e9ae961603..58e0b4c802781728cf9d4ba17a19236bc3b54565 100644
(file)
--- a/
youtube_dl/extractor/streamcz.py
+++ b/
youtube_dl/extractor/streamcz.py
@@
-26,7
+26,7
@@
class StreamCZIE(InfoExtractor):
_TESTS = [{
'url': 'http://www.stream.cz/peklonataliri/765767-ecka-pro-deti',
_TESTS = [{
'url': 'http://www.stream.cz/peklonataliri/765767-ecka-pro-deti',
- 'md5': '
6d3ca61a8d0633c9c542b92fcb936b0c
',
+ 'md5': '
934bb6a6d220d99c010783c9719960d5
',
'info_dict': {
'id': '765767',
'ext': 'mp4',
'info_dict': {
'id': '765767',
'ext': 'mp4',
@@
-37,7
+37,7
@@
class StreamCZIE(InfoExtractor):
},
}, {
'url': 'http://www.stream.cz/blanik/10002447-tri-roky-pro-mazanka',
},
}, {
'url': 'http://www.stream.cz/blanik/10002447-tri-roky-pro-mazanka',
- 'md5': '
e54a254fb8b871968fd8403255f28589
',
+ 'md5': '
849a88c1e1ca47d41403c2ba5e59e261
',
'info_dict': {
'id': '10002447',
'ext': 'mp4',
'info_dict': {
'id': '10002447',
'ext': 'mp4',
@@
-85,6
+85,14
@@
class StreamCZIE(InfoExtractor):
else:
title = data['name']
else:
title = data['name']
+ subtitles = {}
+ srt_url = data.get('subtitles_srt')
+ if srt_url:
+ subtitles['cs'] = [{
+ 'ext': 'srt',
+ 'url': srt_url,
+ }]
+
return {
'id': video_id,
'title': title,
return {
'id': video_id,
'title': title,
@@
-93,4
+101,5
@@
class StreamCZIE(InfoExtractor):
'description': data.get('web_site_text'),
'duration': int_or_none(data.get('duration')),
'view_count': int_or_none(data.get('views')),
'description': data.get('web_site_text'),
'duration': int_or_none(data.get('duration')),
'view_count': int_or_none(data.get('views')),
+ 'subtitles': subtitles,
}
}