summaryrefslogtreecommitdiffstats
path: root/module/plugins/hooks/MergeFiles.py
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/hooks/MergeFiles.py
parenthtml_unescape function, little plugin improvements (diff)
downloadpyload-8d8e5738073d1726ace7d19589b9c6529b8b30ad.tar.xz
fixes some encoding issues
Diffstat (limited to 'module/plugins/hooks/MergeFiles.py')
-rw-r--r--module/plugins/hooks/MergeFiles.py10
1 files changed, 6 insertions, 4 deletions
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)