From cc767e9490056efaaa11c186b0d032e4b4969180 Mon Sep 17 00:00:00 2001 From: bashonly <88596187+bashonly@users.noreply.github.com> Date: Wed, 3 Jul 2024 11:46:01 -0500 Subject: [PATCH] [core] Fix `--ignore-no-formats-error` (#10345) Fixes regression in 5ce582448ececb8d9c30c8c31f58330090ced03a Closes #10344 Authored by: Grub4K Co-authored-by: Simon Sawicki --- yt_dlp/utils/_utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/yt_dlp/utils/_utils.py b/yt_dlp/utils/_utils.py index b5e1e2950..e00c75f6a 100644 --- a/yt_dlp/utils/_utils.py +++ b/yt_dlp/utils/_utils.py @@ -5120,6 +5120,9 @@ class _UnsafeExtensionError(Exception): @classmethod def sanitize_extension(cls, extension, /, *, prepend=False): + if extension is None: + return None + if '/' in extension or '\\' in extension: raise cls(extension)