aboutsummaryrefslogtreecommitdiffstats
path: root/gallery_dl/downloader/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'gallery_dl/downloader/__init__.py')
-rw-r--r--gallery_dl/downloader/__init__.py16
1 files changed, 7 insertions, 9 deletions
diff --git a/gallery_dl/downloader/__init__.py b/gallery_dl/downloader/__init__.py
index 6fb09e1..e1b936e 100644
--- a/gallery_dl/downloader/__init__.py
+++ b/gallery_dl/downloader/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright 2015-2019 Mike Fährmann
+# Copyright 2015-2021 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
@@ -8,8 +8,6 @@
"""Downloader modules"""
-import importlib
-
modules = [
"http",
"text",
@@ -24,22 +22,22 @@ def find(scheme):
except KeyError:
pass
- klass = None
+ cls = None
if scheme == "https":
scheme = "http"
if scheme in modules: # prevent unwanted imports
try:
- module = importlib.import_module("." + scheme, __package__)
+ module = __import__(scheme, globals(), None, (), 1)
except ImportError:
pass
else:
- klass = module.__downloader__
+ cls = module.__downloader__
if scheme == "http":
- _cache["http"] = _cache["https"] = klass
+ _cache["http"] = _cache["https"] = cls
else:
- _cache[scheme] = klass
- return klass
+ _cache[scheme] = cls
+ return cls
# --------------------------------------------------------------------