diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-01-22 13:59:46 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-01-22 13:59:46 +0100 |
commit | a2ab9ced6ffb038a051e465f06d8b5ca6512a79b (patch) | |
tree | 312de4b766b27d88e7f1e566d8cf6bc1d9461d50 /module | |
parent | realdebrid encoding fix (diff) | |
download | pyload-a2ab9ced6ffb038a051e465f06d8b5ca6512a79b.tar.xz |
try to fix unrar encoding issues
Diffstat (limited to 'module')
-rw-r--r-- | module/plugins/hooks/ExtractArchive.py | 3 | ||||
-rw-r--r-- | module/plugins/internal/UnRar.py | 12 |
2 files changed, 7 insertions, 8 deletions
diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index d9c2e57bb..53f88b3a5 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -3,7 +3,6 @@ import sys import os -from os import remove, chmod, makedirs from os.path import basename, isfile, isdir, join from traceback import print_exc from copy import copy @@ -48,7 +47,7 @@ if os.name != "nt": from pwd import getpwnam from grp import getgrnam -from module.utils.fs import save_join, fs_encode, exists +from module.utils.fs import save_join, fs_encode, exists, remove, chmod, makedirs from module.plugins.Hook import Hook, threaded, Expose from module.plugins.internal.AbstractExtractor import ArchiveError, CRCError, WrongPassword diff --git a/module/plugins/internal/UnRar.py b/module/plugins/internal/UnRar.py index 9f57a9ad6..ce271bec4 100644 --- a/module/plugins/internal/UnRar.py +++ b/module/plugins/internal/UnRar.py @@ -23,7 +23,7 @@ from os.path import join from glob import glob from subprocess import Popen, PIPE -from module.utils.fs import save_join, decode +from module.utils.fs import save_join, decode, fs_encode from module.plugins.internal.AbstractExtractor import AbtractExtractor, WrongPassword, ArchiveError, CRCError class UnRar(AbtractExtractor): @@ -39,7 +39,7 @@ class UnRar(AbtractExtractor): @staticmethod def checkDeps(): if os.name == "nt": - UnRar.CMD = join(pypath, "UnRAR.exe") + UnRar.CMD = save_join(pypath, "UnRAR.exe") p = Popen([UnRar.CMD], stdout=PIPE, stderr=PIPE) p.communicate() else: @@ -80,7 +80,7 @@ class UnRar(AbtractExtractor): self.password = "" #save the correct password def checkArchive(self): - p = self.call_unrar("l", "-v", self.file) + p = self.call_unrar("l", "-v", fs_encode(self.file)) out, err = p.communicate() if self.re_wrongpwd.search(err): self.passwordProtected = True @@ -102,7 +102,7 @@ class UnRar(AbtractExtractor): def checkPassword(self, password): #at this point we can only verify header protected files if self.headerProtected: - p = self.call_unrar("l", "-v", self.file, password=password) + p = self.call_unrar("l", "-v", fs_encode(self.file), password=password) out, err = p.communicate() if self.re_wrongpwd.search(err): return False @@ -115,7 +115,7 @@ class UnRar(AbtractExtractor): # popen thinks process is still alive (just like pexpect) - very strange behavior # so for now progress can not be determined correctly - p = self.call_unrar(command, self.file, self.out, password=password) + p = self.call_unrar(command, fs_encode(self.file), self.out, password=password) renice(p.pid, self.renice) progress(0) @@ -141,7 +141,7 @@ class UnRar(AbtractExtractor): def listContent(self): command = "vb" if self.fullpath else "lb" - p = self.call_unrar(command, "-v", self.file, password=self.password) + p = self.call_unrar(command, "-v", fs_encode(self.file), password=self.password) out, err = p.communicate() if "Cannot open" in err: |