diff options
| author | 2014-04-18 16:21:42 +0200 | |
|---|---|---|
| committer | 2014-04-18 16:21:42 +0200 | |
| commit | 1db169b2a7f1df66777a1045b17fc948b1b45c42 (patch) | |
| tree | e3df2bbef73737a21417b536ef15a4ea129bba05 | |
| parent | Using in instead of has_key (diff) | |
| download | pyload-1db169b2a7f1df66777a1045b17fc948b1b45c42.tar.xz | |
Fixed some PEP8 violations
| -rw-r--r-- | module/plugins/hoster/DepositfilesCom.py | 2 | ||||
| -rw-r--r-- | module/plugins/hoster/FileserveCom.py | 4 | ||||
| -rw-r--r-- | module/plugins/hoster/FreeWayMe.py | 1 | ||||
| -rw-r--r-- | module/plugins/hoster/MovReelCom.py | 1 | ||||
| -rw-r--r-- | module/plugins/hoster/NetloadIn.py | 2 | ||||
| -rw-r--r-- | module/plugins/hoster/OneFichierCom.py | 8 | ||||
| -rw-r--r-- | module/plugins/hoster/SimplydebridCom.py | 2 | ||||
| -rw-r--r-- | module/plugins/hoster/UlozTo.py | 3 | ||||
| -rw-r--r-- | module/plugins/hoster/Xdcc.py | 2 | 
9 files changed, 14 insertions, 11 deletions
| diff --git a/module/plugins/hoster/DepositfilesCom.py b/module/plugins/hoster/DepositfilesCom.py index 81523234d..11b4f4112 100644 --- a/module/plugins/hoster/DepositfilesCom.py +++ b/module/plugins/hoster/DepositfilesCom.py @@ -20,7 +20,7 @@ class DepositfilesCom(SimpleHoster):      FILE_OFFLINE_PATTERN = r'<span class="html_download_api-not_exists"></span>'      FILE_URL_REPLACEMENTS = [(r"\.com(/.*?)?/files", ".com/en/files"), (r"\.html$", "")]      FILE_NAME_REPLACEMENTS = [(r'\%u([0-9A-Fa-f]{4})', lambda m: unichr(int(m.group(1), 16))), -                              (r'.*<b title="(?P<N>[^"]+).*', "\g<N>" )] +                              (r'.*<b title="(?P<N>[^"]+).*', "\g<N>")]      RECAPTCHA_PATTERN = r"Recaptcha.create\('([^']+)'"      DOWNLOAD_LINK_PATTERN = r'<form id="downloader_file_form" action="(http://.+?\.(dfiles\.eu|depositfiles\.com)/.+?)" method="post"' diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py index c28bae456..4c678c1b1 100644 --- a/module/plugins/hoster/FileserveCom.py +++ b/module/plugins/hoster/FileserveCom.py @@ -91,7 +91,7 @@ class FileserveCom(Hoster):          if "fail" in action:              if action["fail"] == "timeLimit": -                self.html = self.load(self.url,post={"checkDownload": "showError", "errorType": "timeLimit"}, +                self.html = self.load(self.url, post={"checkDownload": "showError", "errorType": "timeLimit"},                                        decode=True)                  self.doLongWait(re.search(self.LONG_WAIT_PATTERN, self.html)) @@ -134,7 +134,7 @@ class FileserveCom(Hoster):              self.doLongWait(self.lastCheck)          elif check == "limit":              #download limited reached for today (not a exact time known) -            self.setWait(3 * 60 * 60, True) # wait 3 hours #TO-DO: resolve waittime using UnrestrictLi's secondsToMidnight +            self.setWait(3 * 60 * 60, True)  # wait 3 hours #TO-DO: resolve waittime using UnrestrictLi's secondsToMidnight              self.wait()              self.retry() diff --git a/module/plugins/hoster/FreeWayMe.py b/module/plugins/hoster/FreeWayMe.py index 20a53108c..d72b12a12 100644 --- a/module/plugins/hoster/FreeWayMe.py +++ b/module/plugins/hoster/FreeWayMe.py @@ -19,6 +19,7 @@  from module.plugins.Hoster import Hoster +  class FreeWayMe(Hoster):      __name__ = "FreeWayMe"      __version__ = "0.11" diff --git a/module/plugins/hoster/MovReelCom.py b/module/plugins/hoster/MovReelCom.py index ca13fb717..2dedcf13d 100644 --- a/module/plugins/hoster/MovReelCom.py +++ b/module/plugins/hoster/MovReelCom.py @@ -4,6 +4,7 @@  from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo  #from pycurl import FOLLOWLOCATION, LOW_SPEED_TIME +  class MovReelCom(XFileSharingPro):      __name__ = "MovReelCom"      __type__ = "hoster" diff --git a/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py index fa27c58df..4b8842d18 100644 --- a/module/plugins/hoster/NetloadIn.py +++ b/module/plugins/hoster/NetloadIn.py @@ -40,7 +40,7 @@ def getInfo(urls):                      size = int(tmp[2])                  except:                      size = 0 -                result.append((tmp[1], size, 2 if tmp[3] == "online" else 1, chunk[i] )) +                result.append((tmp[1], size, 2 if tmp[3] == "online" else 1, chunk[i]))              except:                  print "Netload prefetch: Error while processing response: "                  print r diff --git a/module/plugins/hoster/OneFichierCom.py b/module/plugins/hoster/OneFichierCom.py index 6b4b51d8c..923a19c86 100644 --- a/module/plugins/hoster/OneFichierCom.py +++ b/module/plugins/hoster/OneFichierCom.py @@ -26,7 +26,7 @@ class OneFichierCom(SimpleHoster):      WAITING_PATTERN = "Warning ! Without premium status, you must wait up to (\d+) minutes between each downloads"      LAST_DOWNLOAD_DELAY = "Your last download finished (\d+) minutes ago"      NOT_PARALLEL = r"Warning ! Without premium status, you can download only one file at a time" -    RETRY_TIME = 15*60 #Default retry time in seconds (if detected parallel download) +    RETRY_TIME = 15*60  # Default retry time in seconds (if detected parallel download)      def process(self, pyfile):          found = re.match(self.__pattern__, pyfile.url) @@ -38,13 +38,13 @@ class OneFichierCom(SimpleHoster):          found = re.search(self.WAITING_PATTERN, self.html)          if found: -            last_delay=0 +            last_delay = 0              # retrieve the delay from the last download to substract from required delay              found_delay = re.search(self.LAST_DOWNLOAD_DELAY, self.html)              if found_delay: -                last_delay=int(found_delay.group(1)) +                last_delay = int(found_delay.group(1))              self.waitAndRetry((int(found.group(1)) - last_delay) * 60) -        else: #detect parallel download +        else:  # detect parallel download              found = re.search(self.NOT_PARALLEL, self.html)              if found:                  self.waitAndRetry(self.RETRY_TIME) diff --git a/module/plugins/hoster/SimplydebridCom.py b/module/plugins/hoster/SimplydebridCom.py index c364819a0..2f2f666ba 100644 --- a/module/plugins/hoster/SimplydebridCom.py +++ b/module/plugins/hoster/SimplydebridCom.py @@ -43,7 +43,7 @@ class SimplydebridCom(Hoster):          self.logDebug("New URL: %s" % new_url)          if not re.match(self.__pattern__, new_url): -            page = self.load('http://simply-debrid.com/api.php', get={'dl': new_url}) #+'&u='+self.user+'&p='+self.account.getAccountData(self.user)['password']) +            page = self.load('http://simply-debrid.com/api.php', get={'dl': new_url})  # +'&u='+self.user+'&p='+self.account.getAccountData(self.user)['password'])              if 'tiger Link' in page or 'Invalid Link' in page or ('API' in page and 'ERROR' in page):                  self.fail('Unable to unrestrict link')              new_url = page diff --git a/module/plugins/hoster/UlozTo.py b/module/plugins/hoster/UlozTo.py index ea0c70fec..65e941981 100644 --- a/module/plugins/hoster/UlozTo.py +++ b/module/plugins/hoster/UlozTo.py @@ -26,6 +26,7 @@ def convertDecimalPrefix(m):      # decimal prefixes used in filesize and traffic      return ("%%.%df" % {'k': 3, 'M': 6, 'G': 9}[m.group(2)] % float(m.group(1))).replace('.', '') +  class UlozTo(SimpleHoster):      __name__ = "UlozTo"      __type__ = "hoster" @@ -110,7 +111,7 @@ class UlozTo(SimpleHoster):              # New version - better to get new parameters (like captcha reload) because of image url - since 6.12.2013              self.logDebug('Using "new" version') -            xapca = self.load("http://www.ulozto.net/reloadXapca.php", get = { "rnd": str(int(time.time()))}) +            xapca = self.load("http://www.ulozto.net/reloadXapca.php", get={"rnd": str(int(time.time()))})              self.logDebug('xapca = ' + str(xapca))              data = json_loads(xapca) diff --git a/module/plugins/hoster/Xdcc.py b/module/plugins/hoster/Xdcc.py index d358c63b5..53f61836b 100644 --- a/module/plugins/hoster/Xdcc.py +++ b/module/plugins/hoster/Xdcc.py @@ -132,7 +132,7 @@ class Xdcc(Hoster):                      sock.send("PRIVMSG %s :xdcc send #%s\r\n" % (bot, pack))              else: -                if (dl_time + self.timeout) < time.time(): # todo: add in config +                if (dl_time + self.timeout) < time.time():  # todo: add in config                      sock.send("QUIT :byebye\r\n")                      sock.close()                      self.fail("XDCC Bot did not answer") | 
