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'
This commit is contained in:
Mike Fährmann 2021-03-14 17:02:38 +01:00
parent c485d0a956
commit 23641742a3
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -202,7 +202,10 @@ 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"):
if parent.extractor.config("parent-metadata"):
if parent.kwdict:
self.kwdict.update(parent.kwdict)
if kwdict:
self.kwdict.update(kwdict)
else:
self.visited = set()