give downloader classes proper names

pull/133/head
Mike Fährmann 6 years ago
parent 3c25fa2dad
commit b17a5d6f3b
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -20,7 +20,7 @@ def find(scheme):
try:
if "." not in scheme: # prevent relative imports
module = importlib.import_module("." + scheme, __package__)
klass = module.Downloader
klass = module.__downloader__
except (ImportError, AttributeError, TypeError):
pass
_cache[scheme] = klass

@ -15,7 +15,7 @@ from .common import DownloaderBase
from .. import text, exception
class Downloader(DownloaderBase):
class HttpDownloader(DownloaderBase):
scheme = "http"
def __init__(self, extractor, output):
@ -123,3 +123,6 @@ MIMETYPE_MAP = {
"application/ogg": "ogg",
"application/octet-stream": "bin",
}
__downloader__ = HttpDownloader

@ -11,7 +11,7 @@
from .common import DownloaderBase
class Downloader(DownloaderBase):
class TextDownloader(DownloaderBase):
scheme = "text"
def __init__(self, extractor, output):
@ -32,3 +32,6 @@ class Downloader(DownloaderBase):
@staticmethod
def get_extension():
return "txt"
__downloader__ = TextDownloader

@ -14,7 +14,7 @@ from .. import text
import os
class Downloader(DownloaderBase):
class YoutubeDLDownloader(DownloaderBase):
scheme = "ytdl"
def __init__(self, extractor, output):
@ -70,3 +70,6 @@ class Downloader(DownloaderBase):
for entry in info_dict["entries"]:
self.ytdl.process_info(entry)
return True
__downloader__ = YoutubeDLDownloader

Loading…
Cancel
Save