summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/ExtabitCom.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster/ExtabitCom.py')
-rw-r--r--module/plugins/hoster/ExtabitCom.py26
1 files changed, 12 insertions, 14 deletions
diff --git a/module/plugins/hoster/ExtabitCom.py b/module/plugins/hoster/ExtabitCom.py
index 3442e7d27..b21db38bb 100644
--- a/module/plugins/hoster/ExtabitCom.py
+++ b/module/plugins/hoster/ExtabitCom.py
@@ -11,7 +11,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, s
class ExtabitCom(SimpleHoster):
__name__ = "ExtabitCom"
__type__ = "hoster"
- __version__ = "0.67"
+ __version__ = "0.68"
__status__ = "testing"
__pattern__ = r'http://(?:www\.)?extabit\.com/(file|go|fid)/(?P<ID>\w+)'
@@ -35,32 +35,30 @@ class ExtabitCom(SimpleHoster):
self.fail(_("Only premium users can download this file"))
m = re.search(r"Next free download from your ip will be available in <b>(\d+)\s*minutes", self.html)
- if m:
+ if m is not None:
self.wait(int(m.group(1)) * 60, True)
elif "The daily downloads limit from your IP is exceeded" in self.html:
self.log_warning(_("You have reached your daily downloads limit for today"))
- self.wait(seconds_to_midnight(gmt=2), True)
+ self.wait(seconds_to_midnight(), True)
self.log_debug("URL: " + self.req.http.lastEffectiveURL)
m = re.match(self.__pattern__, self.req.http.lastEffectiveURL)
fileID = m.group('ID') if m else self.info['pattern']['ID']
m = re.search(r'recaptcha/api/challenge\?k=(\w+)', self.html)
- if m:
+ if m is not None:
recaptcha = ReCaptcha(self)
captcha_key = m.group(1)
- for _i in xrange(5):
- get_data = {'type': "recaptcha"}
- get_data['capture'], get_data['challenge'] = recaptcha.challenge(captcha_key)
- res = json_loads(self.load("http://extabit.com/file/%s/" % fileID, get=get_data))
- if "ok" in res:
- self.captcha.correct()
- break
- else:
- self.captcha.invalid()
+ get_data = {'type': "recaptcha"}
+ get_data['capture'], get_data['challenge'] = recaptcha.challenge(captcha_key)
+
+ res = json_loads(self.load("http://extabit.com/file/%s/" % fileID, get=get_data))
+
+ if "ok" in res:
+ self.captcha.correct()
else:
- self.fail(_("Invalid captcha"))
+ self.retry_captcha()
else:
self.error(_("Captcha"))