Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions bilibili_api/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -2645,6 +2645,8 @@ def detect_best_streams(
def video_stream_cmp(
s1: VideoStreamDownloadURL, s2: VideoStreamDownloadURL
):
if s1.video_quality is None or s2.video_quality is None:
return 0
# 杜比/HDR 优先
if s1.video_quality == VideoQuality.DOLBY and (not no_dolby_video):
return 1
Expand All @@ -2664,6 +2666,8 @@ def video_stream_cmp(
def audio_stream_cmp(
s1: AudioStreamDownloadURL, s2: AudioStreamDownloadURL
):
if s1.audio_quality is None or s2.audio_quality is None:
return 0
# 杜比/Hi-Res 优先
if s1.audio_quality == AudioQuality.DOLBY and (not no_dolby_audio):
return 1
Expand Down