summaryrefslogtreecommitdiffstats
path: root/gallery_dl/downloader/__init__.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2019-07-20 05:51:44 -0400
committerLibravatarUnit 193 <unit193@ubuntu.com>2019-07-20 05:51:44 -0400
commit2a63a9c9b7032a76894c48ac4d9cea732fcaee49 (patch)
tree3d5f633ff69cd393036a3dabc4d4533c8484f9ad /gallery_dl/downloader/__init__.py
parent195c45911e79c33cf0bb986721365fb06df5a153 (diff)
New upstream version 1.9.0upstream/1.9.0
Diffstat (limited to 'gallery_dl/downloader/__init__.py')
-rw-r--r--gallery_dl/downloader/__init__.py21
1 files changed, 15 insertions, 6 deletions
diff --git a/gallery_dl/downloader/__init__.py b/gallery_dl/downloader/__init__.py
index 97972cd..6fb09e1 100644
--- a/gallery_dl/downloader/__init__.py
+++ b/gallery_dl/downloader/__init__.py
@@ -22,15 +22,24 @@ def find(scheme):
try:
return _cache[scheme]
except KeyError:
- klass = None
+ pass
+
+ klass = None
+ if scheme == "https":
+ scheme = "http"
+ if scheme in modules: # prevent unwanted imports
try:
- if scheme in modules: # prevent unwanted imports
- module = importlib.import_module("." + scheme, __package__)
- klass = module.__downloader__
- except (ImportError, AttributeError, TypeError):
+ module = importlib.import_module("." + scheme, __package__)
+ except ImportError:
pass
+ else:
+ klass = module.__downloader__
+
+ if scheme == "http":
+ _cache["http"] = _cache["https"] = klass
+ else:
_cache[scheme] = klass
- return klass
+ return klass
# --------------------------------------------------------------------