projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5ca3459
)
[dispeak] improve mp4 bitrate extraction
author
Remita Amine
<remitamine@gmail.com>
Tue, 9 Apr 2019 10:21:46 +0000
(11:21 +0100)
committer
Remita Amine
<remitamine@gmail.com>
Tue, 9 Apr 2019 10:21:46 +0000
(11:21 +0100)
youtube_dl/extractor/dispeak.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/dispeak.py
b/youtube_dl/extractor/dispeak.py
index c05f601e2b1a69dcf4d73e090638ec990c6c7331..c345e0274192383790f32eeb1db1f3e013870238 100644
(file)
--- a/
youtube_dl/extractor/dispeak.py
+++ b/
youtube_dl/extractor/dispeak.py
@@
-58,10
+58,17
@@
class DigitallySpeakingIE(InfoExtractor):
stream_name = xpath_text(a_format, 'streamName', fatal=True)
video_path = re.match(r'mp4\:(?P<path>.*)', stream_name).group('path')
url = video_root + video_path
stream_name = xpath_text(a_format, 'streamName', fatal=True)
video_path = re.match(r'mp4\:(?P<path>.*)', stream_name).group('path')
url = video_root + video_path
- vbr = xpath_text(a_format, 'bitrate')
+ bitrate = xpath_text(a_format, 'bitrate')
+ tbr = int_or_none(bitrate)
+ vbr = int_or_none(self._search_regex(
+ r'-(\d+)\.mp4', video_path, 'vbr', default=None))
+ abr = tbr - vbr if tbr and vbr else None
video_formats.append({
video_formats.append({
+ 'format_id': bitrate,
'url': url,
'url': url,
- 'vbr': int_or_none(vbr),
+ 'tbr': tbr,
+ 'vbr': vbr,
+ 'abr': abr,
})
return video_formats
})
return video_formats