adjust loader to new config-interface

pull/13/head
Mike Fährmann 9 years ago
parent e23aaa4298
commit 49e91bcb73

@ -9,9 +9,8 @@
import os
import sys
import importlib
from . import extractor
from . import config, extractor
from .extractor.common import Message
from . import config
class DownloadManager():
@ -43,7 +42,7 @@ class DownloadJob():
def __init__(self, mngr, url):
self.mngr = mngr
self.extractor, self.info = extractor.find(url, mngr.config)
self.extractor, self.info = extractor.find(url)
if self.extractor is None:
return
self.directory = mngr.get_base_directory()

@ -11,7 +11,7 @@ import importlib
modules = [
"pixiv",
"exhentai",
# "exhentai",
"gelbooru",
"3dbooru",
"4chan",
@ -28,12 +28,12 @@ modules = [
"yandere",
]
def find(url, config):
def find(url):
"""Find extractor suitable for handling the given url"""
for pattern, module, klass in _list_patterns():
match = re.match(pattern, url)
if match:
return klass(match, config), module.info
return klass(match), module.info
# --------------------------------------------------------------------
# internals

Loading…
Cancel
Save