give downloader classes proper names
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user