diff options
Diffstat (limited to 'module')
46 files changed, 61 insertions, 61 deletions
| diff --git a/module/plugins/PluginManager.py b/module/plugins/PluginManager.py index f3f5f47bc..7fef76b27 100644 --- a/module/plugins/PluginManager.py +++ b/module/plugins/PluginManager.py @@ -371,7 +371,7 @@ if __name__ == "__main__":      a = time() -    test = ["http://www.youtube.com/watch?v=%s" % x for x in range(0, 100)] +    test = ["http://www.youtube.com/watch?v=%s" % x for x in xrange(0, 100)]      print p.parseUrls(test)      b = time() diff --git a/module/plugins/accounts/BayfilesCom.py b/module/plugins/accounts/BayfilesCom.py index 0a9e11ec8..d9330158a 100644 --- a/module/plugins/accounts/BayfilesCom.py +++ b/module/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/module/plugins/accounts/FilecloudIo.py b/module/plugins/accounts/FilecloudIo.py index 93ae02006..15e1d90be 100644 --- a/module/plugins/accounts/FilecloudIo.py +++ b/module/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/module/plugins/captcha/LinksaveIn.py b/module/plugins/captcha/LinksaveIn.py index 3ad7b265a..e3cdf5a45 100644 --- a/module/plugins/captcha/LinksaveIn.py +++ b/module/plugins/captcha/LinksaveIn.py @@ -29,8 +29,8 @@ class LinksaveIn(OCR):                  break              frame = im.copy()              pix = frame.load() -            for x in range(frame.size[0]): -                for y in range(frame.size[1]): +            for x in xrange(frame.size[0]): +                for y in xrange(frame.size[1]):                      if lut[pix[x, y]] != (0,0,0):                          npix[x, y] = lut[pix[x, y]]              frame_nr += 1 @@ -57,8 +57,8 @@ class LinksaveIn(OCR):              bgpix = bg.load()              pix = img.load() -            for x in range(bg.size[0]): -                for y in range(bg.size[1]): +            for x in xrange(bg.size[0]): +                for y in xrange(bg.size[1]):                      rgb_bg = bglut[bgpix[x, y]]                      rgb_c = lut[pix[x, y]]                      try: @@ -90,8 +90,8 @@ class LinksaveIn(OCR):          bgpix = bg.load()          pix = img.load()          orgpix = self.image.load() -        for x in range(bg.size[0]): -            for y in range(bg.size[1]): +        for x in xrange(bg.size[0]): +            for y in xrange(bg.size[1]):                  rgb_bg = bglut[bgpix[x, y]]                  rgb_c = lut[pix[x, y]]                  if rgb_c == rgb_bg: @@ -102,8 +102,8 @@ class LinksaveIn(OCR):          pix = new.load()          orgpix = self.image.load()          thresh = 4 -        for x in range(new.size[0]): -            for y in range(new.size[1]): +        for x in xrange(new.size[0]): +            for y in xrange(new.size[1]):                  rgb = orgpix[x, y]                  r, g, b = rgb                  pix[x, y] = (255,255,255) diff --git a/module/plugins/captcha/captcha.py b/module/plugins/captcha/captcha.py index 4cbb736c1..bbd871b71 100644 --- a/module/plugins/captcha/captcha.py +++ b/module/plugins/captcha/captcha.py @@ -186,7 +186,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/module/plugins/crypter/FilefactoryComFolder.py b/module/plugins/crypter/FilefactoryComFolder.py index 4f7ed6281..6a1ffea2c 100644 --- a/module/plugins/crypter/FilefactoryComFolder.py +++ b/module/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/module/plugins/crypter/LixIn.py b/module/plugins/crypter/LixIn.py index 601490ddd..f180e5677 100644 --- a/module/plugins/crypter/LixIn.py +++ b/module/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/module/plugins/crypter/SafelinkingNet.py b/module/plugins/crypter/SafelinkingNet.py index 458a1f337..e0a3e14af 100644 --- a/module/plugins/crypter/SafelinkingNet.py +++ b/module/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/module/plugins/crypter/StealthTo.py b/module/plugins/crypter/StealthTo.py index 8a73cdfbb..713c9376c 100644 --- a/module/plugins/crypter/StealthTo.py +++ b/module/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/module/plugins/crypter/UlozToFolder.py b/module/plugins/crypter/UlozToFolder.py index d42605acc..ba049d3b9 100644 --- a/module/plugins/crypter/UlozToFolder.py +++ b/module/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/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index 3a1b9fe8f..b2895a357 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/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/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py index 9a4efaa95..0901925c0 100644 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ b/module/plugins/hooks/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/module/plugins/hooks/DeathByCaptcha.py b/module/plugins/hooks/DeathByCaptcha.py index 9e466e193..334fd8467 100644 --- a/module/plugins/hooks/DeathByCaptcha.py +++ b/module/plugins/hooks/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/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py index 3a735bcda..62e800f49 100644 --- a/module/plugins/hoster/BasePlugin.py +++ b/module/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/module/plugins/hoster/BezvadataCz.py b/module/plugins/hoster/BezvadataCz.py index b6aa60374..78836fa44 100644 --- a/module/plugins/hoster/BezvadataCz.py +++ b/module/plugins/hoster/BezvadataCz.py @@ -46,7 +46,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/module/plugins/hoster/BitshareCom.py b/module/plugins/hoster/BitshareCom.py index 389401feb..d48329c0d 100644 --- a/module/plugins/hoster/BitshareCom.py +++ b/module/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/module/plugins/hoster/CzshareCom.py b/module/plugins/hoster/CzshareCom.py index 57d110608..763bbbd29 100644 --- a/module/plugins/hoster/CzshareCom.py +++ b/module/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/module/plugins/hoster/DataportCz.py b/module/plugins/hoster/DataportCz.py index 374c7a469..58ac39c73 100644 --- a/module/plugins/hoster/DataportCz.py +++ b/module/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/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py index 11b47240a..c08b775a4 100644 --- a/module/plugins/hoster/DateiTo.py +++ b/module/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/module/plugins/hoster/DepositfilesCom.py b/module/plugins/hoster/DepositfilesCom.py index c15dbb5c7..20d88f8a0 100644 --- a/module/plugins/hoster/DepositfilesCom.py +++ b/module/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/module/plugins/hoster/EgoFilesCom.py b/module/plugins/hoster/EgoFilesCom.py index e62b0d9d9..5d02d244e 100644 --- a/module/plugins/hoster/EgoFilesCom.py +++ b/module/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/module/plugins/hoster/FilecloudIo.py b/module/plugins/hoster/FilecloudIo.py index c9f872617..8ccef67e1 100644 --- a/module/plugins/hoster/FilecloudIo.py +++ b/module/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/module/plugins/hoster/FilepostCom.py b/module/plugins/hoster/FilepostCom.py index de40c2c5c..1deec2c18 100644 --- a/module/plugins/hoster/FilepostCom.py +++ b/module/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/module/plugins/hoster/FilerNet.py b/module/plugins/hoster/FilerNet.py index e67efd57e..3a9251fb3 100644 --- a/module/plugins/hoster/FilerNet.py +++ b/module/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/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py index 60a7e2181..6697c133f 100644 --- a/module/plugins/hoster/FileserveCom.py +++ b/module/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/module/plugins/hoster/GigapetaCom.py b/module/plugins/hoster/GigapetaCom.py index c57bce4c9..1472fbb1d 100644 --- a/module/plugins/hoster/GigapetaCom.py +++ b/module/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/module/plugins/hoster/IfileIt.py b/module/plugins/hoster/IfileIt.py index b14aab4c8..16f2ce576 100644 --- a/module/plugins/hoster/IfileIt.py +++ b/module/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/module/plugins/hoster/IfolderRu.py b/module/plugins/hoster/IfolderRu.py index 10dc169e7..3a0290591 100644 --- a/module/plugins/hoster/IfolderRu.py +++ b/module/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/module/plugins/hoster/Keep2shareCC.py b/module/plugins/hoster/Keep2shareCC.py index 67175b7ab..cb5f4e9a9 100644 --- a/module/plugins/hoster/Keep2shareCC.py +++ b/module/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/module/plugins/hoster/LuckyShareNet.py b/module/plugins/hoster/LuckyShareNet.py index 6097bf13d..2208f90d7 100644 --- a/module/plugins/hoster/LuckyShareNet.py +++ b/module/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/module/plugins/hoster/MediafireCom.py b/module/plugins/hoster/MediafireCom.py index e4850dcb6..201341461 100644 --- a/module/plugins/hoster/MediafireCom.py +++ b/module/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/module/plugins/hoster/MegasharesCom.py b/module/plugins/hoster/MegasharesCom.py index 13e8642ed..9949da9d5 100644 --- a/module/plugins/hoster/MegasharesCom.py +++ b/module/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/module/plugins/hoster/NarodRu.py b/module/plugins/hoster/NarodRu.py index d932f4918..e617a7193 100644 --- a/module/plugins/hoster/NarodRu.py +++ b/module/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/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py index d34e8b6af..f09565001 100644 --- a/module/plugins/hoster/NetloadIn.py +++ b/module/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/module/plugins/hoster/RyushareCom.py b/module/plugins/hoster/RyushareCom.py index 92844b360..4d3e9b7f3 100644 --- a/module/plugins/hoster/RyushareCom.py +++ b/module/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/module/plugins/hoster/SendspaceCom.py b/module/plugins/hoster/SendspaceCom.py index 4efffb784..9f08003ed 100644 --- a/module/plugins/hoster/SendspaceCom.py +++ b/module/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/module/plugins/hoster/StreamcloudEu.py b/module/plugins/hoster/StreamcloudEu.py index 670962ad5..a61588508 100644 --- a/module/plugins/hoster/StreamcloudEu.py +++ b/module/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/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index f33775f80..5bed39712 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/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/module/plugins/hoster/UnibytesCom.py b/module/plugins/hoster/UnibytesCom.py index eb1132e99..c7deba89c 100644 --- a/module/plugins/hoster/UnibytesCom.py +++ b/module/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/module/plugins/hoster/UnrestrictLi.py b/module/plugins/hoster/UnrestrictLi.py index bac2ed791..622d43674 100644 --- a/module/plugins/hoster/UnrestrictLi.py +++ b/module/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/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py index 56d8b1628..5b53b0aa5 100644 --- a/module/plugins/hoster/UploadedTo.py +++ b/module/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/module/plugins/hoster/UploadheroCom.py b/module/plugins/hoster/UploadheroCom.py index 7b047e028..993f34a0f 100644 --- a/module/plugins/hoster/UploadheroCom.py +++ b/module/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/module/plugins/hoster/Xdcc.py b/module/plugins/hoster/Xdcc.py index 90de28013..e1c423453 100644 --- a/module/plugins/hoster/Xdcc.py +++ b/module/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/module/plugins/hoster/ZeveraCom.py b/module/plugins/hoster/ZeveraCom.py index 9546f09d3..760703ee1 100644 --- a/module/plugins/hoster/ZeveraCom.py +++ b/module/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/module/plugins/hoster/ZippyshareCom.py b/module/plugins/hoster/ZippyshareCom.py index ea861025d..54e8eee21 100644 --- a/module/plugins/hoster/ZippyshareCom.py +++ b/module/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/module/plugins/internal/SimpleCrypter.py b/module/plugins/internal/SimpleCrypter.py index dda1f68b6..b1a18f5e0 100644 --- a/module/plugins/internal/SimpleCrypter.py +++ b/module/plugins/internal/SimpleCrypter.py @@ -101,6 +101,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() | 
