diff --git a/docs/configuration.rst b/docs/configuration.rst index 057560c1..b33cf225 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -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. diff --git a/docs/gallery-dl.conf b/docs/gallery-dl.conf index 40781973..8574ec31 100644 --- a/docs/gallery-dl.conf +++ b/docs/gallery-dl.conf @@ -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, diff --git a/gallery_dl/extractor/chevereto.py b/gallery_dl/extractor/chevereto.py index e25634e6..d916ef01 100644 --- a/gallery_dl/extractor/chevereto.py +++ b/gallery_dl/extractor/chevereto.py @@ -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] diff --git a/gallery_dl/extractor/common.py b/gallery_dl/extractor/common.py index 98cd61fb..13c7bbef 100644 --- a/gallery_dl/extractor/common.py +++ b/gallery_dl/extractor/common.py @@ -33,6 +33,7 @@ class Extractor(): basecategory = "" basesubcategory = "" categorytransfer = False + parent = False directory_fmt = ("{category}",) filename_fmt = "{filename}.{extension}" archive_fmt = "" diff --git a/gallery_dl/extractor/imagehosts.py b/gallery_dl/extractor/imagehosts.py index be5104da..21e6cf8d 100644 --- a/gallery_dl/extractor/imagehosts.py +++ b/gallery_dl/extractor/imagehosts.py @@ -19,6 +19,7 @@ class ImagehostImageExtractor(Extractor): basecategory = "imagehost" subcategory = "image" archive_fmt = "{token}" + parent = True _https = True _params = None _cookies = None diff --git a/gallery_dl/job.py b/gallery_dl/job.py index e3ebe96e..7a52bd6b 100644 --- a/gallery_dl/job.py +++ b/gallery_dl/job.py @@ -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: