diff options
Diffstat (limited to 'gallery_dl/downloader/common.py')
| -rw-r--r-- | gallery_dl/downloader/common.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gallery_dl/downloader/common.py b/gallery_dl/downloader/common.py index 7cd8d10..66996f7 100644 --- a/gallery_dl/downloader/common.py +++ b/gallery_dl/downloader/common.py @@ -31,8 +31,15 @@ class DownloaderBase(): self.partdir = self.config("part-directory") if self.partdir: - self.partdir = util.expand_path(self.partdir) - os.makedirs(self.partdir, exist_ok=True) + if isinstance(self.partdir, dict): + self.partdir = [ + (util.compile_filter(expr) if expr else util.true, + util.expand_path(pdir)) + for expr, pdir in self.partdir.items() + ] + else: + self.partdir = util.expand_path(self.partdir) + os.makedirs(self.partdir, exist_ok=True) proxies = self.config("proxy", util.SENTINEL) if proxies is util.SENTINEL: |
