Commit d8584c1

benny-dou <60535774+benny-dou@users.noreply.github.com>
2025-03-22 18:59:42
fix(ytdlp): fix `None` value in formats
1 parent f4571be
Changed files (1)
src
preview
src/preview/ytdlp.py
@@ -30,7 +30,7 @@ from multimedia import convert_to_h264, generate_cover
 from networking import hx_req
 from others.emoji import emojify
 from preview.utils import bv2av, make_bvid_clickable
-from utils import readable_size, readable_time, soup_to_text, to_int, true, ts_to_dt, unicode_to_ascii
+from utils import readable_size, readable_time, remove_none_values, soup_to_text, to_int, true, ts_to_dt, unicode_to_ascii
 
 
 class ProxyError(Exception):
@@ -253,7 +253,7 @@ def video_selector(ctx):
     if not formats:
         msg = "No format found."
         raise YoutubeDLError(msg)
-
+    formats = remove_none_values(formats)
     logger.trace(f"Choose best format from {len(formats)} extracted formats")
     # acodec='none' means there is no audio
     # find compatible extension, VP9 is not supported by iOS, use AVC instead