[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:
Mike Fährmann
2025-06-19 19:06:29 +02:00
parent a80d55d974
commit fcd1b8a155
2 changed files with 3 additions and 0 deletions

View File

@@ -54,6 +54,7 @@ class Extractor():
self.url = match.string
self.match = match
self.groups = match.groups()
self.kwdict = {}
if self.category in CATEGORY_MAP:
self.category = CATEGORY_MAP[self.category]

View File

@@ -228,6 +228,8 @@ class Job():
kwdict["subcategory"] = extr.subcategory
if self.metadata_http:
kwdict.pop(self.metadata_http, None)
if extr.kwdict:
kwdict.update(extr.kwdict)
if self.kwdict:
kwdict.update(self.kwdict)
if self.kwdict_eval: