diff options
Diffstat (limited to 'module/Plugin.py')
-rw-r--r-- | module/Plugin.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/module/Plugin.py b/module/Plugin.py index 83610866d..59aa9c1d1 100644 --- a/module/Plugin.py +++ b/module/Plugin.py @@ -24,7 +24,6 @@ from os.path import join from time import sleep import sys -from os.path import exists from module.network.Request import Request from os import makedirs @@ -173,12 +172,13 @@ class Plugin(): def download(self, url, file_name, get={}, post={}, ref=True, cookies=True): download_folder = self.parent.core.config['general']['download_folder'] - if self.pyfile.package.data["package_name"] != (self.parent.core.config['general']['link_file']): + if self.pyfile.package.data["package_name"] != (self.parent.core.config['general']['link_file']) and self.parent.core.xmlconfig.get("general", "folder_per_package", False): self.pyfile.folder = self.pyfile.package.data["package_name"] location = join(download_folder, self.pyfile.folder.decode(sys.getfilesystemencoding())) - if not exists(location): makedirs(location) + makedirs(location) file_path = join(location.decode(sys.getfilesystemencoding()), self.pyfile.status.filename.decode(sys.getfilesystemencoding())) else: file_path = join(download_folder, self.pyfile.status.filename.decode(sys.getfilesystemencoding())) + file_path = join(download_folder, self.pyfile.status.filename.decode(sys.getfilesystemencoding())) self.pyfile.status.filename = self.req.download(url, file_path, get, post, ref, cookies) |