From 23641742a356899521d903c33880596809a4f51f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Sun, 14 Mar 2021 17:02:38 +0100 Subject: [PATCH] improve 'parent-directory' (#1364) Allow forwarding metadata from the top-level extractor to all children if 'parent-directory' is enabled for all extractors along the way. For example 'reddit' -> 'gfycat' -> 'redgifs' --- gallery_dl/job.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gallery_dl/job.py b/gallery_dl/job.py index eae7bcb9..d837ac97 100644 --- a/gallery_dl/job.py +++ b/gallery_dl/job.py @@ -202,8 +202,11 @@ class DownloadJob(Job): pfmt = parent.pathfmt if pfmt and parent.extractor.config("parent-directory"): self.extractor._parentdir = pfmt.directory - if kwdict and parent.extractor.config("parent-metadata"): - self.kwdict.update(kwdict) + if parent.extractor.config("parent-metadata"): + if parent.kwdict: + self.kwdict.update(parent.kwdict) + if kwdict: + self.kwdict.update(kwdict) else: self.visited = set()