[ytdl] ignore SyntaxErrors when trying to import a module

This commit is contained in:
Mike Fährmann
2024-08-29 19:28:08 +02:00
parent cf8e04d999
commit 127aa45834
3 changed files with 5 additions and 4 deletions

View File

@@ -18,7 +18,7 @@ def import_module(module_name):
if module_name is None:
try:
return __import__("yt_dlp")
except ImportError:
except (ImportError, SyntaxError):
return __import__("youtube_dl")
return __import__(module_name.replace("-", "_"))