aboutsummaryrefslogtreecommitdiffstats
path: root/gallery_dl/downloader
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2022-02-14 17:17:07 -0500
committerLibravatarUnit 193 <unit193@unit193.net>2022-02-14 17:17:07 -0500
commit7900ee4e3692dbd8056c3e47c81bb22eda030b65 (patch)
tree54d10ca35e4b8538d2c61470490642b660e2ae77 /gallery_dl/downloader
parent99bc014c924c755f10a4a930b1a83efabd84fde1 (diff)
New upstream version 1.20.5.upstream/1.20.5
Diffstat (limited to 'gallery_dl/downloader')
-rw-r--r--gallery_dl/downloader/ytdl.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/gallery_dl/downloader/ytdl.py b/gallery_dl/downloader/ytdl.py
index 30f628e..462bbf8 100644
--- a/gallery_dl/downloader/ytdl.py
+++ b/gallery_dl/downloader/ytdl.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright 2018-2021 Mike Fährmann
+# Copyright 2018-2022 Mike Fährmann
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
@@ -39,7 +39,13 @@ class YoutubeDLDownloader(DownloaderBase):
if not ytdl_instance:
ytdl_instance = self.ytdl_instance
if not ytdl_instance:
- module = ytdl.import_module(self.config("module"))
+ try:
+ module = ytdl.import_module(self.config("module"))
+ except ImportError as exc:
+ self.log.error("Cannot import module '%s'", exc.name)
+ self.log.debug("", exc_info=True)
+ self.download = lambda u, p: False
+ return False
self.ytdl_instance = ytdl_instance = ytdl.construct_YoutubeDL(
module, self, self.ytdl_opts)
if self.outtmpl == "default":