diff options
27 files changed, 43 insertions, 43 deletions
| diff --git a/module/plugins/accounts/AlldebridCom.py b/module/plugins/accounts/AlldebridCom.py index 1f2371e28..c830f0c09 100644 --- a/module/plugins/accounts/AlldebridCom.py +++ b/module/plugins/accounts/AlldebridCom.py @@ -37,7 +37,7 @@ class AlldebridCom(Account):                  exp_data[1]) * 60 * 60 + (int(exp_data[2]) - 1) * 60          #Get expiration date from API -        except: +        except Exception:              data = self.getAccountData(user)              html = req.load("http://www.alldebrid.com/api.php",                              get={'action': "info_user", 'login': user, 'pw': data['password']}) diff --git a/module/plugins/accounts/CatShareNet.py b/module/plugins/accounts/CatShareNet.py index bcb14bee3..90cdfe013 100644 --- a/module/plugins/accounts/CatShareNet.py +++ b/module/plugins/accounts/CatShareNet.py @@ -31,7 +31,7 @@ class CatShareNet(Account):              m = re.search(self.PREMIUM_PATTERN, html)              if "Premium" in m.group(1):                  premium = True -        except: +        except Exception:              pass          try: @@ -39,7 +39,7 @@ class CatShareNet(Account):              expiredate = m.group(1)              if "-" not in expiredate:                  validuntil = mktime(strptime(expiredate, "%d.%m.%Y")) -        except: +        except Exception:              pass          return {'premium': premium, 'trafficleft': -1, 'validuntil': validuntil} diff --git a/module/plugins/accounts/NoPremiumPl.py b/module/plugins/accounts/NoPremiumPl.py index f2223b7d9..a36b114eb 100644 --- a/module/plugins/accounts/NoPremiumPl.py +++ b/module/plugins/accounts/NoPremiumPl.py @@ -35,7 +35,7 @@ class NoPremiumPl(Account):          self._req = req          try:              result = loads(self.runAuthQuery()) -        except: +        except Exception:              # todo: return or let it be thrown?              return @@ -60,7 +60,7 @@ class NoPremiumPl(Account):          try:              response = loads(self.runAuthQuery()) -        except: +        except Exception:              self.wrongPassword()          if "errno" in response.keys(): diff --git a/module/plugins/accounts/RapideoPl.py b/module/plugins/accounts/RapideoPl.py index 438ce7ad3..426c680a6 100644 --- a/module/plugins/accounts/RapideoPl.py +++ b/module/plugins/accounts/RapideoPl.py @@ -35,7 +35,7 @@ class RapideoPl(Account):          self._req = req          try:              result = loads(self.runAuthQuery()) -        except: +        except Exception:              # todo: return or let it be thrown?              return @@ -59,7 +59,7 @@ class RapideoPl(Account):          self._req = req          try:              response = loads(self.runAuthQuery()) -        except: +        except Exception:              self.wrongPassword()          if "errno" in response.keys(): diff --git a/module/plugins/accounts/RehostTo.py b/module/plugins/accounts/RehostTo.py index 897f888b0..04e71c9ad 100644 --- a/module/plugins/accounts/RehostTo.py +++ b/module/plugins/accounts/RehostTo.py @@ -18,13 +18,13 @@ class RehostTo(Account):          trafficleft = None          validuntil  = -1          session     = "" -         +          html = req.load("http://rehost.to/api.php",                          get={'cmd' : "login", 'user': user,                               'pass': self.getAccountData(user)['password']})          try:              session = html.split(",")[1].split("=")[1] -         +              html = req.load("http://rehost.to/api.php",                              get={'cmd': "get_premium_credits", 'long_ses': session}) @@ -32,11 +32,11 @@ class RehostTo(Account):                  self.logDebug(html)              else:                  traffic, valid = html.split(",") -                 +                  premium     = True                  trafficleft = self.parseTraffic(traffic + "MB")                  validuntil  = float(valid) -         +          finally:              return {'premium'    : premium,                      'trafficleft': trafficleft, diff --git a/module/plugins/captcha/LinksaveIn.py b/module/plugins/captcha/LinksaveIn.py index 56cbd58a0..de6b0e7ff 100644 --- a/module/plugins/captcha/LinksaveIn.py +++ b/module/plugins/captcha/LinksaveIn.py @@ -79,7 +79,7 @@ class LinksaveIn(OCR):                      rgb_c = lut[pix[x, y]]                      try:                          cstat[rgb_c] += 1 -                    except: +                    except Exception:                          cstat[rgb_c] = 1                      if rgb_bg == rgb_c:                          stat[bgpath] += 1 diff --git a/module/plugins/captcha/captcha.py b/module/plugins/captcha/captcha.py index 0f233ec00..e89ec2e81 100644 --- a/module/plugins/captcha/captcha.py +++ b/module/plugins/captcha/captcha.py @@ -102,7 +102,7 @@ class OCR(object):          try:              with open(tmpTxt.name, 'r') as f:                  self.result_captcha = f.read().replace("\n", "") -        except: +        except Exception:              self.result_captcha = ""          self.logger.debug(self.result_captcha) @@ -111,7 +111,7 @@ class OCR(object):              os.remove(tmpTxt.name)              if subset and (digits or lowercase or uppercase):                  os.remove(tmpSub.name) -        except: +        except Exception:              pass @@ -166,7 +166,7 @@ class OCR(object):                          count += 1                      if pixels[x, y-1] != 255:                          count += 1 -                except: +                except Exception:                      pass          # not enough neighbors are dark pixels so mark this pixel diff --git a/module/plugins/container/LinkList.py b/module/plugins/container/LinkList.py index c6173ad73..69461249e 100644 --- a/module/plugins/container/LinkList.py +++ b/module/plugins/container/LinkList.py @@ -23,7 +23,7 @@ class LinkList(Container):      def decrypt(self, pyfile):          try:              file_enc = codecs.lookup(self.getConfig("encoding")).name -        except: +        except Exception:              file_enc = "utf-8"          file_name = fs_encode(pyfile.url) @@ -64,7 +64,7 @@ class LinkList(Container):              try:                  txt = open(file_name, 'wb')                  txt.close() -            except: +            except Exception:                  self.logWarning(_("LinkList could not be cleared"))          for name, links in packages.iteritems(): diff --git a/module/plugins/crypter/ChipDe.py b/module/plugins/crypter/ChipDe.py index 133e5a005..2fc36c355 100644 --- a/module/plugins/crypter/ChipDe.py +++ b/module/plugins/crypter/ChipDe.py @@ -22,7 +22,7 @@ class ChipDe(Crypter):          self.html = self.load(pyfile.url)          try:              f = re.search(r'"(http://video\.chip\.de/.+)"', self.html) -        except: +        except Exception:              self.fail(_("Failed to find the URL"))          else:              self.urls = [f.group(1)] diff --git a/module/plugins/crypter/Go4UpCom.py b/module/plugins/crypter/Go4UpCom.py index 102bc32b5..a7e16c0ab 100644 --- a/module/plugins/crypter/Go4UpCom.py +++ b/module/plugins/crypter/Go4UpCom.py @@ -40,7 +40,7 @@ class Go4UpCom(SimpleCrypter):          for html in pages:              try:                  links.append(re.search(r'<b><a href="(.+?)"', html).group(1)) -            except: +            except Exception:                  continue          return links diff --git a/module/plugins/crypter/LinkCryptWs.py b/module/plugins/crypter/LinkCryptWs.py index 996a92c7b..c67372e3d 100644 --- a/module/plugins/crypter/LinkCryptWs.py +++ b/module/plugins/crypter/LinkCryptWs.py @@ -279,7 +279,7 @@ class LinkCryptWs(Crypter):              (vcrypted, vjk) = self._getCipherParams(cnl_section)              for (crypted, jk) in zip(vcrypted, vjk):                  package_links.extend(self._getLinks(crypted, jk)) -        except: +        except Exception:              self.logError(_("Unable to decrypt CNL links (JS Error) try to get over links"))              return self.handleWebLinks() diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index 8b7214157..7c881ce75 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -229,7 +229,7 @@ class NCryptIn(Crypter):                  (vcrypted, vjk) = self._getCipherParams()                  for (crypted, jk) in zip(vcrypted, vjk):                      package_links.extend(self._getLinks(crypted, jk)) -            except: +            except Exception:                  self.fail(_("Unable to decrypt CNL2 links"))          return package_links diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py index c5a3f1011..0fd80d593 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -204,7 +204,7 @@ class RelinkUs(Crypter):                  (vcrypted, vjk) = self._getCipherParams(cnl2_form)                  for (crypted, jk) in zip(vcrypted, vjk):                      package_links.extend(self._getLinks(crypted, jk)) -            except: +            except Exception:                  self.logDebug("Unable to decrypt CNL2 links")          return package_links @@ -223,7 +223,7 @@ class RelinkUs(Crypter):                  with open(dlc_filepath, "wb") as f:                      f.write(dlc)                  package_links.append(dlc_filepath) -            except: +            except Exception:                  self.fail("Unable to download DLC container")          return package_links diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py index d2e8138f6..df53b5879 100644 --- a/module/plugins/crypter/ShareLinksBiz.py +++ b/module/plugins/crypter/ShareLinksBiz.py @@ -235,7 +235,7 @@ class ShareLinksBiz(Crypter):              try:                  (crypted, jk) = self._getCipherParams()                  package_links.extend(self._getLinks(crypted, jk)) -            except: +            except Exception:                  self.fail(_("Unable to decrypt CNL2 links"))          return package_links diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index fc0cae44f..f4d2cb69c 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -59,7 +59,7 @@ class ExternalScripts(Hook):          if not exists(path):              try:                  makedirs(path) -            except: +            except Exception:                  self.logDebug("Script folder %s not created" % folder)                  return diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index efd4e411d..98fa1d030 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -61,7 +61,7 @@ class IRCInterface(Thread, Hook):          try:              if self.getConfig("info_pack"):                  self.response(_("Package finished: %s") % pypack.name) -        except: +        except Exception:              pass @@ -70,7 +70,7 @@ class IRCInterface(Thread, Hook):              if self.getConfig("info_file"):                  self.response(                      _("Download finished: %(name)s @ %(plugin)s ") % {"name": pyfile.name, "plugin": pyfile.pluginname}) -        except: +        except Exception:              pass @@ -183,7 +183,7 @@ class IRCInterface(Thread, Hook):              trigger = temp[0]              if len(temp) > 1:                  args = temp[1:] -        except: +        except Exception:              pass          handler = getattr(self, "event_%s" % trigger, self.event_pass) @@ -347,7 +347,7 @@ class IRCInterface(Thread, Hook):              return ["INFO: Added %d links to Package %s [#%d]" % (len(links), pack['name'], id)] -        except: +        except Exception:              # create new package              id = self.core.api.addPackage(pack, links, 1)              return ["INFO: Created new Package %s [#%d] with %d links." % (pack, id, len(links))] diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py index d448d1be9..768129e4a 100644 --- a/module/plugins/hooks/ImageTyperz.py +++ b/module/plugins/hooks/ImageTyperz.py @@ -69,7 +69,7 @@ class ImageTyperz(Hook):          try:              balance = float(res) -        except: +        except Exception:              raise ImageTyperzException("Invalid response")          self.logInfo(_("Account balance: $%s left") % res) diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index c72699228..03b9ba6a4 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -117,7 +117,7 @@ class UpdateManager(Hook):      def server_request(self):          try:              return getURL(self.SERVER_URL, get={'v': self.core.api.getServerVersion()}).splitlines() -        except: +        except Exception:              self.logWarning(_("Unable to contact server to get updates")) @@ -192,7 +192,7 @@ class UpdateManager(Hook):              # Protect UpdateManager from self-removing              try:                  blacklisted.remove(("hook", "UpdateManager")) -            except: +            except Exception:                  pass              for t, n in blacklisted: diff --git a/module/plugins/hooks/XMPPInterface.py b/module/plugins/hooks/XMPPInterface.py index bbeab4341..b8e9fc1ad 100644 --- a/module/plugins/hooks/XMPPInterface.py +++ b/module/plugins/hooks/XMPPInterface.py @@ -69,7 +69,7 @@ class XMPPInterface(IRCInterface, JabberClient):          try:              if self.getConfig("info_pack"):                  self.announce(_("Package finished: %s") % pypack.name) -        except: +        except Exception:              pass @@ -78,7 +78,7 @@ class XMPPInterface(IRCInterface, JabberClient):              if self.getConfig("info_file"):                  self.announce(                      _("Download finished: %(name)s @ %(plugin)s") % {"name": pyfile.name, "plugin": pyfile.pluginname}) -        except: +        except Exception:              pass @@ -152,7 +152,7 @@ class XMPPInterface(IRCInterface, JabberClient):                  trigger = temp[0]                  if len(temp) > 1:                      args = temp[1:] -            except: +            except Exception:                  pass              handler = getattr(self, "event_%s" % trigger, self.event_pass) diff --git a/module/plugins/hoster/DepositfilesCom.py b/module/plugins/hoster/DepositfilesCom.py index 9d060e75d..6e7f2909c 100644 --- a/module/plugins/hoster/DepositfilesCom.py +++ b/module/plugins/hoster/DepositfilesCom.py @@ -95,7 +95,7 @@ class DepositfilesCom(SimpleHoster):          try:              self.download(link, disposition=True) -        except: +        except Exception:              self.retry(wait_time=60) diff --git a/module/plugins/hoster/FilesMailRu.py b/module/plugins/hoster/FilesMailRu.py index 18fca7176..7bd099282 100644 --- a/module/plugins/hoster/FilesMailRu.py +++ b/module/plugins/hoster/FilesMailRu.py @@ -21,7 +21,7 @@ def getInfo(urls):                      url_pattern = '<a href="(.+?)" onclick="return Act\(this\, \'dlink\'\, event\)">(.+?)</a>'                      file_name = re.search(url_pattern, html).group(0).split(', event)">')[1].split('</a>')[0]                      result.append((file_name, 0, 2, url)) -                except: +                except Exception:                      pass          # status 1=OFFLINE, 2=OK, 3=UNKNOWN diff --git a/module/plugins/hoster/FourSharedCom.py b/module/plugins/hoster/FourSharedCom.py index 78aeece44..a3f53ac5e 100644 --- a/module/plugins/hoster/FourSharedCom.py +++ b/module/plugins/hoster/FourSharedCom.py @@ -53,7 +53,7 @@ class FourSharedCom(SimpleHoster):              m = re.search(self.ID_PATTERN, self.html)              res = self.load('http://www.4shared.com/web/d2/getFreeDownloadLimitInfo?fileId=%s' % m.group(1))              self.logDebug(res) -        except: +        except Exception:              pass          self.wait(20) diff --git a/module/plugins/hoster/Ftp.py b/module/plugins/hoster/Ftp.py index 8562778c4..22fc5f67a 100644 --- a/module/plugins/hoster/Ftp.py +++ b/module/plugins/hoster/Ftp.py @@ -35,7 +35,7 @@ class Ftp(Hoster):          pyfile.name = parsed_url.path.rpartition('/')[2]          try:              pyfile.name = unquote(str(pyfile.name)).decode('utf8') -        except: +        except Exception:              pass          if not "@" in netloc: diff --git a/module/plugins/hoster/MediafireCom.py b/module/plugins/hoster/MediafireCom.py index 81bd36f73..d404498f3 100644 --- a/module/plugins/hoster/MediafireCom.py +++ b/module/plugins/hoster/MediafireCom.py @@ -33,7 +33,7 @@ def checkHTMLHeader(url):                      return url, 2              else:                  break -    except: +    except Exception:          return url, 3      else:          return url, 0 diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py index 636e5824d..5918726f5 100644 --- a/module/plugins/hoster/ShareonlineBiz.py +++ b/module/plugins/hoster/ShareonlineBiz.py @@ -164,7 +164,7 @@ class ShareonlineBiz(SimpleHoster):          try:              self.logError(errmsg, re.search(self.ERROR_PATTERN, self.html).group(1)) -        except: +        except Exception:              self.logError("Unknown error occurred", errmsg)          if errmsg is "invalid": diff --git a/module/plugins/hoster/YibaishiwuCom.py b/module/plugins/hoster/YibaishiwuCom.py index adc403de4..cf1550ebc 100644 --- a/module/plugins/hoster/YibaishiwuCom.py +++ b/module/plugins/hoster/YibaishiwuCom.py @@ -50,7 +50,7 @@ class YibaishiwuCom(SimpleHoster):                  self.logDebug("Trying URL: " + url)                  self.download(url)                  break -            except: +            except Exception:                  continue          else:              self.fail(_("No working link found")) diff --git a/module/plugins/internal/UnRar.py b/module/plugins/internal/UnRar.py index 572fe95b9..296405101 100644 --- a/module/plugins/internal/UnRar.py +++ b/module/plugins/internal/UnRar.py @@ -16,7 +16,7 @@ def renice(pid, value):      if os.name != "nt" and value:          try:              Popen(["renice", str(value), str(pid)], stdout=PIPE, stderr=PIPE, bufsize=-1) -        except: +        except Exception:              print "Renice failed" | 
