summaryrefslogtreecommitdiffstats
path: root/module/plugins
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-06-15 18:53:49 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-06-15 18:53:49 +0200
commit8d8e5738073d1726ace7d19589b9c6529b8b30ad (patch)
tree8e3fdd1c3cdbb2cbe42d5fbcfa4837801c563fb3 /module/plugins
parenthtml_unescape function, little plugin improvements (diff)
downloadpyload-8d8e5738073d1726ace7d19589b9c6529b8b30ad.tar.xz
fixes some encoding issues
Diffstat (limited to 'module/plugins')
-rw-r--r--module/plugins/Plugin.py6
-rw-r--r--module/plugins/hooks/MergeFiles.py10
2 files changed, 9 insertions, 7 deletions
diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py
index 0b47187e3..0c98845c4 100644
--- a/module/plugins/Plugin.py
+++ b/module/plugins/Plugin.py
@@ -37,7 +37,7 @@ if os.name != "nt":
from itertools import islice
-from module.utils import save_join, removeChars
+from module.utils import save_join, fs_encode, removeChars
def chunks(iterable, size):
it = iter(iterable)
@@ -435,7 +435,7 @@ class Plugin(object):
else:
name = removeChars(name, '/\\"')
- filename = save_join(location, name)
+ filename = join(location, fs_encode(name))
try:
newname = self.req.httpDownload(url, filename, get=get, post=post, ref=ref, cookies=cookies,
chunks=self.getChunkCount(), resume=self.resumeDownload,
@@ -446,7 +446,7 @@ class Plugin(object):
if disposition and newname and newname != name: #triple check, just to be sure
self.log.info("%(name)s saved as %(newname)s" % {"name": name, "newname": newname})
self.pyfile.name = newname
- filename = save_join(location, newname)
+ filename = join(location, fs_encode(newname))
if self.core.config["permission"]["change_file"]:
chmod(filename, int(self.core.config["permission"]["file"], 8))
diff --git a/module/plugins/hooks/MergeFiles.py b/module/plugins/hooks/MergeFiles.py
index 9062cb14c..b4c98df08 100644
--- a/module/plugins/hooks/MergeFiles.py
+++ b/module/plugins/hooks/MergeFiles.py
@@ -17,13 +17,15 @@
@author: and9000
"""
-from module.plugins.Hook import Hook
-
import os
import re
import sys
import traceback
+from os.path import join
+from module.utils import save_join, fs_encode
+from module.plugins.Hook import Hook
+
BUFFER_SIZE = 4096
class MergeFiles(Hook):
@@ -55,11 +57,11 @@ class MergeFiles(Hook):
download_folder = self.core.config['general']['download_folder']
if self.core.config['general']['folder_per_package']:
- download_folder = os.path.join(download_folder, pack.folder.decode(sys.getfilesystemencoding()))
+ download_folder = save_join(download_folder, pack.folder)
for name, file_list in files.iteritems():
self.core.log.info("Starting merging of %s" % name)
- final_file = open(os.path.join(download_folder, name), "wb")
+ final_file = open(join(download_folder, fs_encode(name)), "wb")
for splitted_file in file_list:
self.core.log.debug("Merging part %s" % splitted_file)