summaryrefslogtreecommitdiffstats
path: root/module/plugins/hooks
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hooks')
-rw-r--r--module/plugins/hooks/BypassCaptcha.py4
-rw-r--r--module/plugins/hooks/CaptchaBrotherhood.py5
-rw-r--r--module/plugins/hooks/DeathByCaptcha.py4
-rw-r--r--module/plugins/hooks/ExpertDecoders.py4
-rw-r--r--module/plugins/hooks/ImageTyperz.py4
-rw-r--r--module/plugins/hooks/MultiHome.py2
-rw-r--r--module/plugins/hooks/SkipRev.py2
7 files changed, 13 insertions, 12 deletions
diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py
index cb91c06ce..ab08c68c1 100644
--- a/module/plugins/hooks/BypassCaptcha.py
+++ b/module/plugins/hooks/BypassCaptcha.py
@@ -3,7 +3,7 @@
import pycurl
from module.network.HTTPRequest import BadHeader
-from module.network.RequestFactory import getRequest
+from module.network.RequestFactory import getRequest as get_request
from module.plugins.internal.Hook import Hook, threaded
@@ -61,7 +61,7 @@ class BypassCaptcha(Hook):
def submit(self, captcha, captchaType="file", match=None):
- req = getRequest()
+ req = get_request()
# raise timeout threshold
req.c.setopt(pycurl.LOW_SPEED_TIME, 80)
diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py
index b2f370f32..d35bc720d 100644
--- a/module/plugins/hooks/CaptchaBrotherhood.py
+++ b/module/plugins/hooks/CaptchaBrotherhood.py
@@ -9,10 +9,11 @@ import urllib
try:
from PIL import Image
+
except ImportError:
import Image
-from module.network.RequestFactory import getRequest
+from module.network.RequestFactory import getRequest as get_request
from module.plugins.internal.Hook import Hook, threaded
@@ -86,7 +87,7 @@ class CaptchaBrotherhood(Hook):
except Exception, e:
raise CaptchaBrotherhoodException("Reading or converting captcha image failed: %s" % e)
- req = getRequest()
+ req = get_request()
url = "%ssendNewCaptcha.aspx?%s" % (self.API_URL,
urllib.urlencode({'username' : self.get_config('username'),
diff --git a/module/plugins/hooks/DeathByCaptcha.py b/module/plugins/hooks/DeathByCaptcha.py
index ec2554a8f..43bad2d0b 100644
--- a/module/plugins/hooks/DeathByCaptcha.py
+++ b/module/plugins/hooks/DeathByCaptcha.py
@@ -10,7 +10,7 @@ from base64 import b64encode
from module.common.json_layer import json_loads
from module.network.HTTPRequest import BadHeader
-from module.network.RequestFactory import getRequest
+from module.network.RequestFactory import getRequest as get_request
from module.plugins.internal.Hook import Hook, threaded
@@ -73,7 +73,7 @@ class DeathByCaptcha(Hook):
def api_response(self, api="captcha", post=False, multipart=False):
- req = getRequest()
+ req = get_request()
req.c.setopt(pycurl.HTTPHEADER, ["Accept: application/json", "User-Agent: pyLoad %s" % self.core.version])
if post:
diff --git a/module/plugins/hooks/ExpertDecoders.py b/module/plugins/hooks/ExpertDecoders.py
index 6ec1f8bf1..919445db8 100644
--- a/module/plugins/hooks/ExpertDecoders.py
+++ b/module/plugins/hooks/ExpertDecoders.py
@@ -8,7 +8,7 @@ import uuid
from base64 import b64encode
from module.network.HTTPRequest import BadHeader
-from module.network.RequestFactory import getRequest
+from module.network.RequestFactory import getRequest as get_request
from module.plugins.internal.Hook import Hook, threaded
@@ -55,7 +55,7 @@ class ExpertDecoders(Hook):
with open(task.captchaFile, 'rb') as f:
data = f.read()
- req = getRequest()
+ req = get_request()
# raise timeout threshold
req.c.setopt(pycurl.LOW_SPEED_TIME, 80)
diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py
index c70518c17..5e2f21c8b 100644
--- a/module/plugins/hooks/ImageTyperz.py
+++ b/module/plugins/hooks/ImageTyperz.py
@@ -7,7 +7,7 @@ import re
from base64 import b64encode
-from module.network.RequestFactory import getRequest
+from module.network.RequestFactory import getRequest as get_request
from module.plugins.internal.Hook import Hook, threaded
@@ -74,7 +74,7 @@ class ImageTyperz(Hook):
def submit(self, captcha, captchaType="file", match=None):
- req = getRequest()
+ req = get_request()
# raise timeout threshold
req.c.setopt(pycurl.LOW_SPEED_TIME, 80)
diff --git a/module/plugins/hooks/MultiHome.py b/module/plugins/hooks/MultiHome.py
index 12a65c601..7e4b5e583 100644
--- a/module/plugins/hooks/MultiHome.py
+++ b/module/plugins/hooks/MultiHome.py
@@ -56,7 +56,7 @@ class MultiHome(Hook):
self.log_debug("Using address", iface.adress)
return oldGetRequest(pluginName, account)
- requestFactory.getRequest = getRequest
+ requestFactory.getRequest = get_request
def best_interface(self, pluginName, account):
diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py
index 8fd49889c..9f5f4f231 100644
--- a/module/plugins/hooks/SkipRev.py
+++ b/module/plugins/hooks/SkipRev.py
@@ -41,7 +41,7 @@ class SkipRev(Hook):
if hasattr(pyfile.pluginmodule, "getInfo"): #@NOTE: getInfo is deprecated in 0.4.10
return pyfile.pluginmodule.get_info([pyfile.url]).next()[0]
else:
- self.log_warning("Unable to grab file name")
+ self.log_warning(_("Unable to grab file name"))
return urlparse.urlparse(urllib.unquote(pyfile.url)).path.split('/')[-1]