prevent infinite recursion when spawning extractors (closes #489)

This commit is contained in:
Mike Fährmann
2019-12-26 23:38:16 +01:00
parent 896896a490
commit 2e2fc7f0ad

View File

@@ -182,6 +182,7 @@ class DownloadJob(Job):
self.downloaders = {}
self.postprocessors = None
self.out = output.select()
self.visited = parent.visited if parent else set()
def handle_url(self, url, kwdict, fallback=None):
"""Download the resource specified in 'url'"""
@@ -261,6 +262,10 @@ class DownloadJob(Job):
pp.run_metadata(pathfmt)
def handle_queue(self, url, kwdict):
if url in self.visited:
return
self.visited.add(url)
if "_extractor" in kwdict:
extr = kwdict["_extractor"].from_url(url)
else: