add 'parent-skip' option (#1399)

pull/1558/head
Mike Fährmann 3 years ago
parent c693db5b1a
commit 7ab8374385
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -143,6 +143,16 @@ Description
Overwrite any metadata provided by a child extractor with its parent's.
extractor.*.parent-skip
-----------------------
Type
``bool``
Default
``false``
Description
Share number of skipped downloads between parent and child extractors.
extractor.*.path-restrict
-------------------------
Type

@ -201,6 +201,7 @@ class DownloadJob(Job):
self.hooks = ()
self.downloaders = {}
self.out = output.select()
self._skipcnt = 0
if parent:
self.visited = parent.visited
@ -306,7 +307,13 @@ class DownloadJob(Job):
extr = None
if extr:
self.status |= self.__class__(extr, self, kwdict).run()
job = self.__class__(extr, self, kwdict)
if extr.config("parent-skip"):
job._skipcnt = self._skipcnt
self.status |= job.run()
self._skipcnt = job._skipcnt
else:
self.status |= job.run()
else:
self._write_unsupported(url)
@ -406,7 +413,6 @@ class DownloadJob(Job):
self._skipexc = exception.TerminateExtraction
elif skip == "exit":
self._skipexc = sys.exit
self._skipcnt = 0
self._skipmax = text.parse_int(smax)
else:
# monkey-patch methods to always return False

Loading…
Cancel
Save