diff options
| author | 2015-04-20 22:48:30 +0200 | |
|---|---|---|
| committer | 2015-04-20 23:02:00 +0200 | |
| commit | 5a86c3cb1db6cd87bf9ae22e09dd209cecc0a363 (patch) | |
| tree | d5fbe979c043f5aa684272c97c0305d3124b1901 /pyload/plugin | |
| parent | PEP-8, Python Zen, refactor and reduce code (part 12 in master module/remote/... (diff) | |
| download | pyload-5a86c3cb1db6cd87bf9ae22e09dd209cecc0a363.tar.xz | |
Spare code cosmetics (8)
Diffstat (limited to 'pyload/plugin')
35 files changed, 59 insertions, 59 deletions
| diff --git a/pyload/plugin/Addon.py b/pyload/plugin/Addon.py index bb90428e4..43de6732a 100644 --- a/pyload/plugin/Addon.py +++ b/pyload/plugin/Addon.py @@ -56,21 +56,21 @@ class Addon(Base):          #: `AddonManager`          self.manager = manager -        #register events +        # register events          if self.event_map:              for event, funcs in self.event_map.iteritems():                  if type(funcs) in (list, tuple):                      for f in funcs: -                        self.manager.addEvent(event, getattr(self,f)) +                        self.manager.addEvent(event, getattr(self, f))                  else: -                    self.manager.addEvent(event, getattr(self,funcs)) +                    self.manager.addEvent(event, getattr(self, funcs)) -            #delete for various reasons +            # delete for various reasons              self.event_map = None          if self.event_list:              for f in self.event_list: -                self.manager.addEvent(f, getattr(self,f)) +                self.manager.addEvent(f, getattr(self, f))              self.event_list = None diff --git a/pyload/plugin/Hoster.py b/pyload/plugin/Hoster.py index df778c72f..64c635c45 100644 --- a/pyload/plugin/Hoster.py +++ b/pyload/plugin/Hoster.py @@ -4,7 +4,7 @@ from pyload.plugin.Plugin import Plugin  def getInfo(self): -        #result = [ .. (name, size, status, url) .. ] +        # result = [ .. (name, size, status, url) .. ]          return diff --git a/pyload/plugin/Plugin.py b/pyload/plugin/Plugin.py index 54963447c..0604547a3 100644 --- a/pyload/plugin/Plugin.py +++ b/pyload/plugin/Plugin.py @@ -705,7 +705,7 @@ class Plugin(Base):              content = f.read(read_size if read_size else -1)          # produces encoding errors, better log to other file in the future? -        #self.logDebug("Content: %s" % content) +        # self.logDebug("Content: %s" % content)          for name, rule in rules.iteritems():              if isinstance(rule, basestring):                  if rule in content: diff --git a/pyload/plugin/account/AlldebridCom.py b/pyload/plugin/account/AlldebridCom.py index e3eb01ac2..efc5753f8 100644 --- a/pyload/plugin/account/AlldebridCom.py +++ b/pyload/plugin/account/AlldebridCom.py @@ -24,7 +24,7 @@ class AlldebridCom(Account):          html = req.load("http://www.alldebrid.com/account/")          soup = BeautifulSoup(html) -        #Try to parse expiration date directly from the control panel page (better accuracy) +        # Try to parse expiration date directly from the control panel page (better accuracy)          try:              time_text = soup.find('div', attrs={'class': 'remaining_time_text'}).strong.string @@ -35,7 +35,7 @@ class AlldebridCom(Account):              exp_time = time.time() + int(exp_data[0]) * 24 * 60 * 60 + int(                  exp_data[1]) * 60 * 60 + (int(exp_data[2]) - 1) * 60 -        #Get expiration date from API +        # Get expiration date from API          except Exception:              data = self.getAccountData(user)              html = req.load("http://www.alldebrid.com/api.php", diff --git a/pyload/plugin/account/FileserveCom.py b/pyload/plugin/account/FileserveCom.py index 46cb3cbad..d68285a33 100644 --- a/pyload/plugin/account/FileserveCom.py +++ b/pyload/plugin/account/FileserveCom.py @@ -38,7 +38,7 @@ class FileserveCom(Account):          if not res['type']:              self.wrongPassword() -        #login at fileserv html +        # login at fileserv html          req.load("http://www.fileserve.com/login.php",                   post={"loginUserName": user, "loginUserPassword": data['password'], "autoLogin": "checked",                         "loginFormSubmit": "Login"}) diff --git a/pyload/plugin/account/HellshareCz.py b/pyload/plugin/account/HellshareCz.py index 444677c88..68843ee80 100644 --- a/pyload/plugin/account/HellshareCz.py +++ b/pyload/plugin/account/HellshareCz.py @@ -33,14 +33,14 @@ class HellshareCz(Account):              premium = True              try:                  if "." in credit: -                    #Time-based account +                    # Time-based account                      vt = [int(x) for x in credit.split('.')[:2]]                      lt = time.localtime()                      year = lt.tm_year + int(vt[1] < lt.tm_mon or (vt[1] == lt.tm_mon and vt[0] < lt.tm_mday))                      validuntil = time.mktime(time.strptime("%s%d 23:59:59" % (credit, year), "%d.%m.%Y %H:%M:%S"))                      trafficleft = -1                  else: -                    #Traffic-based account +                    # Traffic-based account                      trafficleft = self.parseTraffic(credit + "MB")                      validuntil = -1              except Exception, e: @@ -54,7 +54,7 @@ class HellshareCz(Account):      def login(self, user, data, req):          html = req.load('http://www.hellshare.com/', decode=True)          if req.lastEffectiveURL != 'http://www.hellshare.com/': -            #Switch to English +            # Switch to English              self.logDebug("Switch lang - URL: %s" % req.lastEffectiveURL)              json = req.load("%s?do=locRouter-show" % req.lastEffectiveURL) diff --git a/pyload/plugin/account/MegaRapidoNet.py b/pyload/plugin/account/MegaRapidoNet.py index 2bffff288..c4ee559da 100644 --- a/pyload/plugin/account/MegaRapidoNet.py +++ b/pyload/plugin/account/MegaRapidoNet.py @@ -29,7 +29,7 @@ class MegaRapidoNet(Account):          validuntil = re.search(self.VALID_UNTIL_PATTERN, html)          if validuntil: -            #hier weitermachen!!! (müssen umbedingt die zeit richtig machen damit! (sollte aber möglich)) +            # hier weitermachen!!! (müssen umbedingt die zeit richtig machen damit! (sollte aber möglich))              validuntil  = time.time() + int(validuntil.group(1)) * 24 * 3600 + int(validuntil.group(2)) * 3600 + int(validuntil.group(3)) * 60 + int(validuntil.group(4))              trafficleft = -1              premium     = True diff --git a/pyload/plugin/account/MegasharesCom.py b/pyload/plugin/account/MegasharesCom.py index 593583a0e..8920bb2db 100644 --- a/pyload/plugin/account/MegasharesCom.py +++ b/pyload/plugin/account/MegasharesCom.py @@ -20,7 +20,7 @@ class MegasharesCom(Account):      def loadAccountInfo(self, user, req): -        #self.relogin(user) +        # self.relogin(user)          html = req.load("http://d01.megashares.com/myms.php", decode=True)          premium = '>Premium Upgrade<' not in html diff --git a/pyload/plugin/account/MultishareCz.py b/pyload/plugin/account/MultishareCz.py index 6d41a2b18..66ab3dd47 100644 --- a/pyload/plugin/account/MultishareCz.py +++ b/pyload/plugin/account/MultishareCz.py @@ -20,7 +20,7 @@ class MultishareCz(Account):      def loadAccountInfo(self, user, req): -        #self.relogin(user) +        # self.relogin(user)          html = req.load("http://www.multishare.cz/profil/", decode=True)          m = re.search(self.TRAFFIC_LEFT_PATTERN, html) diff --git a/pyload/plugin/account/RPNetBiz.py b/pyload/plugin/account/RPNetBiz.py index 2dfce536b..562436e85 100644 --- a/pyload/plugin/account/RPNetBiz.py +++ b/pyload/plugin/account/RPNetBiz.py @@ -26,7 +26,7 @@ class RPNetBiz(Account):                  account_info = {"validuntil": None, "trafficleft": None, "premium": False}          except KeyError: -            #handle wrong password exception +            # handle wrong password exception              account_info = {"validuntil": None, "trafficleft": None, "premium": False}          return account_info diff --git a/pyload/plugin/account/YibaishiwuCom.py b/pyload/plugin/account/YibaishiwuCom.py index 0a15c29de..e12e3f3f2 100644 --- a/pyload/plugin/account/YibaishiwuCom.py +++ b/pyload/plugin/account/YibaishiwuCom.py @@ -19,7 +19,7 @@ class YibaishiwuCom(Account):      def loadAccountInfo(self, user, req): -        #self.relogin(user) +        # self.relogin(user)          html = req.load("http://115.com/", decode=True)          m = re.search(self.ACCOUNT_INFO_PATTERN, html, re.S) diff --git a/pyload/plugin/addon/Checksum.py b/pyload/plugin/addon/Checksum.py index ed50b0f5e..750dd665e 100644 --- a/pyload/plugin/addon/Checksum.py +++ b/pyload/plugin/addon/Checksum.py @@ -105,8 +105,8 @@ class Checksum(Addon):              self.checkFailed(pyfile, None, "No file downloaded")          local_file = fs_encode(pyfile.plugin.lastDownload) -        #download_folder = self.config.get("general", "download_folder") -        #local_file = fs_encode(fs_join(download_folder, pyfile.package().folder, pyfile.name)) +        # download_folder = self.config.get("general", "download_folder") +        # local_file = fs_encode(fs_join(download_folder, pyfile.package().folder, pyfile.name))          if not isfile(local_file):              self.checkFailed(pyfile, None, "File does not exist") diff --git a/pyload/plugin/addon/ExtractArchive.py b/pyload/plugin/addon/ExtractArchive.py index a106d22ab..82938921e 100644 --- a/pyload/plugin/addon/ExtractArchive.py +++ b/pyload/plugin/addon/ExtractArchive.py @@ -9,7 +9,7 @@ import traceback  from copy import copy  # monkey patch bug in python 2.6 and lower -# http://bugs.python.org/issue6122 , http://bugs.python.org/issue1236 , http://bugs.python.org/issue1731717 +# http://bugs.python.org/issue6122, http://bugs.python.org/issue1236, http://bugs.python.org/issue1731717  if sys.version_info < (2, 7) and os.name != "nt":      import errno      import subprocess diff --git a/pyload/plugin/addon/IRCInterface.py b/pyload/plugin/addon/IRCInterface.py index 73998b674..07a07e381 100644 --- a/pyload/plugin/addon/IRCInterface.py +++ b/pyload/plugin/addon/IRCInterface.py @@ -338,7 +338,7 @@ class IRCInterface(Thread, Addon):              if not pack:                  return ["ERROR: Package doesn't exists."] -            #TODO add links +            # TODO add links              return ["INFO: Added %d links to Package %s [#%d]" % (len(links), pack['name'], id)] diff --git a/pyload/plugin/addon/XMPPInterface.py b/pyload/plugin/addon/XMPPInterface.py index c977042e6..5ce5b5e8b 100644 --- a/pyload/plugin/addon/XMPPInterface.py +++ b/pyload/plugin/addon/XMPPInterface.py @@ -135,7 +135,7 @@ class XMPPInterface(IRCInterface, JabberClient):          to_jid = stanza.get_from()          from_jid = stanza.get_to() -        #j = JID() +        # j = JID()          to_name = to_jid.as_utf8()          from_name = from_jid.as_utf8() diff --git a/pyload/plugin/crypter/LinkCryptWs.py b/pyload/plugin/crypter/LinkCryptWs.py index 79a59889a..b26d6830d 100644 --- a/pyload/plugin/crypter/LinkCryptWs.py +++ b/pyload/plugin/crypter/LinkCryptWs.py @@ -74,7 +74,7 @@ class LinkCryptWs(Crypter):          # Get package name and folder          package_name, folder_name = self.getPackageInfo() -        #get the container definitions from script section +        # get the container definitions from script section          self.get_container_html()          # Extract package links diff --git a/pyload/plugin/crypter/MediafireCom.py b/pyload/plugin/crypter/MediafireCom.py index 479d1a70a..aae727a90 100644 --- a/pyload/plugin/crypter/MediafireCom.py +++ b/pyload/plugin/crypter/MediafireCom.py @@ -46,7 +46,7 @@ class MediafireCom(Crypter):                                                       get={'folder_key'     : folder_key,                                                            'response_format': "json",                                                            'version'        : 1})) -                    #self.logInfo(json_resp) +                    # self.logInfo(json_resp)                      if json_resp['response']['result'] == "Success":                          for link in json_resp['response']['folder_info']['files']:                              self.urls.append("http://www.mediafire.com/file/%s" % link['quickkey']) diff --git a/pyload/plugin/extractor/SevenZip.py b/pyload/plugin/extractor/SevenZip.py index 9d01965e0..3c5e86602 100644 --- a/pyload/plugin/extractor/SevenZip.py +++ b/pyload/plugin/extractor/SevenZip.py @@ -134,11 +134,11 @@ class SevenZip(UnRar):      def call_cmd(self, command, *xargs, **kwargs):          args = [] -        #overwrite flag +        # overwrite flag          if self.overwrite:              args.append("-y") -        #set a password +        # set a password          if "password" in kwargs and kwargs['password']:              args.append("-p%s" % kwargs['password'])          else: diff --git a/pyload/plugin/hook/BypassCaptcha.py b/pyload/plugin/hook/BypassCaptcha.py index e3fae426e..554452776 100644 --- a/pyload/plugin/hook/BypassCaptcha.py +++ b/pyload/plugin/hook/BypassCaptcha.py @@ -57,7 +57,7 @@ class BypassCaptcha(Hook):      def submit(self, captcha, captchaType="file", match=None):          req = getRequest() -        #raise timeout threshold +        # raise timeout threshold          req.c.setopt(LOW_SPEED_TIME, 80)          try: diff --git a/pyload/plugin/hook/ExpertDecoders.py b/pyload/plugin/hook/ExpertDecoders.py index 2e2982d2d..843c786bc 100644 --- a/pyload/plugin/hook/ExpertDecoders.py +++ b/pyload/plugin/hook/ExpertDecoders.py @@ -54,7 +54,7 @@ class ExpertDecoders(Hook):              data = f.read()          req = getRequest() -        #raise timeout threshold +        # raise timeout threshold          req.c.setopt(LOW_SPEED_TIME, 80)          try: diff --git a/pyload/plugin/hook/ImageTyperz.py b/pyload/plugin/hook/ImageTyperz.py index 5dadc09f1..6c3c5c84b 100644 --- a/pyload/plugin/hook/ImageTyperz.py +++ b/pyload/plugin/hook/ImageTyperz.py @@ -69,7 +69,7 @@ class ImageTyperz(Hook):      def submit(self, captcha, captchaType="file", match=None):          req = getRequest() -        #raise timeout threshold +        # raise timeout threshold          req.c.setopt(LOW_SPEED_TIME, 80)          try: diff --git a/pyload/plugin/hook/XFileSharingPro.py b/pyload/plugin/hook/XFileSharingPro.py index 3c16c618a..7fee029da 100644 --- a/pyload/plugin/hook/XFileSharingPro.py +++ b/pyload/plugin/hook/XFileSharingPro.py @@ -32,11 +32,11 @@ class XFileSharingPro(Hook):                         "backin.net", "eyesfile.ca", "file4safe.com", "fileband.com", "filedwon.com", "fileparadox.in",                         "filevice.com", "hostingbulk.com", "junkyvideo.com", "linestorage.com", "ravishare.com", "ryushare.com",                         "salefiles.com", "sendmyway.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", -                       #NOT TESTED: +                       # NOT TESTED:                         "101shared.com", "4upfiles.com", "filemaze.ws", "filenuke.com", "linkzhost.com", "mightyupload.com",                         "rockdizfile.com", "sharebeast.com", "sharerepo.com", "shareswift.com", "uploadbaz.com", "uploadc.com",                         "vidbull.com", "zalaa.com", "zomgupload.com", -                       #NOT WORKING: +                       # NOT WORKING:                         "amonshare.com", "banicrazy.info", "boosterking.com", "host4desi.com", "laoupload.com", "rd-fs.com"]      CRYPTER_BUILTIN = ["junocloud.me", "rapidfileshare.net"] diff --git a/pyload/plugin/hoster/BezvadataCz.py b/pyload/plugin/hoster/BezvadataCz.py index 3eab28ae6..fa29c83d5 100644 --- a/pyload/plugin/hoster/BezvadataCz.py +++ b/pyload/plugin/hoster/BezvadataCz.py @@ -29,13 +29,13 @@ class BezvadataCz(SimpleHoster):      def handleFree(self, pyfile): -        #download button +        # download button          m = re.search(r'<a class="stahnoutSoubor".*?href="(.*?)"', self.html)          if m is None:              self.error(_("Page 1 URL not found"))          url = "http://bezvadata.cz%s" % m.group(1) -        #captcha form +        # captcha form          self.html = self.load(url)          self.checkErrors()          for _i in xrange(5): @@ -47,7 +47,7 @@ class BezvadataCz(SimpleHoster):              if m is None:                  self.error(_("Wrong captcha image")) -            #captcha image is contained in html page as base64encoded data but decryptCaptcha() expects image url +            # captcha image is contained in html page as base64encoded data but decryptCaptcha() expects image url              self.load, proper_load = self.loadcaptcha, self.load              try:                  inputs['captcha'] = self.decryptCaptcha(m.group(1), imgtype='png') @@ -62,7 +62,7 @@ class BezvadataCz(SimpleHoster):          else:              self.fail(_("No valid captcha code entered")) -        #download url +        # download url          self.html = self.load("http://bezvadata.cz%s" % action, post=inputs)          self.checkErrors()          m = re.search(r'<a class="stahnoutSoubor2" href="(.*?)">', self.html) @@ -71,7 +71,7 @@ class BezvadataCz(SimpleHoster):          url = "http://bezvadata.cz%s" % m.group(1)          self.logDebug("DL URL %s" % url) -        #countdown +        # countdown          m = re.search(r'id="countdown">(\d\d):(\d\d)<', self.html)          wait_time = (int(m.group(1)) * 60 + int(m.group(2))) if m else 120          self.wait(wait_time, False) diff --git a/pyload/plugin/hoster/DlFreeFr.py b/pyload/plugin/hoster/DlFreeFr.py index 151d0ca9f..684da2b6d 100644 --- a/pyload/plugin/hoster/DlFreeFr.py +++ b/pyload/plugin/hoster/DlFreeFr.py @@ -117,7 +117,7 @@ class DlFreeFr(SimpleHoster):      def getLastHeaders(self): -        #parse header +        # parse header          header = {"code": self.req.code}          for line in self.req.http.header.splitlines():              line = line.strip() diff --git a/pyload/plugin/hoster/FilesMailRu.py b/pyload/plugin/hoster/FilesMailRu.py index 024da64cd..0d7f47536 100644 --- a/pyload/plugin/hoster/FilesMailRu.py +++ b/pyload/plugin/hoster/FilesMailRu.py @@ -49,17 +49,17 @@ class FilesMailRu(Hoster):          self.html = self.load(pyfile.url)          self.url_pattern = '<a href="(.+?)" onclick="return Act\(this\, \'dlink\'\, event\)">(.+?)</a>' -        #marks the file as "offline" when the pattern was found on the html-page''' +        # marks the file as "offline" when the pattern was found on the html-page'''          if r'<div class="errorMessage mb10">' in self.html:              self.offline()          elif r'Page cannot be displayed' in self.html:              self.offline() -        #the filename that will be showed in the list (e.g. test.part1.rar)''' +        # the filename that will be showed in the list (e.g. test.part1.rar)'''          pyfile.name = self.getFileName() -        #prepare and download''' +        # prepare and download'''          if not self.account:              self.prepare()              self.download(self.getFileUrl()) diff --git a/pyload/plugin/hoster/FileserveCom.py b/pyload/plugin/hoster/FileserveCom.py index a7bb22440..686bff101 100644 --- a/pyload/plugin/hoster/FileserveCom.py +++ b/pyload/plugin/hoster/FileserveCom.py @@ -185,7 +185,7 @@ class FileserveCom(Hoster):      def handlePremium(self, pyfile):          premium_url = None          if self.__class__.__name__ == "FileserveCom": -            #try api download +            # try api download              res = self.load("http://app.fileserve.com/api/download/premium/",                              post={"username": self.user,                                    "password": self.account.getAccountData(self.user)['password'], diff --git a/pyload/plugin/hoster/FreakshareCom.py b/pyload/plugin/hoster/FreakshareCom.py index 64d8f8308..1b1d25826 100644 --- a/pyload/plugin/hoster/FreakshareCom.py +++ b/pyload/plugin/hoster/FreakshareCom.py @@ -98,8 +98,8 @@ class FreakshareCom(Hoster):              self.download_html()          if not self.wantReconnect:              self.req_opts = self.get_download_options()  # get the Post options for the Request -            #file_url = self.pyfile.url -            #return file_url +            # file_url = self.pyfile.url +            # return file_url          else:              self.offline() diff --git a/pyload/plugin/hoster/Ftp.py b/pyload/plugin/hoster/Ftp.py index 42ef3c357..4f6a01d22 100644 --- a/pyload/plugin/hoster/Ftp.py +++ b/pyload/plugin/hoster/Ftp.py @@ -64,7 +64,7 @@ class Ftp(Hoster):              pyfile.size = int(m.group(1))              self.download(pyfile.url)          else: -            #Naive ftp directory listing +            # Naive ftp directory listing              if re.search(r'^25\d.*?"', self.req.http.header, re.M):                  pyfile.url = pyfile.url.rstrip('/')                  pkgname = "/".join(pyfile.package().name, urlparse(pyfile.url).path.rpartition('/')[2]) diff --git a/pyload/plugin/hoster/NetloadIn.py b/pyload/plugin/hoster/NetloadIn.py index 51bc2a600..a3d0b44b1 100644 --- a/pyload/plugin/hoster/NetloadIn.py +++ b/pyload/plugin/hoster/NetloadIn.py @@ -120,7 +120,7 @@ class NetloadIn(Hoster):          match    = id_regex.search(url)          if match: -            #normalize url +            # normalize url              self.url = 'http://www.netload.in/datei%s.htm' % match.group('ID')              self.logDebug("URL: %s" % self.url)          else: diff --git a/pyload/plugin/hoster/PremiumTo.py b/pyload/plugin/hoster/PremiumTo.py index c7ee09565..750e965d2 100644 --- a/pyload/plugin/hoster/PremiumTo.py +++ b/pyload/plugin/hoster/PremiumTo.py @@ -27,7 +27,7 @@ class PremiumTo(MultiHoster):      def handlePremium(self, pyfile): -        #raise timeout to 2min +        # raise timeout to 2min          self.download("http://premium.to/api/getfile.php",                        get={'username': self.account.username,                             'password': self.account.password, diff --git a/pyload/plugin/hoster/ShareplaceCom.py b/pyload/plugin/hoster/ShareplaceCom.py index 7d9630d20..08fb966b8 100644 --- a/pyload/plugin/hoster/ShareplaceCom.py +++ b/pyload/plugin/hoster/ShareplaceCom.py @@ -40,7 +40,7 @@ class ShareplaceCom(Hoster):          if not self.html:              self.download_html() -        #var zzipitime = 15; +        # var zzipitime = 15;          m = re.search(r'var zzipitime = (\d+);', self.html)          if m:              sec = int(m.group(1)) diff --git a/pyload/plugin/hoster/SimplydebridCom.py b/pyload/plugin/hoster/SimplydebridCom.py index 2fa68b508..d703c3e52 100644 --- a/pyload/plugin/hoster/SimplydebridCom.py +++ b/pyload/plugin/hoster/SimplydebridCom.py @@ -19,7 +19,7 @@ class SimplydebridCom(MultiHoster):      def handlePremium(self, pyfile): -        #fix the links for simply-debrid.com! +        # fix the links for simply-debrid.com!          self.link = replace_patterns(pyfile.url, [("clz.to", "cloudzer.net/file")                                                    ("http://share-online", "http://www.share-online")                                                    ("ul.to", "uploaded.net/file") diff --git a/pyload/plugin/hoster/YourfilesTo.py b/pyload/plugin/hoster/YourfilesTo.py index a3d5e310c..f5e778741 100644 --- a/pyload/plugin/hoster/YourfilesTo.py +++ b/pyload/plugin/hoster/YourfilesTo.py @@ -41,7 +41,7 @@ class YourfilesTo(Hoster):          if not self.html:              self.download_html() -        #var zzipitime = 15; +        # var zzipitime = 15;          m = re.search(r'var zzipitime = (\d+);', self.html)          if m:              sec = int(m.group(1)) diff --git a/pyload/plugin/hoster/YoutubeCom.py b/pyload/plugin/hoster/YoutubeCom.py index 14503be03..5db9957f8 100644 --- a/pyload/plugin/hoster/YoutubeCom.py +++ b/pyload/plugin/hoster/YoutubeCom.py @@ -94,7 +94,7 @@ class YoutubeCom(Hoster):          if "We have been receiving a large volume of requests from your network." in html:              self.tempOffline() -        #get config +        # get config          use3d = self.getConfig('3d')          if use3d: @@ -113,7 +113,7 @@ class YoutubeCom(Hoster):              self.logWarning(_("FMT %d unknown, using default") % desired_fmt)              desired_fmt = 0 -        #parse available streams +        # parse available streams          streams = re.search(r'"url_encoded_fmt_stream_map":"(.+?)",', html).group(1)          streams = [x.split('\u0026') for x in streams.split(',')]          streams = [dict((y.split('=', 1)) for y in x) for x in streams] @@ -123,7 +123,7 @@ class YoutubeCom(Hoster):          self.logDebug("AVAILABLE STREAMS: %s" % [x[0] for x in streams]) -        #build dictionary of supported itags (3D/2D) +        # build dictionary of supported itags (3D/2D)          allowed = lambda x: self.getConfig(self.formats[x][0])          streams = [x for x in streams if x[0] in self.formats and allowed(x[0])] @@ -136,11 +136,11 @@ class YoutubeCom(Hoster):                        (desired_fmt, "%s %dx%d Q:%d 3D:%s" % self.formats[desired_fmt],                         "" if desired_fmt in fmt_dict else "NOT ", "" if allowed(desired_fmt) else "NOT ")) -        #return fmt nearest to quality index +        # return fmt nearest to quality index          if desired_fmt in fmt_dict and allowed(desired_fmt):              fmt = desired_fmt          else: -            sel  = lambda x: self.formats[x][3]  # select quality index +            sel  = lambda x: self.formats[x][3]  #: select quality index              comp = lambda x, y: abs(sel(x) - sel(y))              self.logDebug("Choosing nearest fmt: %s" % [(x, allowed(x), comp(x, desired_fmt)) for x in fmt_dict.keys()]) @@ -154,7 +154,7 @@ class YoutubeCom(Hoster):          self.logDebug("URL: %s" % url) -        #set file name +        # set file name          file_suffix = self.formats[fmt][0] if fmt in self.formats else ".flv"          file_name_pattern = '<meta name="title" content="(.+?)">'          name = re.search(file_name_pattern, html).group(1).replace("/", "") diff --git a/pyload/plugin/ocr/ShareonlineBiz.py b/pyload/plugin/ocr/ShareonlineBiz.py index b07653279..8efbdee35 100644 --- a/pyload/plugin/ocr/ShareonlineBiz.py +++ b/pyload/plugin/ocr/ShareonlineBiz.py @@ -23,8 +23,8 @@ class ShareonlineBiz(OCR):          self.image = self.image.resize((160, 50))          self.pixels = self.image.load()          self.threshold(1.85) -        #self.eval_black_white(240) -        #self.derotate_by_average() +        # self.eval_black_white(240) +        # self.derotate_by_average()          letters = self.split_captcha_letters() @@ -36,4 +36,4 @@ class ShareonlineBiz(OCR):          return final -        #tesseract at 60% +        # tesseract at 60% | 
