projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
529d26c
)
[cspan] Extract subtitles
author
Yen Chi Hsuan
<yan12125@gmail.com>
Fri, 24 Apr 2015 15:46:51 +0000
(23:46 +0800)
committer
Yen Chi Hsuan
<yan12125@gmail.com>
Sat, 25 Apr 2015 15:18:27 +0000
(23:18 +0800)
youtube_dl/extractor/cspan.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/cspan.py
b/youtube_dl/extractor/cspan.py
index d516b14028ae08f8de540678c7407d7b97c4595d..fbefd37d09a98bb19c82b4c09b7b08c99d147d35 100644
(file)
--- a/
youtube_dl/extractor/cspan.py
+++ b/
youtube_dl/extractor/cspan.py
@@
-8,6
+8,7
@@
from ..utils import (
unescapeHTML,
find_xpath_attr,
smuggle_url,
unescapeHTML,
find_xpath_attr,
smuggle_url,
+ determine_ext,
)
from .senateisvp import SenateISVPIE
)
from .senateisvp import SenateISVPIE
@@
-87,6
+88,10
@@
class CSpanIE(InfoExtractor):
return self.url_result(surl, 'SenateISVP', video_id, title)
files = data['video']['files']
return self.url_result(surl, 'SenateISVP', video_id, title)
files = data['video']['files']
+ try:
+ capfile = data['video']['capfile']['#text']
+ except KeyError:
+ capfile = None
entries = [{
'id': '%s_%d' % (video_id, partnum + 1),
entries = [{
'id': '%s_%d' % (video_id, partnum + 1),
@@
-97,6
+102,12
@@
class CSpanIE(InfoExtractor):
'description': description,
'thumbnail': thumbnail,
'duration': int_or_none(f.get('length', {}).get('#text')),
'description': description,
'thumbnail': thumbnail,
'duration': int_or_none(f.get('length', {}).get('#text')),
+ 'subtitles': {
+ 'en': [{
+ 'url': capfile,
+ 'ext': determine_ext(capfile, 'dfxp')
+ }],
+ } if capfile else None,
} for partnum, f in enumerate(files)]
if len(entries) == 1:
} for partnum, f in enumerate(files)]
if len(entries) == 1: