aboutsummaryrefslogtreecommitdiffhomepage
path: root/youtube_dl/extractor/dispeak.py
diff options
context:
space:
mode:
authorRemita Amine <[email protected]>2019-04-09 11:21:46 +0100
committerRemita Amine <[email protected]>2019-04-09 11:21:46 +0100
commit4bc12b8f819cd0a393e5800d4dc2ecf24401e199 (patch)
tree98ab3aed225a97bc46a27fdf12b777d8e9e9675c /youtube_dl/extractor/dispeak.py
parent5ca3459828cc0d752f02dab3e9c02cca85185cbb (diff)
downloadyoutube-dl-4bc12b8f819cd0a393e5800d4dc2ecf24401e199.tar.gz
youtube-dl-4bc12b8f819cd0a393e5800d4dc2ecf24401e199.zip
[dispeak] improve mp4 bitrate extraction
Diffstat (limited to 'youtube_dl/extractor/dispeak.py')
-rw-r--r--youtube_dl/extractor/dispeak.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/youtube_dl/extractor/dispeak.py b/youtube_dl/extractor/dispeak.py
index c05f601e2..c345e0274 100644
--- 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
- 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({
+ 'format_id': bitrate,
'url': url,
- 'vbr': int_or_none(vbr),
+ 'tbr': tbr,
+ 'vbr': vbr,
+ 'abr': abr,
})
return video_formats