diff options
author | Walter Purcaro <vuolter@gmail.com> | 2015-01-04 20:20:34 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2015-01-04 20:20:34 +0100 |
commit | 80ecab8f0c664bc43b9db10bee0cb815a96c1039 (patch) | |
tree | a0c7159990bea51fc84fe05801f884262c2d826d /module/plugins/hooks/CaptchaBrotherhood.py | |
parent | [ClickAndLoad] Updated (diff) | |
download | pyload-80ecab8f0c664bc43b9db10bee0cb815a96c1039.tar.xz |
Improve processCaptcha thread in hook plugins
Diffstat (limited to 'module/plugins/hooks/CaptchaBrotherhood.py')
-rw-r--r-- | module/plugins/hooks/CaptchaBrotherhood.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py index 6d4127871..9a9f05b29 100644 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ b/module/plugins/hooks/CaptchaBrotherhood.py @@ -10,12 +10,11 @@ try: except ImportError: import Image -from thread import start_new_thread from time import sleep from urllib import urlencode from module.network.RequestFactory import getURL, getRequest -from module.plugins.Hook import Hook +from module.plugins.Hook import Hook, threaded class CaptchaBrotherhoodException(Exception): @@ -39,7 +38,7 @@ class CaptchaBrotherhoodException(Exception): class CaptchaBrotherhood(Hook): __name__ = "CaptchaBrotherhood" __type__ = "hook" - __version__ = "0.06" + __version__ = "0.07" __config__ = [("username", "str", "Username", ""), ("force", "bool", "Force CT even if client is connected", False), @@ -154,7 +153,7 @@ class CaptchaBrotherhood(Hook): task.handler.append(self) task.data['service'] = self.__name__ task.setWaiting(100) - start_new_thread(self.processCaptcha, (task,)) + self._processCaptcha(task) else: self.logInfo(_("Your CaptchaBrotherhood Account has not enough credits")) @@ -164,7 +163,8 @@ class CaptchaBrotherhood(Hook): res = self.get_api("complainCaptcha", task.data['ticket']) - def processCaptcha(self, task): + @threaded + def _processCaptcha(self, task): c = task.captchaFile try: ticket, result = self.submit(c) |