run queue items immediately

pull/17/head
Mike Fährmann 7 years ago
parent 691c4dd709
commit ae686c4c08
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -118,18 +118,8 @@ class DownloadJob(Job):
Job.__init__(self, url)
self.pathfmt = util.PathFormat(self.extractor)
self.downloaders = {}
self.queue = None
self.out = output.select()
def run(self):
Job.run(self)
if self.queue:
for url in self.queue:
try:
DownloadJob(url).run()
except exception.NoExtractorError:
pass
def handle_url(self, url, keywords):
"""Download the resource specified in 'url'"""
self.pathfmt.set_keywords(keywords)
@ -144,11 +134,10 @@ class DownloadJob(Job):
self.pathfmt.set_directory(keywords)
def handle_queue(self, url):
"""Add url to work-queue"""
try:
self.queue.append(url)
except AttributeError:
self.queue = [url]
DownloadJob(url).run()
except exception.NoExtractorError:
pass
def handle_headers(self, headers):
self.get_downloader("http:").set_headers(headers)

Loading…
Cancel
Save