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:
@@ -23,8 +23,10 @@ class MastodonExtractor(BaseExtractor):
|
||||
|
||||
def __init__(self, match):
|
||||
BaseExtractor.__init__(self, match)
|
||||
self.instance = self.root.partition("://")[2]
|
||||
self.item = match.group(match.lastindex)
|
||||
|
||||
def _init(self):
|
||||
self.instance = self.root.partition("://")[2]
|
||||
self.reblogs = self.config("reblogs", False)
|
||||
self.replies = self.config("replies", True)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user