diff options
-rw-r--r-- | module/plugins/hoster/YoutubeCom.py | 5 | ||||
-rwxr-xr-x | pyLoadCli.py | 9 | ||||
-rwxr-xr-x | pyLoadCore.py | 3 |
3 files changed, 11 insertions, 6 deletions
diff --git a/module/plugins/hoster/YoutubeCom.py b/module/plugins/hoster/YoutubeCom.py index 6148d72f0..d92d8d128 100644 --- a/module/plugins/hoster/YoutubeCom.py +++ b/module/plugins/hoster/YoutubeCom.py @@ -32,9 +32,8 @@ class YoutubeCom(Hoster): if self.getConf("quality") == "hd" or self.getConf("quality") == "hq": file_suffix = ".mp4" - name = re.search(file_name_pattern, html).group(1).replace("/", "") + file_suffix - - pyfile.name = name.replace("&", "&").replace("ö", "oe").replace("ä", "ae").replace("ü", "ue") + name = (re.search(file_name_pattern, html).group(1).replace("/", "") + file_suffix).decode("utf8") + pyfile.name = name #.replace("&", "&").replace("ö", "oe").replace("ä", "ae").replace("ü", "ue") if self.getConf("quality") == "sd": quality = "&fmt=6" diff --git a/pyLoadCli.py b/pyLoadCli.py index 36ab0c4f7..426cf6370 100755 --- a/pyLoadCli.py +++ b/pyLoadCli.py @@ -30,10 +30,15 @@ import threading import time from time import sleep import xmlrpclib +from traceback import print_exc from module import InitHomeDir from module.ConfigParser import ConfigParser +import codecs + +sys.stdout = codecs.getwriter("unicode")(sys.stdout, errors = "replace") + if sys.stdout.encoding.lower().startswith("utf"): conv = unicode else: @@ -109,7 +114,7 @@ class pyLoadCli: return conv(size / 1024 ** 2) + " MiB" def println(self, line, content): - print "\033[" + conv(line) + ";0H\033[2K" + conv(content) + "\033[" + conv((self.inputline if self.inputline > 0 else self.inputline + 1) - 1) + ";0H" + print "\033[" + conv(line) + ";0H\033[2K" + content + "\033[" + conv((self.inputline if self.inputline > 0 else self.inputline + 1) - 1) + ";0H" def print_input(self): self.println(self.inputline, white(" Input: ") + self.input) @@ -336,7 +341,7 @@ class RefreshThread(threading.Thread): self.cli.println(2, red(conv(e))) self.cli.pos[1] = 0 self.cli.pos[2] = 0 - + print_exc() diff --git a/pyLoadCore.py b/pyLoadCore.py index 0c28b4a1b..cc9480dee 100755 --- a/pyLoadCore.py +++ b/pyLoadCore.py @@ -64,6 +64,7 @@ import module.remote.SecureXMLRPCServer as Server from module.web.ServerThread import WebServer from module.FileDatabase import PyFile + class Core(object): """ pyLoad Core """ @@ -212,7 +213,7 @@ class Core(object): self.init_server() self.init_webserver() - linkFile = self.config['general']['link_file'] + #linkFile = self.config['general']['link_file'] freeSpace = self.freeSpace() if freeSpace > 5 * 1024: |