[common] add a 'kwdict' member to extractor instances
to allow setting general metadata at any point and without having to rely on a manually implemented 'metadata()' method
This commit is contained in:
@@ -54,6 +54,7 @@ class Extractor():
|
|||||||
self.url = match.string
|
self.url = match.string
|
||||||
self.match = match
|
self.match = match
|
||||||
self.groups = match.groups()
|
self.groups = match.groups()
|
||||||
|
self.kwdict = {}
|
||||||
|
|
||||||
if self.category in CATEGORY_MAP:
|
if self.category in CATEGORY_MAP:
|
||||||
self.category = CATEGORY_MAP[self.category]
|
self.category = CATEGORY_MAP[self.category]
|
||||||
|
|||||||
@@ -228,6 +228,8 @@ class Job():
|
|||||||
kwdict["subcategory"] = extr.subcategory
|
kwdict["subcategory"] = extr.subcategory
|
||||||
if self.metadata_http:
|
if self.metadata_http:
|
||||||
kwdict.pop(self.metadata_http, None)
|
kwdict.pop(self.metadata_http, None)
|
||||||
|
if extr.kwdict:
|
||||||
|
kwdict.update(extr.kwdict)
|
||||||
if self.kwdict:
|
if self.kwdict:
|
||||||
kwdict.update(self.kwdict)
|
kwdict.update(self.kwdict)
|
||||||
if self.kwdict_eval:
|
if self.kwdict_eval:
|
||||||
|
|||||||
Reference in New Issue
Block a user