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