diff options
38 files changed, 41 insertions, 41 deletions
diff --git a/module/plugins/accounts/BayfilesCom.py b/module/plugins/accounts/BayfilesCom.py index 2b6d45a18..d1cf8ba22 100644 --- a/module/plugins/accounts/BayfilesCom.py +++ b/module/plugins/accounts/BayfilesCom.py @@ -17,7 +17,7 @@ class BayfilesCom(Account): def loadAccountInfo(self, user, req): - for _ in xrange(2): + for _i in xrange(2): response = json_loads(req.load("http://api.bayfiles.com/v1/account/info")) self.logDebug(response) if not response['error']: diff --git a/module/plugins/accounts/FilecloudIo.py b/module/plugins/accounts/FilecloudIo.py index 439491ea9..e1f8c0142 100644 --- a/module/plugins/accounts/FilecloudIo.py +++ b/module/plugins/accounts/FilecloudIo.py @@ -17,7 +17,7 @@ class FilecloudIo(Account): def loadAccountInfo(self, user, req): # It looks like the first API request always fails, so we retry 5 times, it should work on the second try - for _ in xrange(5): + for _i in xrange(5): rep = req.load("https://secure.filecloud.io/api-fetch_apikey.api", post={"username": user, "password": self.accounts[user]['password']}) rep = json_loads(rep) diff --git a/module/plugins/crypter/LixIn.py b/module/plugins/crypter/LixIn.py index 744066d19..0c20f6499 100644 --- a/module/plugins/crypter/LixIn.py +++ b/module/plugins/crypter/LixIn.py @@ -40,7 +40,7 @@ class LixIn(Crypter): m = re.search(self.CAPTCHA_PATTERN, self.html) if m: - for _ in xrange(5): + for _i in xrange(5): m = re.search(self.CAPTCHA_PATTERN, self.html) if m: self.logDebug("Trying captcha") diff --git a/module/plugins/crypter/SafelinkingNet.py b/module/plugins/crypter/SafelinkingNet.py index fcc48ca22..d9b511cf5 100644 --- a/module/plugins/crypter/SafelinkingNet.py +++ b/module/plugins/crypter/SafelinkingNet.py @@ -46,7 +46,7 @@ class SafelinkingNet(Crypter): postData['link-password'] = self.getPassword() if "altcaptcha" in self.html: - for _ in xrange(5): + for _i in xrange(5): m = re.search(self.SOLVEMEDIA_PATTERN, self.html) if m: captchaKey = m.group(1) diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index 947aff121..930293002 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -84,7 +84,7 @@ class Captcha9kw(Hook): if response.isdigit(): self.logInfo(_("New CaptchaID from upload: %s : %s") % (response, task.captchaFile)) - for _ in xrange(1, 100, 1): + for _i in xrange(1, 100, 1): response2 = getURL(self.API_URL, get={"apikey": self.getConfig("passkey"), "id": response, "pyload": "1", "source": "pyload", "action": "usercaptchacorrectdata"}) diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py index da8fcbafe..a04b8616d 100644 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ b/module/plugins/hooks/CaptchaBrotherhood.py @@ -113,7 +113,7 @@ class CaptchaBrotherhood(Hook): ticket = response[3:] - for _ in xrange(15): + for _i in xrange(15): sleep(5) response = self.get_api("askCaptchaResult", ticket) if response.startswith("OK-answered"): diff --git a/module/plugins/hooks/DeathByCaptcha.py b/module/plugins/hooks/DeathByCaptcha.py index 99d7f7401..f390954e1 100644 --- a/module/plugins/hooks/DeathByCaptcha.py +++ b/module/plugins/hooks/DeathByCaptcha.py @@ -148,7 +148,7 @@ class DeathByCaptcha(Hook): raise DeathByCaptchaException(response) ticket = response['captcha'] - for _ in xrange(24): + for _i in xrange(24): sleep(5) response = self.call_api("captcha/%d" % ticket, False) if response['text'] and response['is_correct']: diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py index ffc1a66af..573134cb9 100644 --- a/module/plugins/hoster/BasePlugin.py +++ b/module/plugins/hoster/BasePlugin.py @@ -80,7 +80,7 @@ class BasePlugin(Hoster): def downloadFile(self, pyfile): url = pyfile.url - for _ in xrange(5): + for _i in xrange(5): header = self.load(url, just_header=True) # self.load does not raise a BadHeader on 404 responses, do it here diff --git a/module/plugins/hoster/BezvadataCz.py b/module/plugins/hoster/BezvadataCz.py index 426b4f494..aa5e1faee 100644 --- a/module/plugins/hoster/BezvadataCz.py +++ b/module/plugins/hoster/BezvadataCz.py @@ -36,7 +36,7 @@ class BezvadataCz(SimpleHoster): #captcha form self.html = self.load(url) self.checkErrors() - for _ in xrange(5): + for _i in xrange(5): action, inputs = self.parseHtmlForm('frm-stahnoutFreeForm') if not inputs: self.error("FreeForm") diff --git a/module/plugins/hoster/CrockoCom.py b/module/plugins/hoster/CrockoCom.py index ae1825c9f..95e00f679 100644 --- a/module/plugins/hoster/CrockoCom.py +++ b/module/plugins/hoster/CrockoCom.py @@ -34,7 +34,7 @@ class CrockoCom(SimpleHoster): if "You need Premium membership to download this file." in self.html: self.fail("You need Premium membership to download this file.") - for _ in xrange(5): + for _i in xrange(5): m = re.search(self.CAPTCHA_PATTERN, self.html) if m: url, wait_time = 'http://crocko.com' + m.group(1), m.group(2) @@ -51,7 +51,7 @@ class CrockoCom(SimpleHoster): inputs = dict(re.findall(self.FORM_INPUT_PATTERN, form)) recaptcha = ReCaptcha(self) - for _ in xrange(5): + for _i in xrange(5): inputs['recaptcha_challenge_field'], inputs['recaptcha_response_field'] = recaptcha.challenge() self.download(action, post=inputs) diff --git a/module/plugins/hoster/CzshareCom.py b/module/plugins/hoster/CzshareCom.py index 5c31958d7..cb450425b 100644 --- a/module/plugins/hoster/CzshareCom.py +++ b/module/plugins/hoster/CzshareCom.py @@ -100,7 +100,7 @@ class CzshareCom(SimpleHoster): # get and decrypt captcha captcha_url = 'http://sdilej.cz/captcha.php' - for _ in xrange(5): + for _i in xrange(5): inputs['captchastring2'] = self.decryptCaptcha(captcha_url) self.html = self.load(parsed_url, cookies=True, post=inputs, decode=True) if u"<li>Zadaný ověřovací kód nesouhlasí!</li>" in self.html: diff --git a/module/plugins/hoster/DataportCz.py b/module/plugins/hoster/DataportCz.py index e4dfb0ad1..d57d86e2f 100644 --- a/module/plugins/hoster/DataportCz.py +++ b/module/plugins/hoster/DataportCz.py @@ -28,7 +28,7 @@ class DataportCz(SimpleHoster): def handleFree(self): captchas = {"1": "jkeG", "2": "hMJQ", "3": "vmEK", "4": "ePQM", "5": "blBd"} - for _ in xrange(60): + for _i in xrange(60): action, inputs = self.parseHtmlForm('free_download_form') self.logDebug(action, inputs) if not action or not inputs: diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py index 5440927e1..73e48d129 100644 --- a/module/plugins/hoster/DateiTo.py +++ b/module/plugins/hoster/DateiTo.py @@ -32,7 +32,7 @@ class DateiTo(SimpleHoster): data = {'P': 'I', 'ID': self.file_info['ID']} recaptcha = ReCaptcha(self) - for _ in xrange(10): + for _i in xrange(10): self.logDebug("URL", url, "POST", data) self.html = self.load(url, post=data) self.checkErrors() diff --git a/module/plugins/hoster/DepositfilesCom.py b/module/plugins/hoster/DepositfilesCom.py index 3dd2d0ff2..66c81de29 100644 --- a/module/plugins/hoster/DepositfilesCom.py +++ b/module/plugins/hoster/DepositfilesCom.py @@ -74,7 +74,7 @@ class DepositfilesCom(SimpleHoster): if captcha_key is None: self.error("ReCaptcha key not found") - for _ in xrange(5): + for _i in xrange(5): self.html = self.load("https://dfiles.eu/get_file.php", get=params) if '<input type=button value="Continue" onclick="check_recaptcha' in self.html: diff --git a/module/plugins/hoster/ExtabitCom.py b/module/plugins/hoster/ExtabitCom.py index 36588c4a8..493644721 100644 --- a/module/plugins/hoster/ExtabitCom.py +++ b/module/plugins/hoster/ExtabitCom.py @@ -49,7 +49,7 @@ class ExtabitCom(SimpleHoster): recaptcha = ReCaptcha(self) captcha_key = m.group(1) - for _ in xrange(5): + for _i in xrange(5): get_data = {"type": "recaptcha"} get_data['challenge'], get_data['capture'] = recaptcha.challenge(captcha_key) response = json_loads(self.load("http://extabit.com/file/%s/" % fileID, get=get_data)) diff --git a/module/plugins/hoster/FilecloudIo.py b/module/plugins/hoster/FilecloudIo.py index 74652be04..60b4838ec 100644 --- a/module/plugins/hoster/FilecloudIo.py +++ b/module/plugins/hoster/FilecloudIo.py @@ -75,7 +75,7 @@ class FilecloudIo(SimpleHoster): if response['captcha']: data['ctype'] = "recaptcha" - for _ in xrange(5): + for _i in xrange(5): data['recaptcha_challenge'], data['recaptcha_response'] = recaptcha.challenge(captcha_key) json_url = "http://filecloud.io/download-request.json" diff --git a/module/plugins/hoster/FilerNet.py b/module/plugins/hoster/FilerNet.py index 0d4cb43a4..d45289fc0 100644 --- a/module/plugins/hoster/FilerNet.py +++ b/module/plugins/hoster/FilerNet.py @@ -56,7 +56,7 @@ class FilerNet(SimpleHoster): downloadURL = r'' recaptcha = ReCaptcha(self) - for _ in xrange(5): + for _i in xrange(5): challenge, response = recaptcha.challenge() post_data = {'recaptcha_challenge_field': challenge, 'recaptcha_response_field': response, diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py index b3f197736..8aafb5c0c 100644 --- a/module/plugins/hoster/FileserveCom.py +++ b/module/plugins/hoster/FileserveCom.py @@ -158,7 +158,7 @@ class FileserveCom(Hoster): captcha_key = re.search(self.CAPTCHA_KEY_PATTERN, self.html).group("key") recaptcha = ReCaptcha(self) - for _ in xrange(5): + for _i in xrange(5): challenge, code = recaptcha.challenge(captcha_key) response = json_loads(self.load(self.URLS[2], post={'recaptcha_challenge_field': challenge, diff --git a/module/plugins/hoster/GigapetaCom.py b/module/plugins/hoster/GigapetaCom.py index b606322cf..5b322187b 100644 --- a/module/plugins/hoster/GigapetaCom.py +++ b/module/plugins/hoster/GigapetaCom.py @@ -33,7 +33,7 @@ class GigapetaCom(SimpleHoster): self.req.http.c.setopt(FOLLOWLOCATION, 0) - for _ in xrange(5): + for _i in xrange(5): self.checkErrors() captcha = self.decryptCaptcha(captcha_url) diff --git a/module/plugins/hoster/IfileIt.py b/module/plugins/hoster/IfileIt.py index ca5896e2d..6f92b4b42 100644 --- a/module/plugins/hoster/IfileIt.py +++ b/module/plugins/hoster/IfileIt.py @@ -42,7 +42,7 @@ class IfileIt(SimpleHoster): recaptcha = ReCaptcha(self) post_data['ctype'] = "recaptcha" - for _ in xrange(5): + for _i in xrange(5): post_data['recaptcha_challenge'], post_data['recaptcha_response'] = recaptcha.challenge(captcha_key) json_response = json_loads(self.load(json_url, post=post_data)) self.logDebug(json_response) diff --git a/module/plugins/hoster/IfolderRu.py b/module/plugins/hoster/IfolderRu.py index 93b8948de..94a7d0c5f 100644 --- a/module/plugins/hoster/IfolderRu.py +++ b/module/plugins/hoster/IfolderRu.py @@ -51,7 +51,7 @@ class IfolderRu(SimpleHoster): self.wait(31, False) captcha_url = "http://ints.rusfolder.com/random/images/?session=%s" % session_id - for _ in xrange(5): + for _i in xrange(5): self.html = self.load(url, cookies=True) action, inputs = self.parseHtmlForm('ID="Form1"') inputs['ints_session'] = re.search(self.INTS_SESSION_PATTERN, self.html).group(1) diff --git a/module/plugins/hoster/Keep2shareCC.py b/module/plugins/hoster/Keep2shareCC.py index d6258bb06..aea80d29f 100644 --- a/module/plugins/hoster/Keep2shareCC.py +++ b/module/plugins/hoster/Keep2shareCC.py @@ -73,7 +73,7 @@ class Keep2shareCC(SimpleHoster): def handleCaptcha(self): recaptcha = ReCaptcha(self) - for _ in xrange(5): + for _i in xrange(5): post_data = {'free': 1, 'freeDownloadRequest': 1, 'uniqueId': self.fid, diff --git a/module/plugins/hoster/LuckyShareNet.py b/module/plugins/hoster/LuckyShareNet.py index 5dfe375d1..b7f3d7099 100644 --- a/module/plugins/hoster/LuckyShareNet.py +++ b/module/plugins/hoster/LuckyShareNet.py @@ -52,7 +52,7 @@ class LuckyShareNet(SimpleHoster): recaptcha = ReCaptcha(self) - for _ in xrange(5): + for _i in xrange(5): challenge, response = recaptcha.challenge() rep = self.load(r"http://luckyshare.net/download/verify/challenge/%s/response/%s/hash/%s" % (challenge, response, json['hash']), decode=True) diff --git a/module/plugins/hoster/MediafireCom.py b/module/plugins/hoster/MediafireCom.py index 9f30b5761..571589de8 100644 --- a/module/plugins/hoster/MediafireCom.py +++ b/module/plugins/hoster/MediafireCom.py @@ -13,7 +13,7 @@ def replace_eval(js_expr): def checkHTMLHeader(url): try: - for _ in xrange(3): + for _i in xrange(3): header = getURL(url, just_header=True) for line in header.splitlines(): line = line.lower() diff --git a/module/plugins/hoster/MegasharesCom.py b/module/plugins/hoster/MegasharesCom.py index c41e8b9e2..29ae47509 100644 --- a/module/plugins/hoster/MegasharesCom.py +++ b/module/plugins/hoster/MegasharesCom.py @@ -52,7 +52,7 @@ class MegasharesCom(SimpleHoster): passport_num = m.group(1) request_uri = re.search(self.REQUEST_URI_PATTERN, self.html).group(1) - for _ in xrange(5): + for _i in xrange(5): random_num = re.search(self.REACTIVATE_NUM_PATTERN, self.html).group(1) verifyinput = self.decryptCaptcha( diff --git a/module/plugins/hoster/NarodRu.py b/module/plugins/hoster/NarodRu.py index 473697ac0..4ba43a850 100644 --- a/module/plugins/hoster/NarodRu.py +++ b/module/plugins/hoster/NarodRu.py @@ -32,7 +32,7 @@ class NarodRu(SimpleHoster): def handleFree(self): - for _ in xrange(5): + for _i in xrange(5): self.html = self.load('http://narod.ru/disk/getcapchaxml/?rnd=%d' % int(random() * 777)) m = re.search(self.CAPTCHA_PATTERN, self.html) if m is None: diff --git a/module/plugins/hoster/OboomCom.py b/module/plugins/hoster/OboomCom.py index cad8c2ec9..afbd6566c 100644 --- a/module/plugins/hoster/OboomCom.py +++ b/module/plugins/hoster/OboomCom.py @@ -73,7 +73,7 @@ class OboomCom(Hoster): def solveCaptcha(self): recaptcha = ReCaptcha(self) - for _ in xrange(5): + for _i in xrange(5): challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY) apiUrl = "https://www.oboom.com/1.0/download/ticket" params = {"recaptcha_challenge_field": challenge, diff --git a/module/plugins/hoster/RapidgatorNet.py b/module/plugins/hoster/RapidgatorNet.py index 390d25f74..f0acfd04e 100644 --- a/module/plugins/hoster/RapidgatorNet.py +++ b/module/plugins/hoster/RapidgatorNet.py @@ -116,7 +116,7 @@ class RapidgatorNet(SimpleHoster): url = "http://rapidgator.net%s" % jsvars.get('captchaUrl', '/download/captcha') self.html = self.load(url) - for _ in xrange(5): + for _i in xrange(5): m = re.search(self.LINK_PATTERN, self.html) if m: link = m.group(1) diff --git a/module/plugins/hoster/RyushareCom.py b/module/plugins/hoster/RyushareCom.py index 510229fe8..3179426fb 100644 --- a/module/plugins/hoster/RyushareCom.py +++ b/module/plugins/hoster/RyushareCom.py @@ -58,7 +58,7 @@ class RyushareCom(XFSPHoster): if retry: self.retry() - for _ in xrange(5): + for _i in xrange(5): solvemedia = SolveMedia(self) challenge, response = solvemedia.challenge() diff --git a/module/plugins/hoster/SendspaceCom.py b/module/plugins/hoster/SendspaceCom.py index f8e720070..62c6e4a70 100644 --- a/module/plugins/hoster/SendspaceCom.py +++ b/module/plugins/hoster/SendspaceCom.py @@ -28,7 +28,7 @@ class SendspaceCom(SimpleHoster): def handleFree(self): params = {} - for _ in xrange(3): + for _i in xrange(3): m = re.search(self.LINK_PATTERN, self.html) if m: if 'captcha_hash' in params: diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py index 4d3697a09..5441efce1 100644 --- a/module/plugins/hoster/ShareonlineBiz.py +++ b/module/plugins/hoster/ShareonlineBiz.py @@ -105,7 +105,7 @@ class ShareonlineBiz(Hoster): m = re.search(r'var wait=(\d+);', self.html) recaptcha = ReCaptcha(self) - for _ in xrange(5): + for _i in xrange(5): challenge, response = recaptcha.challenge("6LdatrsSAAAAAHZrB70txiV5p-8Iv8BtVxlTtjKX") self.setWait(int(m.group(1)) if m else 30) response = self.load("%s/free/captcha/%d" % (self.pyfile.url, int(time() * 1000)), post={ diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index 1a6366c4a..a12fc3874 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -58,7 +58,7 @@ class TurbobitNet(SimpleHoster): def solveCaptcha(self): - for _ in xrange(5): + for _i in xrange(5): m = re.search(self.LIMIT_WAIT_PATTERN, self.html) if m: wait_time = int(m.group(1)) @@ -122,7 +122,7 @@ class TurbobitNet(SimpleHoster): if m: url = "http://turbobit.net%s%s" % m.groups() else: - url = "http://turbobit.net/files/timeout.js?ver=%s" % "".join(random.choice('0123456789ABCDEF') for _ in xrange(32)) + url = "http://turbobit.net/files/timeout.js?ver=%s" % "".join(random.choice('0123456789ABCDEF') for _i in xrange(32)) fun = self.load(url) diff --git a/module/plugins/hoster/UnibytesCom.py b/module/plugins/hoster/UnibytesCom.py index d2588b95f..93c7af529 100644 --- a/module/plugins/hoster/UnibytesCom.py +++ b/module/plugins/hoster/UnibytesCom.py @@ -31,7 +31,7 @@ class UnibytesCom(SimpleHoster): action, post_data = self.parseHtmlForm('id="startForm"') self.req.http.c.setopt(FOLLOWLOCATION, 0) - for _ in xrange(8): + for _i in xrange(8): self.logDebug(action, post_data) self.html = self.load(domain + action, post=post_data) diff --git a/module/plugins/hoster/UnrestrictLi.py b/module/plugins/hoster/UnrestrictLi.py index a2ee2a020..fd53e0125 100644 --- a/module/plugins/hoster/UnrestrictLi.py +++ b/module/plugins/hoster/UnrestrictLi.py @@ -43,7 +43,7 @@ class UnrestrictLi(Hoster): self.fail("No Unrestrict.li account provided") else: self.logDebug("Old URL: %s" % pyfile.url) - for _ in xrange(5): + for _i in xrange(5): page = self.load('https://unrestrict.li/unrestrict.php', post={'link': pyfile.url, 'domain': 'long'}) self.logDebug("JSON data: " + page) diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py index bd799005c..7ec3716e7 100644 --- a/module/plugins/hoster/UploadedTo.py +++ b/module/plugins/hoster/UploadedTo.py @@ -34,7 +34,7 @@ def getAPIData(urls): post['id_%s' % i] = id idMap[id] = url - for _ in xrange(5): + for _i in xrange(5): api = unicode(getURL("http://uploaded.net/api/filemultiple", post=post, decode=False), 'iso-8859-1') if api != "can't find request": break @@ -205,7 +205,7 @@ class UploadedTo(Hoster): recaptcha = ReCaptcha(self) - for _ in xrange(5): + for _i in xrange(5): challenge, result = recaptcha.challenge() options = {"recaptcha_challenge_field": challenge, "recaptcha_response_field": result} self.wait() diff --git a/module/plugins/hoster/UploadheroCom.py b/module/plugins/hoster/UploadheroCom.py index 2ae3cb992..b9eac42a7 100644 --- a/module/plugins/hoster/UploadheroCom.py +++ b/module/plugins/hoster/UploadheroCom.py @@ -43,7 +43,7 @@ class UploadheroCom(SimpleHoster): self.error("Captcha URL") captcha_url = "http://uploadhero.co" + m.group(1) - for _ in xrange(5): + for _i in xrange(5): captcha = self.decryptCaptcha(captcha_url) self.html = self.load(self.pyfile.url, get={"code": captcha}) m = re.search(self.FREE_URL_PATTERN, self.html) diff --git a/module/plugins/hoster/Xdcc.py b/module/plugins/hoster/Xdcc.py index 244c3d7e2..35725ce32 100644 --- a/module/plugins/hoster/Xdcc.py +++ b/module/plugins/hoster/Xdcc.py @@ -39,7 +39,7 @@ class Xdcc(Hoster): self.req = pyfile.m.core.requestFactory.getRequest(self.__name__, type="XDCC") self.pyfile = pyfile - for _ in xrange(0, 3): + for _i in xrange(0, 3): try: nmn = self.doDownload(pyfile.url) self.logDebug("%s: Download of %s finished." % (self.__name__, nmn)) diff --git a/module/plugins/internal/XFSPHoster.py b/module/plugins/internal/XFSPHoster.py index fd39bed02..19cddba64 100644 --- a/module/plugins/internal/XFSPHoster.py +++ b/module/plugins/internal/XFSPHoster.py @@ -245,7 +245,7 @@ class XFSPHoster(SimpleHoster): def getPostParameters(self): - for _ in xrange(3): + for _i in xrange(3): if not self.errmsg: self.checkErrors() |