Skip to content

Commit

Permalink
implement changes for sinusbot
Browse files Browse the repository at this point in the history
  • Loading branch information
dkoekden committed Jul 17, 2024
1 parent 37c2335 commit e52dea5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions test/test_InfoExtractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ def test_parse_m3u8_formats(self):
'acodec': 'mp4a.40.2',
'audio_ext': 'mp4',
'video_ext': 'none',
'abr': 41.457,
'abr': 41,
}, {
'format_id': '263',
'format_index': None,
Expand Down Expand Up @@ -1260,7 +1260,7 @@ def test_parse_mpd_formats(self):
'format_id': 'audio=128001',
'manifest_url': 'https://sdn-global-streaming-cache-3qsdn.akamaized.net/stream/3144/files/17/07/672975/3144-kZT4LWMQw6Rh7Kpd.ism/manifest.mpd',
'ext': 'm4a',
'tbr': 128.001,
'tbr': 128,
'asr': 48000,
'format_note': 'DASH audio',
'container': 'm4a_dash',
Expand All @@ -1271,7 +1271,7 @@ def test_parse_mpd_formats(self):
'protocol': 'http_dash_segments',
'audio_ext': 'm4a',
'video_ext': 'none',
'abr': 128.001,
'abr': 128,
}, {
'format_id': 'video=100000',
'manifest_url': 'https://sdn-global-streaming-cache-3qsdn.akamaized.net/stream/3144/files/17/07/672975/3144-kZT4LWMQw6Rh7Kpd.ism/manifest.mpd',
Expand Down
1 change: 1 addition & 0 deletions yt_dlp/extractor/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2239,6 +2239,7 @@ def build_stream_name():
if mobj:
abr, vbr = mobj.groups()
abr, vbr = float_or_none(abr, 1000), float_or_none(vbr, 1000)
abr = int(abr)
f.update({
'vbr': vbr,
'abr': abr,
Expand Down
2 changes: 1 addition & 1 deletion yt_dlp/extractor/youtube.py
Original file line number Diff line number Diff line change
Expand Up @@ -3916,7 +3916,7 @@ def build_fragments(f):
video_id=video_id, only_once=True)
continue

tbr = float_or_none(fmt.get('averageBitrate') or fmt.get('bitrate'), 1000)
tbr = int_or_none(fmt.get('averageBitrate') or fmt.get('bitrate'), 1000)
format_duration = traverse_obj(fmt, ('approxDurationMs', {lambda x: float_or_none(x, 1000)}))
# Some formats may have much smaller duration than others (possibly damaged during encoding)
# E.g. 2-nOtRESiUc Ref: https://github.com/yt-dlp/yt-dlp/issues/2823
Expand Down

0 comments on commit e52dea5

Please sign in to comment.