projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
355c524
)
[srf] Extract subtitles
author
Sergey M․
<dstftw@gmail.com>
Thu, 16 Apr 2015 14:48:17 +0000
(20:48 +0600)
committer
Sergey M․
<dstftw@gmail.com>
Thu, 16 Apr 2015 14:48:17 +0000
(20:48 +0600)
youtube_dl/extractor/srf.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/srf.py
b/youtube_dl/extractor/srf.py
index 4be329a2f563bd5ff3db186fae0c579680405f36..a080eb7ca7251467e25f085594ab9cdd5111704c 100644
(file)
--- a/
youtube_dl/extractor/srf.py
+++ b/
youtube_dl/extractor/srf.py
@@
-83,6
+83,16
@@
class SrfIE(InfoExtractor):
self._sort_formats(formats)
+ subtitles = {}
+ subtitles_data = video_data.find('Subtitles')
+ if subtitles_data is not None:
+ subtitles_list = [{
+ 'url': sub.text,
+ 'ext': determine_ext(sub.text),
+ } for sub in subtitles_data]
+ if subtitles_list:
+ subtitles['de'] = subtitles_list
+
return {
'id': video_id,
'display_id': display_id,
@@
-90,4
+100,5
@@
class SrfIE(InfoExtractor):
'title': title,
'thumbnails': thumbnails,
'timestamp': timestamp,
+ 'subtitles': subtitles,
}