add 'metadata-extractor' option (#4549)
This commit is contained in:
@@ -675,6 +675,18 @@ Description
|
|||||||
to access the current file's filename as ``"{gdl_path.filename}"``.
|
to access the current file's filename as ``"{gdl_path.filename}"``.
|
||||||
|
|
||||||
|
|
||||||
|
extractor.*.metadata-extractor
|
||||||
|
------------------------------
|
||||||
|
extractor.*.extractor-metadata
|
||||||
|
------------------------------
|
||||||
|
Type
|
||||||
|
``string``
|
||||||
|
Description
|
||||||
|
Insert a reference to the current
|
||||||
|
`Extractor <https://github.com/mikf/gallery-dl/blob/v1.26.2/gallery_dl/extractor/common.py#L26>`__
|
||||||
|
object into metadata dictionaries as the given name.
|
||||||
|
|
||||||
|
|
||||||
extractor.*.metadata-http
|
extractor.*.metadata-http
|
||||||
-------------------------
|
-------------------------
|
||||||
extractor.*.http-metadata
|
extractor.*.http-metadata
|
||||||
|
|||||||
@@ -91,19 +91,23 @@ class Job():
|
|||||||
self.metadata_http = extr.config2("metadata-http", "http-metadata")
|
self.metadata_http = extr.config2("metadata-http", "http-metadata")
|
||||||
metadata_path = extr.config2("metadata-path", "path-metadata")
|
metadata_path = extr.config2("metadata-path", "path-metadata")
|
||||||
metadata_version = extr.config2("metadata-version", "version-metadata")
|
metadata_version = extr.config2("metadata-version", "version-metadata")
|
||||||
|
metadata_extractor = extr.config2(
|
||||||
|
"metadata-extractor", "extractor-metadata")
|
||||||
|
|
||||||
# user-supplied metadata
|
|
||||||
kwdict = extr.config("keywords")
|
|
||||||
if kwdict:
|
|
||||||
self.kwdict.update(kwdict)
|
|
||||||
if metadata_path:
|
if metadata_path:
|
||||||
self.kwdict[metadata_path] = path_proxy
|
self.kwdict[metadata_path] = path_proxy
|
||||||
|
if metadata_extractor:
|
||||||
|
self.kwdict[metadata_extractor] = extr
|
||||||
if metadata_version:
|
if metadata_version:
|
||||||
self.kwdict[metadata_version] = {
|
self.kwdict[metadata_version] = {
|
||||||
"version" : version.__version__,
|
"version" : version.__version__,
|
||||||
"is_executable" : util.EXECUTABLE,
|
"is_executable" : util.EXECUTABLE,
|
||||||
"current_git_head": util.git_head()
|
"current_git_head": util.git_head()
|
||||||
}
|
}
|
||||||
|
# user-supplied metadata
|
||||||
|
kwdict = extr.config("keywords")
|
||||||
|
if kwdict:
|
||||||
|
self.kwdict.update(kwdict)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
"""Execute or run the job"""
|
"""Execute or run the job"""
|
||||||
|
|||||||
Reference in New Issue
Block a user