mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-23 03:02:50 +01:00
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):
|
||||
"""Set and create the target directory for downloads"""
|
||||
if not self.pathfmt:
|
||||
self.initialize()
|
||||
self.initialize(keywords)
|
||||
else:
|
||||
self.pathfmt.set_directory(keywords)
|
||||
|
||||
def handle_queue(self, url, keywords):
|
||||
@ -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