summaryrefslogtreecommitdiffstats
path: root/module/plugins/hooks/ExpertDecoders.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2015-01-04 20:20:34 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2015-01-04 20:20:34 +0100
commit80ecab8f0c664bc43b9db10bee0cb815a96c1039 (patch)
treea0c7159990bea51fc84fe05801f884262c2d826d /module/plugins/hooks/ExpertDecoders.py
parent[ClickAndLoad] Updated (diff)
downloadpyload-80ecab8f0c664bc43b9db10bee0cb815a96c1039.tar.xz
Improve processCaptcha thread in hook plugins
Diffstat (limited to 'module/plugins/hooks/ExpertDecoders.py')
-rw-r--r--module/plugins/hooks/ExpertDecoders.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/module/plugins/hooks/ExpertDecoders.py b/module/plugins/hooks/ExpertDecoders.py
index 54de8eb53..c80401003 100644
--- a/module/plugins/hooks/ExpertDecoders.py
+++ b/module/plugins/hooks/ExpertDecoders.py
@@ -4,18 +4,17 @@ from __future__ import with_statement
from base64 import b64encode
from pycurl import LOW_SPEED_TIME
-from thread import start_new_thread
from uuid import uuid4
from module.network.HTTPRequest import BadHeader
from module.network.RequestFactory import getURL, getRequest
-from module.plugins.Hook import Hook
+from module.plugins.Hook import Hook, threaded
class ExpertDecoders(Hook):
__name__ = "ExpertDecoders"
__type__ = "hook"
- __version__ = "0.03"
+ __version__ = "0.04"
__config__ = [("force", "bool", "Force CT even if client is connected", False),
("passkey", "password", "Access key", "")]
@@ -50,7 +49,8 @@ class ExpertDecoders(Hook):
return 0
- def processCaptcha(self, task):
+ @threaded
+ def _processCaptcha(self, task):
task.data['ticket'] = ticket = uuid4()
result = None
@@ -85,7 +85,7 @@ class ExpertDecoders(Hook):
if self.getCredits() > 0:
task.handler.append(self)
task.setWaiting(100)
- start_new_thread(self.processCaptcha, (task,))
+ self._processCaptcha(task)
else:
self.logInfo(_("Your ExpertDecoders Account has not enough credits"))