use '_extractor' info in UrlJobs

This commit is contained in:
Mike Fährmann
2021-05-19 15:52:30 +02:00
parent 4fc9668922
commit adf4d661b3
2 changed files with 18 additions and 9 deletions

View File

@@ -597,10 +597,16 @@ class UrlJob(Job):
for url in kwdict["_fallback"]:
print("|", url)
def handle_queue(self, url, _):
try:
UrlJob(url, self, self.depth + 1).run()
except exception.NoExtractorError:
def handle_queue(self, url, kwdict):
cls = kwdict.get("_extractor")
if cls:
extr = cls.from_url(url)
else:
extr = extractor.find(url)
if extr:
self.status |= self.__class__(extr, self).run()
else:
self._write_unsupported(url)