From b1a4c8bbaf244591e3b8af781fa61a13c5882bdf Mon Sep 17 00:00:00 2001 From: tcely Date: Wed, 4 Dec 2024 17:08:37 -0500 Subject: [PATCH] Include streams with a blank format_note and the proper height --- tubesync/sync/matching.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tubesync/sync/matching.py b/tubesync/sync/matching.py index 982af040..0b1f8d34 100644 --- a/tubesync/sync/matching.py +++ b/tubesync/sync/matching.py @@ -87,7 +87,7 @@ def get_best_video_format(media): return False, False # Filter video-only formats by resolution that matches the source video_formats = [] - sort_keys = [('height', False), ('id', False)] # key, reverse + sort_keys = [('height', False), ('vcodec', True), ('vbr', False)] # key, reverse for fmt in media.iter_formats(): # If the format has an audio stream, skip it if fmt['acodec'] is not None: @@ -120,6 +120,10 @@ def get_best_video_format(media): source_resolution = media.source.source_resolution.strip().upper() source_vcodec = media.source.source_vcodec exact_match, best_match = None, None + for fmt in video_formats: + # format_note was blank, match height instead + if '' == fmt['format'] and fmt['height'] == media.source.source_resolution_height: + fmt['format'] = source_resolution # Of our filtered video formats, check for resolution + codec + hdr + fps match if media.source.prefer_60fps and media.source.prefer_hdr: for fmt in video_formats: