decouple extractor initialization
Introduce an 'initialize()' function that does the actual init (session, cookies, config options) and can called separately from the constructor __init__(). This allows, for example, to adjust config access inside a Job before most of it already happened when calling 'extractor.find()'.
This commit is contained in:
@@ -22,8 +22,7 @@ class DanbooruExtractor(BaseExtractor):
|
||||
per_page = 200
|
||||
request_interval = 1.0
|
||||
|
||||
def __init__(self, match):
|
||||
BaseExtractor.__init__(self, match)
|
||||
def _init(self):
|
||||
self.ugoira = self.config("ugoira", False)
|
||||
self.external = self.config("external", False)
|
||||
self.includes = False
|
||||
|
||||
Reference in New Issue
Block a user