summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-08-07 20:52:35 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-08-07 20:52:35 +0200
commit1fe83a93650db27d7ecf4c3476ce2e00f994513e (patch)
treeadc20c882b74421176a3d56446b9cf1589c9d789
parentclosed #375 (diff)
downloadpyload-1fe83a93650db27d7ecf4c3476ce2e00f994513e.tar.xz
closed #359
-rw-r--r--module/network/HTTPRequest.py3
-rw-r--r--module/plugins/hooks/UnRar.py19
2 files changed, 10 insertions, 12 deletions
diff --git a/module/network/HTTPRequest.py b/module/network/HTTPRequest.py
index 315cb7d23..fb89334c6 100644
--- a/module/network/HTTPRequest.py
+++ b/module/network/HTTPRequest.py
@@ -168,8 +168,7 @@ class HTTPRequest():
self.header = ""
- if self.headers:
- self.c.setopt(pycurl.HTTPHEADER, self.headers)
+ self.c.setopt(pycurl.HTTPHEADER, self.headers)
if just_header:
self.c.setopt(pycurl.FOLLOWLOCATION, 0)
diff --git a/module/plugins/hooks/UnRar.py b/module/plugins/hooks/UnRar.py
index 778ae669c..94ae9da11 100644
--- a/module/plugins/hooks/UnRar.py
+++ b/module/plugins/hooks/UnRar.py
@@ -19,14 +19,15 @@
from __future__ import with_statement
import sys
+import os
+from os.path import exists, join, isabs, isdir
+from os import remove, makedirs, rmdir, listdir, chown, chmod
+from traceback import print_exc
from module.plugins.Hook import Hook
from module.lib.pyunrar import Unrar, WrongPasswordError, CommandError, UnknownError, LowRamError
-from traceback import print_exc
-import os
-from os.path import exists, join, isabs, isdir
-from os import remove, makedirs, rmdir, listdir, chown, chmod
+from module.utils import save_join
if os.name != "nt":
from pwd import getpwnam
@@ -156,10 +157,8 @@ class UnRar(Hook):
download_folder = self.core.config['general']['download_folder']
self.core.log.debug(_("download folder %s") % download_folder)
- if self.core.config['general']['folder_per_package']:
- folder = join(download_folder, pack.folder.decode(sys.getfilesystemencoding()))
- else:
- folder = download_folder
+ folder = save_join(download_folder, pack.folder, "")
+
destination = folder
if self.getConfig("unrar_destination") and not self.getConfig("unrar_destination").lower() == "none":
@@ -168,9 +167,9 @@ class UnRar(Hook):
if self.core.config['general']['folder_per_package']:
sub = pack.folder.decode(sys.getfilesystemencoding())
if isabs(destination):
- destination = join(destination, sub)
+ destination = join(destination, sub, "")
else:
- destination = join(folder, destination, sub)
+ destination = join(folder, destination, sub, "")
self.core.log.debug(_("Destination folder %s") % destination)
if not exists(destination):