[common] use 'parent' value as 'parent-metadata' default (#8525 #8604)

enable 'parent-metadata' by default for
'chevereto' & 'imagehost' (album/gallery) extractors
This commit is contained in:
Mike Fährmann
2025-12-08 20:07:56 +01:00
parent f5f4122cb6
commit b1b70528a6
6 changed files with 20 additions and 3 deletions

View File

@@ -231,10 +231,13 @@ Type
* ``bool``
* ``string``
Default
``true``
``[chevereto]`` |
``[imagehost]``
``false``
otherwise
Description
If ``true``, overwrite any metadata provided by a child extractor
with its parent's.
Forward a parent's metadata to its child extractors.
| If this is a ``string``, add a parent's metadata to its children's
to a field named after said string.

View File

@@ -1007,6 +1007,11 @@
"videos" : true
},
"chevereto":
{
"parent-metadata": true
},
"Danbooru":
{
"sleep-request": "0.5-1.5",
@@ -1076,6 +1081,11 @@
"referer": false
},
"imagehost":
{
"parent-metadata": true
},
"mastodon":
{
"access-token": null,

View File

@@ -17,6 +17,7 @@ class CheveretoExtractor(BaseExtractor):
basecategory = "chevereto"
directory_fmt = ("{category}", "{user}", "{album}")
archive_fmt = "{id}"
parent = True
def _init(self):
self.path = self.groups[-1]

View File

@@ -33,6 +33,7 @@ class Extractor():
basecategory = ""
basesubcategory = ""
categorytransfer = False
parent = False
directory_fmt = ("{category}",)
filename_fmt = "{filename}.{extension}"
archive_fmt = ""

View File

@@ -19,6 +19,7 @@ class ImagehostImageExtractor(Extractor):
basecategory = "imagehost"
subcategory = "image"
archive_fmt = "{token}"
parent = True
_https = True
_params = None
_cookies = None

View File

@@ -452,7 +452,8 @@ class DownloadJob(Job):
else:
extr._parentdir = pextr._parentdir
if pmeta := pextr.config2("parent-metadata", "metadata-parent"):
if pmeta := pextr.config2(
"parent-metadata", "metadata-parent", pextr.parent):
if isinstance(pmeta, str):
data = self.kwdict.copy()
if kwdict: