diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-03-13 22:30:56 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-03-13 22:30:56 +0100 |
commit | 94b7ed15d217a61f2102be326aa28509f3e379b5 (patch) | |
tree | beed961f31d3db9879a96fed4092e33508a3777f | |
parent | captcha fix (diff) | |
download | pyload-94b7ed15d217a61f2102be326aa28509f3e379b5.tar.xz |
fixes last commit
-rw-r--r-- | module/CaptchaManager.py | 4 | ||||
-rw-r--r-- | module/remote/thriftbackend/Handler.py | 8 | ||||
-rwxr-xr-x | pyLoadCore.py | 2 |
3 files changed, 6 insertions, 8 deletions
diff --git a/module/CaptchaManager.py b/module/CaptchaManager.py index 7bb98dde9..7672aa645 100644 --- a/module/CaptchaManager.py +++ b/module/CaptchaManager.py @@ -52,7 +52,7 @@ class CaptchaManager(): def getTaskByID(self, tid): self.lock.acquire() for task in self.tasks: - if task.id == tid: + if task.id == str(tid): #task ids are strings self.lock.release() return task self.lock.release() @@ -82,7 +82,7 @@ class CaptchaManager(): class CaptchaTask(): def __init__(self, id, img, type, temp): - self.id = id + self.id = str(id) self.captchaImg = img self.captchaType = type self.captchaFile = temp diff --git a/module/remote/thriftbackend/Handler.py b/module/remote/thriftbackend/Handler.py index 7209c6bd5..62896af9f 100644 --- a/module/remote/thriftbackend/Handler.py +++ b/module/remote/thriftbackend/Handler.py @@ -6,7 +6,7 @@ from thriftgen.pyload.Pyload import Iface from module.PyFile import PyFile from module.utils import freeSpace -from base64 import b64encode +from base64 import standard_b64encode class Handler(Iface): def __init__(self, backend): @@ -444,10 +444,8 @@ class Handler(Iface): Parameters: - exclusive """ - t = CaptchaTask() - t.tid, t.data, t.type = self.serverMethods.get_captcha_task(exclusive) - t.tid = int(t.tid) - t.data = b64encode(t.data) + tid, data, type = self.serverMethods.get_captcha_task(exclusive) + t = CaptchaTask(int(tid), standard_b64encode(data), type) return t def getCaptchaTaskStatus(self, tid): diff --git a/pyLoadCore.py b/pyLoadCore.py index dd05c9e99..0a91472ed 100755 --- a/pyLoadCore.py +++ b/pyLoadCore.py @@ -759,7 +759,7 @@ class ServerMethods(): if task: task.setWatingForUser(exclusive=exclusive) c = task.getCaptcha() - return int(task.id), c[0], str(c[1]) + return str(task.id), c[0], str(c[1]) else: return None, None, None |