diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-04-11 11:58:46 +0200 |
---|---|---|
committer | Stefano <l.stickell@yahoo.it> | 2014-04-21 17:18:12 +0200 |
commit | 4cbd40dffffe177b2cb438c5f3d9bf0d16932036 (patch) | |
tree | 346e094d181e4218d957d88507eac494d64c19ec | |
parent | Change Solvmedia to Solvemedia (diff) | |
download | pyload-4cbd40dffffe177b2cb438c5f3d9bf0d16932036.tar.xz |
Replace range with xrange
Merges vuolter/pyload@a50c8ff
(cherry picked from commit 0424017acbd34e14a33002e130c618c5dd6df222)
Conflicts:
module/plugins/PluginManager.py
module/plugins/captcha/LinksaveIn.py
44 files changed, 52 insertions, 52 deletions
diff --git a/pyload/plugins/accounts/BayfilesCom.py b/pyload/plugins/accounts/BayfilesCom.py index 0a9e11ec8..d9330158a 100644 --- a/pyload/plugins/accounts/BayfilesCom.py +++ b/pyload/plugins/accounts/BayfilesCom.py @@ -32,7 +32,7 @@ class BayfilesCom(Account): __author_mail__ = "zoidberg@mujmail.cz" def loadAccountInfo(self, user, req): - for i in range(2): + for _ 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/pyload/plugins/accounts/FilecloudIo.py b/pyload/plugins/accounts/FilecloudIo.py index 93ae02006..15e1d90be 100644 --- a/pyload/plugins/accounts/FilecloudIo.py +++ b/pyload/plugins/accounts/FilecloudIo.py @@ -31,7 +31,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 range(5): + for _ 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/pyload/plugins/addons/Captcha9kw.py b/pyload/plugins/addons/Captcha9kw.py index 3a1b9fe8f..b2895a357 100755 --- a/pyload/plugins/addons/Captcha9kw.py +++ b/pyload/plugins/addons/Captcha9kw.py @@ -92,7 +92,7 @@ class Captcha9kw(Hook): if response.isdigit(): self.logInfo(_("New CaptchaID from upload: %s : %s") % (response, task.captchaFile)) - for i in range(1, 100, 1): + for _ 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/pyload/plugins/addons/CaptchaBrotherhood.py b/pyload/plugins/addons/CaptchaBrotherhood.py index 9a4efaa95..0901925c0 100644 --- a/pyload/plugins/addons/CaptchaBrotherhood.py +++ b/pyload/plugins/addons/CaptchaBrotherhood.py @@ -112,7 +112,7 @@ class CaptchaBrotherhood(Hook): ticket = response[3:] - for i in range(15): + for _ in xrange(15): sleep(5) response = self.get_api("askCaptchaResult", ticket) if response.startswith("OK-answered"): diff --git a/pyload/plugins/addons/DeathByCaptcha.py b/pyload/plugins/addons/DeathByCaptcha.py index 9e466e193..334fd8467 100644 --- a/pyload/plugins/addons/DeathByCaptcha.py +++ b/pyload/plugins/addons/DeathByCaptcha.py @@ -147,7 +147,7 @@ class DeathByCaptcha(Hook): raise DeathByCaptchaException(response) ticket = response['captcha'] - for i in range(24): + for _ in xrange(24): sleep(5) response = self.call_api("captcha/%d" % ticket, False) if response['text'] and response['is_correct']: diff --git a/pyload/plugins/crypter/FilefactoryComFolder.py b/pyload/plugins/crypter/FilefactoryComFolder.py index 4f7ed6281..6a1ffea2c 100644 --- a/pyload/plugins/crypter/FilefactoryComFolder.py +++ b/pyload/plugins/crypter/FilefactoryComFolder.py @@ -23,7 +23,7 @@ class FilefactoryComFolder(Crypter): html = self.load(url_base) new_links = [] - for i in range(1, 100): + for i in xrange(1, 100): self.logInfo("Fetching links from page %i" % i) found = re.search(self.FOLDER_PATTERN, html, re.DOTALL) if found is None: self.fail("Parse error (FOLDER)") diff --git a/pyload/plugins/crypter/LixIn.py b/pyload/plugins/crypter/LixIn.py index 601490ddd..f180e5677 100644 --- a/pyload/plugins/crypter/LixIn.py +++ b/pyload/plugins/crypter/LixIn.py @@ -37,7 +37,7 @@ class LixIn(Crypter): matches = re.search(self.CAPTCHA_PATTERN, self.html) if matches: - for i in range(5): + for _ in xrange(5): matches = re.search(self.CAPTCHA_PATTERN, self.html) if matches: self.logDebug("trying captcha") diff --git a/pyload/plugins/crypter/SafelinkingNet.py b/pyload/plugins/crypter/SafelinkingNet.py index 458a1f337..e0a3e14af 100644 --- a/pyload/plugins/crypter/SafelinkingNet.py +++ b/pyload/plugins/crypter/SafelinkingNet.py @@ -43,7 +43,7 @@ class SafelinkingNet(Crypter): postData["link-password"] = password if "altcaptcha" in self.html: - for i in xrange(5): + for _ in xrange(5): m = re.search(self.__Solvemedia_pattern__, self.html) if m: captchaKey = m.group(1) diff --git a/pyload/plugins/crypter/StealthTo.py b/pyload/plugins/crypter/StealthTo.py index 8a73cdfbb..713c9376c 100644 --- a/pyload/plugins/crypter/StealthTo.py +++ b/pyload/plugins/crypter/StealthTo.py @@ -38,7 +38,7 @@ class StealthTo(Crypter): if re.search(r"name=\"id\"", input[0]): ids.append(re.search(r"value=\"([^\"]+)", input[0]).group(1)) - for i in range(0, len(ids)): + for i in xrange(0, len(ids)): self.req.load(url + "/web", post={"authenticity_token": ats[i], "id": str(ids[i]), "link": ("download_" + str(ids[i]))}, cookies=True) diff --git a/pyload/plugins/crypter/UlozToFolder.py b/pyload/plugins/crypter/UlozToFolder.py index d42605acc..ba049d3b9 100644 --- a/pyload/plugins/crypter/UlozToFolder.py +++ b/pyload/plugins/crypter/UlozToFolder.py @@ -21,7 +21,7 @@ class UlozToFolder(Crypter): html = self.load(self.pyfile.url) new_links = [] - for i in range(1, 100): + for i in xrange(1, 100): self.logInfo("Fetching links from page %i" % i) found = re.search(self.FOLDER_PATTERN, html, re.DOTALL) if found is None: diff --git a/pyload/plugins/hoster/BasePlugin.py b/pyload/plugins/hoster/BasePlugin.py index 7ea1dba17..2b8f7c848 100644 --- a/pyload/plugins/hoster/BasePlugin.py +++ b/pyload/plugins/hoster/BasePlugin.py @@ -38,7 +38,7 @@ class BasePlugin(Hoster): # self.decryptCaptcha("http://localhost:9000/captcha") # # if pyfile.url == "79": - # self.core.api.addPackage("test", [str(i) for i in range(80)], 1) + # self.core.api.addPackage("test", [str(i) for i in xrange(80)], 1) # # return if pyfile.url.startswith("http"): @@ -74,7 +74,7 @@ class BasePlugin(Hoster): def downloadFile(self, pyfile): url = pyfile.url - for i in range(5): + for _ 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/pyload/plugins/hoster/BezvadataCz.py b/pyload/plugins/hoster/BezvadataCz.py index 831eca195..e6cd4c809 100644 --- a/pyload/plugins/hoster/BezvadataCz.py +++ b/pyload/plugins/hoster/BezvadataCz.py @@ -47,7 +47,7 @@ class BezvadataCz(SimpleHoster): #captcha form self.html = self.load(url) self.checkErrors() - for i in range(5): + for _ in xrange(5): action, inputs = self.parseHtmlForm('frm-stahnoutFreeForm') if not inputs: self.parseError("FreeForm") diff --git a/pyload/plugins/hoster/BitshareCom.py b/pyload/plugins/hoster/BitshareCom.py index 389401feb..d48329c0d 100644 --- a/pyload/plugins/hoster/BitshareCom.py +++ b/pyload/plugins/hoster/BitshareCom.py @@ -105,7 +105,7 @@ class BitshareCom(SimpleHoster): self.logDebug("File is captcha protected") id = re.search(self.CAPTCHA_KEY_PATTERN, self.html).group(1) # Try up to 3 times - for i in range(3): + for i in xrange(3): self.logDebug("Resolving ReCaptcha with key [%s], round %d" % (id, i + 1)) recaptcha = ReCaptcha(self) challenge, code = recaptcha.challenge(id) diff --git a/pyload/plugins/hoster/CzshareCom.py b/pyload/plugins/hoster/CzshareCom.py index 57d110608..763bbbd29 100644 --- a/pyload/plugins/hoster/CzshareCom.py +++ b/pyload/plugins/hoster/CzshareCom.py @@ -108,7 +108,7 @@ class CzshareCom(SimpleHoster): # get and decrypt captcha captcha_url = 'http://czshare.com/captcha.php' - for i in range(5): + for _ 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/pyload/plugins/hoster/DataportCz.py b/pyload/plugins/hoster/DataportCz.py index 374c7a469..58ac39c73 100644 --- a/pyload/plugins/hoster/DataportCz.py +++ b/pyload/plugins/hoster/DataportCz.py @@ -39,7 +39,7 @@ class DataportCz(SimpleHoster): def handleFree(self): captchas = {"1": "jkeG", "2": "hMJQ", "3": "vmEK", "4": "ePQM", "5": "blBd"} - for i in range(60): + for _ in xrange(60): action, inputs = self.parseHtmlForm('free_download_form') self.logDebug(action, inputs) if not action or not inputs: diff --git a/pyload/plugins/hoster/DateiTo.py b/pyload/plugins/hoster/DateiTo.py index 11b47240a..c08b775a4 100644 --- a/pyload/plugins/hoster/DateiTo.py +++ b/pyload/plugins/hoster/DateiTo.py @@ -45,7 +45,7 @@ class DateiTo(SimpleHoster): recaptcha = ReCaptcha(self) - for i in range(10): + for _ in xrange(10): self.logDebug("URL", url, "POST", data) self.html = self.load(url, post=data) self.checkErrors() diff --git a/pyload/plugins/hoster/DepositfilesCom.py b/pyload/plugins/hoster/DepositfilesCom.py index c15dbb5c7..20d88f8a0 100644 --- a/pyload/plugins/hoster/DepositfilesCom.py +++ b/pyload/plugins/hoster/DepositfilesCom.py @@ -71,7 +71,7 @@ class DepositfilesCom(SimpleHoster): self.wait() recaptcha = ReCaptcha(self) - for i in range(5): + for _ in xrange(5): self.html = self.load("http://depositfiles.com/get_file.php", get=params) if '<input type=button value="Continue" onclick="check_recaptcha' in self.html: diff --git a/pyload/plugins/hoster/EgoFilesCom.py b/pyload/plugins/hoster/EgoFilesCom.py index e62b0d9d9..5d02d244e 100644 --- a/pyload/plugins/hoster/EgoFilesCom.py +++ b/pyload/plugins/hoster/EgoFilesCom.py @@ -62,7 +62,7 @@ class EgoFilesCom(SimpleHoster): downloadURL = '' recaptcha = ReCaptcha(self) - for i in xrange(5): + for _ in xrange(5): challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY) post_data = {'recaptcha_challenge_field': challenge, 'recaptcha_response_field': response} diff --git a/pyload/plugins/hoster/FilecloudIo.py b/pyload/plugins/hoster/FilecloudIo.py index c9f872617..8ccef67e1 100644 --- a/pyload/plugins/hoster/FilecloudIo.py +++ b/pyload/plugins/hoster/FilecloudIo.py @@ -80,7 +80,7 @@ class FilecloudIo(SimpleHoster): captcha_key = found.group(1) if found else self.RECAPTCHA_KEY data["ctype"] = "recaptcha" - for i in range(5): + for _ in xrange(5): data["recaptcha_challenge"], data["recaptcha_response"] = recaptcha.challenge(captcha_key) json_url = "http://filecloud.io/download-request.json" diff --git a/pyload/plugins/hoster/FilepostCom.py b/pyload/plugins/hoster/FilepostCom.py index de40c2c5c..1deec2c18 100644 --- a/pyload/plugins/hoster/FilepostCom.py +++ b/pyload/plugins/hoster/FilepostCom.py @@ -87,9 +87,9 @@ class FilepostCom(SimpleHoster): # Solve recaptcha recaptcha = ReCaptcha(self) - for pokus in range(5): + for i in xrange(5): get_dict['JsHttpRequest'] = str(int(time() * 10000)) + '-xml' - if pokus: + if i: post_dict["recaptcha_challenge_field"], post_dict["recaptcha_response_field"] = recaptcha.challenge( captcha_key) self.logDebug(u"RECAPTCHA: %s : %s : %s" % ( @@ -97,10 +97,10 @@ class FilepostCom(SimpleHoster): download_url = self.getJsonResponse(get_dict, post_dict, 'link') if download_url: - if pokus: + if i: self.correctCaptcha() break - elif pokus: + elif i: self.invalidCaptcha() else: diff --git a/pyload/plugins/hoster/FilerNet.py b/pyload/plugins/hoster/FilerNet.py index e67efd57e..3a9251fb3 100644 --- a/pyload/plugins/hoster/FilerNet.py +++ b/pyload/plugins/hoster/FilerNet.py @@ -77,7 +77,7 @@ class FilerNet(SimpleHoster): downloadURL = '' recaptcha = ReCaptcha(self) - for i in xrange(5): + for _ in xrange(5): challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY) post_data = {'recaptcha_challenge_field': challenge, 'recaptcha_response_field': response, diff --git a/pyload/plugins/hoster/FileserveCom.py b/pyload/plugins/hoster/FileserveCom.py index 60a7e2181..6697c133f 100644 --- a/pyload/plugins/hoster/FileserveCom.py +++ b/pyload/plugins/hoster/FileserveCom.py @@ -161,7 +161,7 @@ class FileserveCom(Hoster): captcha_key = re.search(self.CAPTCHA_KEY_PATTERN, self.html).group("key") recaptcha = ReCaptcha(self) - for i in range(5): + for _ in xrange(5): challenge, code = recaptcha.challenge(captcha_key) response = json_loads(self.load(self.URLS[2], diff --git a/pyload/plugins/hoster/GigapetaCom.py b/pyload/plugins/hoster/GigapetaCom.py index c57bce4c9..1472fbb1d 100644 --- a/pyload/plugins/hoster/GigapetaCom.py +++ b/pyload/plugins/hoster/GigapetaCom.py @@ -43,7 +43,7 @@ class GigapetaCom(SimpleHoster): self.req.http.c.setopt(FOLLOWLOCATION, 0) - for i in range(5): + for _ in xrange(5): self.checkErrors() captcha = self.decryptCaptcha(captcha_url) diff --git a/pyload/plugins/hoster/IfileIt.py b/pyload/plugins/hoster/IfileIt.py index b14aab4c8..16f2ce576 100644 --- a/pyload/plugins/hoster/IfileIt.py +++ b/pyload/plugins/hoster/IfileIt.py @@ -54,7 +54,7 @@ class IfileIt(SimpleHoster): recaptcha = ReCaptcha(self) post_data["ctype"] = "recaptcha" - for i in range(5): + for _ 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/pyload/plugins/hoster/IfolderRu.py b/pyload/plugins/hoster/IfolderRu.py index 10dc169e7..3a0290591 100644 --- a/pyload/plugins/hoster/IfolderRu.py +++ b/pyload/plugins/hoster/IfolderRu.py @@ -62,7 +62,7 @@ class IfolderRu(SimpleHoster): self.wait() captcha_url = "http://ints.rusfolder.com/random/images/?session=%s" % session_id - for i in range(5): + for _ 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/pyload/plugins/hoster/Keep2shareCC.py b/pyload/plugins/hoster/Keep2shareCC.py index 67175b7ab..cb5f4e9a9 100644 --- a/pyload/plugins/hoster/Keep2shareCC.py +++ b/pyload/plugins/hoster/Keep2shareCC.py @@ -84,7 +84,7 @@ class Keep2shareCC(SimpleHoster): def handleCaptcha(self): recaptcha = ReCaptcha(self) - for i in xrange(5): + for _ in xrange(5): challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY) post_data = {'recaptcha_challenge_field': challenge, 'recaptcha_response_field': response, diff --git a/pyload/plugins/hoster/LuckyShareNet.py b/pyload/plugins/hoster/LuckyShareNet.py index 6097bf13d..2208f90d7 100644 --- a/pyload/plugins/hoster/LuckyShareNet.py +++ b/pyload/plugins/hoster/LuckyShareNet.py @@ -47,7 +47,7 @@ class LuckyShareNet(SimpleHoster): self.wait() recaptcha = ReCaptcha(self) - for i in xrange(5): + for _ in xrange(5): challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY) rep = self.load(r"http://luckyshare.net/download/verify/challenge/%s/response/%s/hash/%s" % (challenge, response, json['hash']), decode=True) diff --git a/pyload/plugins/hoster/MediafireCom.py b/pyload/plugins/hoster/MediafireCom.py index e4850dcb6..201341461 100644 --- a/pyload/plugins/hoster/MediafireCom.py +++ b/pyload/plugins/hoster/MediafireCom.py @@ -28,7 +28,7 @@ def replace_eval(js_expr): def checkHTMLHeader(url): try: - for i in range(3): + for _ in xrange(3): header = getURL(url, just_header=True) for line in header.splitlines(): line = line.lower() @@ -123,7 +123,7 @@ class MediafireCom(SimpleHoster): self.download(download_url) def checkCaptcha(self): - for i in xrange(5): + for _ in xrange(5): found = re.search(self.SOLVEMEDIA_PATTERN, self.html) if found: captcha_key = found.group(1) diff --git a/pyload/plugins/hoster/MegasharesCom.py b/pyload/plugins/hoster/MegasharesCom.py index 13e8642ed..9949da9d5 100644 --- a/pyload/plugins/hoster/MegasharesCom.py +++ b/pyload/plugins/hoster/MegasharesCom.py @@ -63,7 +63,7 @@ class MegasharesCom(SimpleHoster): passport_num = found.group(1) request_uri = re.search(self.REQUEST_URI_PATTERN, self.html).group(1) - for _ in range(5): + for _ in xrange(5): random_num = re.search(self.REACTIVATE_NUM_PATTERN, self.html).group(1) verifyinput = self.decryptCaptcha( diff --git a/pyload/plugins/hoster/NarodRu.py b/pyload/plugins/hoster/NarodRu.py index d932f4918..e617a7193 100644 --- a/pyload/plugins/hoster/NarodRu.py +++ b/pyload/plugins/hoster/NarodRu.py @@ -42,7 +42,7 @@ class NarodRu(SimpleHoster): DOWNLOAD_LINK_PATTERN = r'<a class="h-link" rel="yandex_bar" href="(.+?)">' def handleFree(self): - for i in range(5): + for _ in xrange(5): self.html = self.load('http://narod.ru/disk/getcapchaxml/?rnd=%d' % int(random() * 777)) found = re.search(self.CAPTCHA_PATTERN, self.html) if not found: diff --git a/pyload/plugins/hoster/NetloadIn.py b/pyload/plugins/hoster/NetloadIn.py index d34e8b6af..f09565001 100644 --- a/pyload/plugins/hoster/NetloadIn.py +++ b/pyload/plugins/hoster/NetloadIn.py @@ -159,7 +159,7 @@ class NetloadIn(Hoster): self.pyfile.name = name captchawaited = False - for i in range(10): + for i in xrange(10): if not page: page = self.load(self.url) diff --git a/pyload/plugins/hoster/RyushareCom.py b/pyload/plugins/hoster/RyushareCom.py index 92844b360..4d3e9b7f3 100644 --- a/pyload/plugins/hoster/RyushareCom.py +++ b/pyload/plugins/hoster/RyushareCom.py @@ -53,7 +53,7 @@ class RyushareCom(XFileSharingPro): if retry: self.retry() - for i in xrange(5): + for _ in xrange(5): m = re.search(self.SOLVEMEDIA_PATTERN, self.html) if not m: self.parseError("Error parsing captcha") diff --git a/pyload/plugins/hoster/SendspaceCom.py b/pyload/plugins/hoster/SendspaceCom.py index 4efffb784..9f08003ed 100644 --- a/pyload/plugins/hoster/SendspaceCom.py +++ b/pyload/plugins/hoster/SendspaceCom.py @@ -38,7 +38,7 @@ class SendspaceCom(SimpleHoster): def handleFree(self): params = {} - for i in range(3): + for _ in xrange(3): found = re.search(self.DOWNLOAD_URL_PATTERN, self.html) if found: if 'captcha_hash' in params: diff --git a/pyload/plugins/hoster/StreamcloudEu.py b/pyload/plugins/hoster/StreamcloudEu.py index 670962ad5..a61588508 100644 --- a/pyload/plugins/hoster/StreamcloudEu.py +++ b/pyload/plugins/hoster/StreamcloudEu.py @@ -27,7 +27,7 @@ class StreamcloudEu(XFileSharingPro): if found: return found.group(1) - for i in range(5): + for i in xrange(5): self.logDebug("Getting download link: #%d" % i) data = self.getPostParameters() httpRequest = HTTPRequest(options=self.req.options) @@ -53,7 +53,7 @@ class StreamcloudEu(XFileSharingPro): return found.group(1) def getPostParameters(self): - for i in range(3): + for _ in xrange(3): if not self.errmsg: self.checkErrors() diff --git a/pyload/plugins/hoster/TurbobitNet.py b/pyload/plugins/hoster/TurbobitNet.py index f33775f80..5bed39712 100644 --- a/pyload/plugins/hoster/TurbobitNet.py +++ b/pyload/plugins/hoster/TurbobitNet.py @@ -70,7 +70,7 @@ class TurbobitNet(SimpleHoster): self.downloadFile() def solveCaptcha(self): - for i in range(5): + for _ in xrange(5): found = re.search(self.LIMIT_WAIT_PATTERN, self.html) if found: wait_time = int(found.group(1)) @@ -135,7 +135,7 @@ class TurbobitNet(SimpleHoster): found = re.search("(/\w+/timeout\.js\?\w+=)([^\"\'<>]+)", self.html) url = "http://turbobit.net%s%s" % (found.groups() if found else ( - '/files/timeout.js?ver=', ''.join(random.choice('0123456789ABCDEF') for x in range(32)))) + '/files/timeout.js?ver=', ''.join(random.choice('0123456789ABCDEF') for _ in xrange(32)))) fun = self.load(url) self.setWait(65, False) diff --git a/pyload/plugins/hoster/UnibytesCom.py b/pyload/plugins/hoster/UnibytesCom.py index eb1132e99..c7deba89c 100644 --- a/pyload/plugins/hoster/UnibytesCom.py +++ b/pyload/plugins/hoster/UnibytesCom.py @@ -40,7 +40,7 @@ class UnibytesCom(SimpleHoster): action, post_data = self.parseHtmlForm('id="startForm"') self.req.http.c.setopt(FOLLOWLOCATION, 0) - for i in range(8): + for _ in xrange(8): self.logDebug(action, post_data) self.html = self.load(self.DOMAIN + action, post=post_data) diff --git a/pyload/plugins/hoster/UnrestrictLi.py b/pyload/plugins/hoster/UnrestrictLi.py index bac2ed791..622d43674 100644 --- a/pyload/plugins/hoster/UnrestrictLi.py +++ b/pyload/plugins/hoster/UnrestrictLi.py @@ -54,7 +54,7 @@ class UnrestrictLi(Hoster): self.fail("No Unrestrict.li account provided") else: self.logDebug("Old URL: %s" % pyfile.url) - for i in xrange(5): + for _ in xrange(5): page = self.req.load('https://unrestrict.li/unrestrict.php', post={'link': pyfile.url, 'domain': 'long'}) self.logDebug("JSON data: " + page) diff --git a/pyload/plugins/hoster/UploadedTo.py b/pyload/plugins/hoster/UploadedTo.py index 56d8b1628..5b53b0aa5 100644 --- a/pyload/plugins/hoster/UploadedTo.py +++ b/pyload/plugins/hoster/UploadedTo.py @@ -33,7 +33,7 @@ def getAPIData(urls): post["id_%s" % i] = id idMap[id] = url - for i in xrange(5): + for _ 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 @@ -189,7 +189,7 @@ class UploadedTo(Hoster): url = "http://uploaded.net/io/ticket/captcha/%s" % self.fileID downloadURL = "" - for i in range(5): + for _ in xrange(5): re_captcha = ReCaptcha(self) challenge, result = re_captcha.challenge(challengeId.group(1)) options = {"recaptcha_challenge_field": challenge, "recaptcha_response_field": result} diff --git a/pyload/plugins/hoster/UploadheroCom.py b/pyload/plugins/hoster/UploadheroCom.py index 7b047e028..993f34a0f 100644 --- a/pyload/plugins/hoster/UploadheroCom.py +++ b/pyload/plugins/hoster/UploadheroCom.py @@ -53,7 +53,7 @@ class UploadheroCom(SimpleHoster): self.parseError("Captcha URL") captcha_url = "http://uploadhero.co" + found.group(1) - for i in range(5): + for _ in xrange(5): captcha = self.decryptCaptcha(captcha_url) self.html = self.load(self.pyfile.url, get={"code": captcha}) found = re.search(self.FREE_URL_PATTERN, self.html) diff --git a/pyload/plugins/hoster/Xdcc.py b/pyload/plugins/hoster/Xdcc.py index 90de28013..e1c423453 100644 --- a/pyload/plugins/hoster/Xdcc.py +++ b/pyload/plugins/hoster/Xdcc.py @@ -55,7 +55,7 @@ class Xdcc(Hoster): self.req = pyfile.m.core.requestFactory.getRequest(self.__name__, type="XDCC") self.pyfile = pyfile - for i in range(0, 3): + for _ in xrange(0, 3): try: nmn = self.doDownload(pyfile.url) self.logDebug("%s: Download of %s finished." % (self.__name__, nmn)) diff --git a/pyload/plugins/hoster/ZeveraCom.py b/pyload/plugins/hoster/ZeveraCom.py index 9546f09d3..760703ee1 100644 --- a/pyload/plugins/hoster/ZeveraCom.py +++ b/pyload/plugins/hoster/ZeveraCom.py @@ -51,7 +51,7 @@ class ZeveraCom(Hoster): # last_size = retries = 0 # olink = self.pyfile.url #quote(self.pyfile.url.encode('utf_8')) # - # for i in range(100): + # for _ in xrange(100): # self.retData = self.account.loadAPIRequest(self.req, cmd = 'download_request', olink = olink) # self.checkAPIErrors(self.retData) # diff --git a/pyload/plugins/hoster/ZippyshareCom.py b/pyload/plugins/hoster/ZippyshareCom.py index ea861025d..54e8eee21 100644 --- a/pyload/plugins/hoster/ZippyshareCom.py +++ b/pyload/plugins/hoster/ZippyshareCom.py @@ -200,7 +200,7 @@ class ZippyshareCom(SimpleHoster): recaptcha = ReCaptcha(self) - for i in range(5): + for _ in xrange(5): challenge, code = recaptcha.challenge(captcha_key) response = json_loads(self.load(self.file_info['HOST'] + '/rest/captcha/test', diff --git a/pyload/plugins/internal/OCR.py b/pyload/plugins/internal/OCR.py index 9f8b7ef8c..c30125a03 100644 --- a/pyload/plugins/internal/OCR.py +++ b/pyload/plugins/internal/OCR.py @@ -185,7 +185,7 @@ class OCR(object): highest = {} counts = {} - for angle in range(-45, 45): + for angle in xrange(-45, 45): tmpimage = self.image.rotate(angle) diff --git a/pyload/plugins/internal/SimpleCrypter.py b/pyload/plugins/internal/SimpleCrypter.py index e93f5346d..4606b8016 100644 --- a/pyload/plugins/internal/SimpleCrypter.py +++ b/pyload/plugins/internal/SimpleCrypter.py @@ -98,6 +98,6 @@ class SimpleCrypter(Crypter): else: pages = 1 - for p in range(2, pages + 1): + for p in xrange(2, pages + 1): self.html = self.loadPage(p) self.package_links += self.getLinks() |