[dl:ytdl] improve error message when importing default ytdl modules

This commit is contained in:
Mike Fährmann
2025-12-04 18:28:09 +01:00
parent 918b06caf4
commit 8f91daa9bc

View File

@@ -50,8 +50,11 @@ class YoutubeDLDownloader(DownloaderBase):
try:
module = ytdl.import_module(self.config("module"))
except (ImportError, SyntaxError) as exc:
self.log.error("Cannot import module '%s'",
getattr(exc, "name", ""))
if exc.__context__:
self.log.error("Cannot import yt-dlp or youtube-dl")
else:
self.log.error("Cannot import module '%s'",
getattr(exc, "name", ""))
self.log.traceback(exc)
self.download = lambda u, p: False
return False