diff options
Diffstat (limited to 'module/plugins/hoster')
32 files changed, 40 insertions, 40 deletions
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',  | 
