set target directory before postprocessor init (fixes #126)
This commit is contained in:
parent
9e188f6a21
commit
13cb270326
@ -235,7 +235,8 @@ class DownloadJob(Job):
|
|||||||
def handle_directory(self, keywords):
|
def handle_directory(self, keywords):
|
||||||
"""Set and create the target directory for downloads"""
|
"""Set and create the target directory for downloads"""
|
||||||
if not self.pathfmt:
|
if not self.pathfmt:
|
||||||
self.initialize()
|
self.initialize(keywords)
|
||||||
|
else:
|
||||||
self.pathfmt.set_directory(keywords)
|
self.pathfmt.set_directory(keywords)
|
||||||
|
|
||||||
def handle_queue(self, url, keywords):
|
def handle_queue(self, url, keywords):
|
||||||
@ -283,9 +284,11 @@ class DownloadJob(Job):
|
|||||||
self.downloaders[scheme] = instance
|
self.downloaders[scheme] = instance
|
||||||
return instance
|
return instance
|
||||||
|
|
||||||
def initialize(self):
|
def initialize(self, keywords=None):
|
||||||
"""Delayed initialization of PathFormat, etc."""
|
"""Delayed initialization of PathFormat, etc."""
|
||||||
self.pathfmt = util.PathFormat(self.extractor)
|
self.pathfmt = util.PathFormat(self.extractor)
|
||||||
|
if keywords:
|
||||||
|
self.pathfmt.set_directory(keywords)
|
||||||
self.sleep = self.extractor.config("sleep")
|
self.sleep = self.extractor.config("sleep")
|
||||||
|
|
||||||
skip = self.extractor.config("skip", True)
|
skip = self.extractor.config("skip", True)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user