diff options
Diffstat (limited to 'module/plugins')
42 files changed, 71 insertions, 38 deletions
diff --git a/module/plugins/accounts/HellshareCz.py b/module/plugins/accounts/HellshareCz.py index f48328ae9..404caba7a 100644 --- a/module/plugins/accounts/HellshareCz.py +++ b/module/plugins/accounts/HellshareCz.py @@ -44,6 +44,7 @@ class HellshareCz(Account): #: Traffic-based account trafficleft = self.parse_traffic(credit + "MB") validuntil = -1 + except Exception, e: self.log_error(_("Unable to parse credit info"), e) validuntil = -1 diff --git a/module/plugins/accounts/MegasharesCom.py b/module/plugins/accounts/MegasharesCom.py index bad3f5896..66db57814 100644 --- a/module/plugins/accounts/MegasharesCom.py +++ b/module/plugins/accounts/MegasharesCom.py @@ -31,6 +31,7 @@ class MegasharesCom(Account): timestr = re.search(self.VALID_UNTIL_PATTERN, html).group(1) self.log_debug(timestr) validuntil = time.mktime(time.strptime(timestr, "%b %d, %Y")) + except Exception, e: self.log_error(e) diff --git a/module/plugins/accounts/NitroflareCom.py b/module/plugins/accounts/NitroflareCom.py index 58646dfdb..e2408c195 100644 --- a/module/plugins/accounts/NitroflareCom.py +++ b/module/plugins/accounts/NitroflareCom.py @@ -40,6 +40,7 @@ class NitroflareCom(Account): try: validuntil = sum(int(v) * {'day': 24 * 3600, 'hour': 3600, 'minute': 60}[u.lower()] for v, u in re.findall(r'(\d+)\s*(day|hour|minute)', expiredate, re.I)) + except Exception, e: self.log_error(e) diff --git a/module/plugins/accounts/NoPremiumPl.py b/module/plugins/accounts/NoPremiumPl.py index 79369e105..3d6d6496b 100644 --- a/module/plugins/accounts/NoPremiumPl.py +++ b/module/plugins/accounts/NoPremiumPl.py @@ -36,6 +36,7 @@ class NoPremiumPl(Account): self._req = req try: result = json_loads(self.run_auth_query()) + except Exception: #@TODO: return or let it be thrown? return @@ -61,6 +62,7 @@ class NoPremiumPl(Account): try: response = json_loads(self.run_auth_query()) + except Exception: self.fail_login() diff --git a/module/plugins/accounts/OneFichierCom.py b/module/plugins/accounts/OneFichierCom.py index 795d2335d..59fd87f51 100644 --- a/module/plugins/accounts/OneFichierCom.py +++ b/module/plugins/accounts/OneFichierCom.py @@ -36,6 +36,7 @@ class OneFichierCom(Account): try: validuntil = time.mktime(time.strptime(expiredate, "%Y-%m-%d")) + except Exception, e: self.log_error(e) else: diff --git a/module/plugins/accounts/RapideoPl.py b/module/plugins/accounts/RapideoPl.py index f7c6a4af3..6a9ca5e01 100644 --- a/module/plugins/accounts/RapideoPl.py +++ b/module/plugins/accounts/RapideoPl.py @@ -36,6 +36,7 @@ class RapideoPl(Account): self._req = req try: result = json_loads(self.run_auth_query()) + except Exception: #@TODO: return or let it be thrown? return @@ -61,6 +62,7 @@ class RapideoPl(Account): try: response = json_loads(self.run_auth_query()) + except Exception: self.fail_login() diff --git a/module/plugins/captcha/LinksaveIn.py b/module/plugins/captcha/LinksaveIn.py index 4d2e2bc34..a9ccecf3c 100644 --- a/module/plugins/captcha/LinksaveIn.py +++ b/module/plugins/captcha/LinksaveIn.py @@ -79,8 +79,10 @@ class LinksaveIn(OCR): rgb_c = lut[pix[x, y]] try: cstat[rgb_c] += 1 + except Exception: cstat[rgb_c] = 1 + if rgb_bg is rgb_c: stat[bgpath] += 1 max_p = 0 diff --git a/module/plugins/crypter/ChipDe.py b/module/plugins/crypter/ChipDe.py index 3604635e5..8d823d88d 100644 --- a/module/plugins/crypter/ChipDe.py +++ b/module/plugins/crypter/ChipDe.py @@ -23,8 +23,10 @@ class ChipDe(Crypter): self.html = self.load(pyfile.url) try: f = re.search(r'"(http://video\.chip\.de/.+)"', self.html) + except Exception: self.fail(_("Failed to find the URL")) + else: self.urls = [f.group(1)] self.log_debug("The file URL is %s" % self.urls[0]) diff --git a/module/plugins/crypter/CloudzillaToFolder.py b/module/plugins/crypter/CloudzillaToFolder.py index ff58f954c..6c8ce5917 100644 --- a/module/plugins/crypter/CloudzillaToFolder.py +++ b/module/plugins/crypter/CloudzillaToFolder.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- import re -import urlparse from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo diff --git a/module/plugins/crypter/LinkCryptWs.py b/module/plugins/crypter/LinkCryptWs.py index 16ee1d4f1..47ea461f1 100644 --- a/module/plugins/crypter/LinkCryptWs.py +++ b/module/plugins/crypter/LinkCryptWs.py @@ -272,6 +272,7 @@ class LinkCryptWs(Crypter): (vcrypted, vjk) = self._get_cipher_params(cnl_section) for (crypted, jk) in zip(vcrypted, vjk): package_links.extend(self._get_links(crypted, jk)) + except Exception: self.log_error(_("Unable to decrypt CNL links (JS Error) try to get over links")) return self.handle_web_links() diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index d483be323..32c9283f7 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -229,6 +229,7 @@ class NCryptIn(Crypter): (vcrypted, vjk) = self._get_cipher_params() for (crypted, jk) in zip(vcrypted, vjk): package_links.extend(self._get_links(crypted, jk)) + except Exception: self.fail(_("Unable to decrypt CNL2 links")) @@ -270,6 +271,7 @@ class NCryptIn(Crypter): url = link.replace("link-", "frame-") link = self.load(url, just_header=True)['location'] return link + except Exception, detail: self.log_debug("Error decrypting link %s, %s" % (link, detail)) diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py index b3c13db5d..641353865 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -205,8 +205,10 @@ class RelinkUs(Crypter): (vcrypted, vjk) = self._get_cipher_params(cnl2_form) for (crypted, jk) in zip(vcrypted, vjk): package_links.extend(self._get_links(crypted, jk)) + except Exception: self.log_debug("Unable to decrypt CNL2 links") + return package_links diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py index 712b4fff2..2e9abff61 100644 --- a/module/plugins/crypter/ShareLinksBiz.py +++ b/module/plugins/crypter/ShareLinksBiz.py @@ -216,8 +216,10 @@ class ShareLinksBiz(Crypter): self.log_debug("JsEngine returns value [%s] for redirection link" % dlLink) package_links.append(dlLink) + except Exception, detail: self.log_debug("Error decrypting Web link [%s], %s" % (ID, detail)) + return package_links @@ -242,8 +244,10 @@ class ShareLinksBiz(Crypter): try: (crypted, jk) = self._get_cipher_params() package_links.extend(self._get_links(crypted, jk)) + except Exception: self.fail(_("Unable to decrypt CNL2 links")) + return package_links diff --git a/module/plugins/crypter/UploadedToFolder.py b/module/plugins/crypter/UploadedToFolder.py index 381d744fe..53fb5e4b9 100644 --- a/module/plugins/crypter/UploadedToFolder.py +++ b/module/plugins/crypter/UploadedToFolder.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- import re -import urlparse from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py index 0df1ab8a9..838c220f0 100644 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ b/module/plugins/hooks/CaptchaBrotherhood.py @@ -79,6 +79,7 @@ class CaptchaBrotherhood(Hook): img.save(output, "JPEG") data = output.getvalue() output.close() + except Exception, e: raise CaptchaBrotherhoodException("Reading or converting captcha image failed: %s" % e) @@ -98,6 +99,7 @@ class CaptchaBrotherhood(Hook): try: req.c.perform() res = req.getResponse() + except Exception, e: raise CaptchaBrotherhoodException("Submit captcha image failed") diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 469f73141..7d3d9237e 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -66,6 +66,7 @@ class ArchiveQueue(object): def get(self): try: return [int(pid) for pid in self.plugin.retrieve("ExtractArchive:%s" % self.storage, "").decode('base64').split()] + except Exception: return [] diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index 5d8928a57..020939805 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -55,6 +55,7 @@ class IRCInterface(Thread, Addon): try: if self.get_config('info_pack'): self.response(_("Package finished: %s") % pypack.name) + except Exception: pass @@ -64,6 +65,7 @@ class IRCInterface(Thread, Addon): if self.get_config('info_file'): self.response( _("Download finished: %(name)s @ %(plugin)s ") % {'name': pyfile.name, 'plugin': pyfile.pluginname}) + except Exception: pass @@ -177,6 +179,7 @@ class IRCInterface(Thread, Addon): trigger = temp[0] if len(temp) > 1: args = temp[1:] + except Exception: pass @@ -185,6 +188,7 @@ class IRCInterface(Thread, Addon): res = handler(args) for line in res: self.response(line, msg['origin']) + except Exception, e: self.log_error(e) diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py index 42ab99027..85c22f1da 100644 --- a/module/plugins/hooks/ImageTyperz.py +++ b/module/plugins/hooks/ImageTyperz.py @@ -61,6 +61,7 @@ class ImageTyperz(Hook): try: balance = float(res) + except Exception: raise ImageTyperzException("Invalid response") diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py index 9f54218d6..5f9cfa452 100644 --- a/module/plugins/hooks/SkipRev.py +++ b/module/plugins/hooks/SkipRev.py @@ -2,7 +2,6 @@ import re import urllib -import urlparse from types import MethodType diff --git a/module/plugins/hooks/XMPPInterface.py b/module/plugins/hooks/XMPPInterface.py index 50dd40774..77e20cdd4 100644 --- a/module/plugins/hooks/XMPPInterface.py +++ b/module/plugins/hooks/XMPPInterface.py @@ -70,6 +70,7 @@ class XMPPInterface(IRCInterface, JabberClient): try: if self.get_config('info_pack'): self.announce(_("Package finished: %s") % pypack.name) + except Exception: pass @@ -79,6 +80,7 @@ class XMPPInterface(IRCInterface, JabberClient): if self.get_config('info_file'): self.announce( _("Download finished: %(name)s @ %(plugin)s") % {'name': pyfile.name, 'plugin': pyfile.pluginname}) + except Exception: pass @@ -88,6 +90,7 @@ class XMPPInterface(IRCInterface, JabberClient): self.connect() try: self.loop() + except Exception, ex: self.log_error(ex) @@ -159,6 +162,7 @@ class XMPPInterface(IRCInterface, JabberClient): trigger = temp[0] if len(temp) > 1: args = temp[1:] + except Exception: pass @@ -174,6 +178,7 @@ class XMPPInterface(IRCInterface, JabberClient): body=line) messages.append(m) + except Exception, e: self.log_error(e) diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py index 2e9ae4e48..d64834a7c 100644 --- a/module/plugins/hoster/BasePlugin.py +++ b/module/plugins/hoster/BasePlugin.py @@ -23,18 +23,6 @@ class BasePlugin(Hoster): ("Walter Purcaro", "vuolter@gmail.com")] - @classmethod - def get_info(cls, url="", html=""): #@TODO: Move to hoster class in 0.4.10 - url = urllib.unquote(url) - url_p = urlparse.urlparse(url) - return {'name' : (url_p.path.split('/')[-1] - or url_p.query.split('=', 1)[::-1][0].split('&', 1)[0] - or url_p.netloc.split('.', 1)[0]), - 'size' : 0, - 'status': 3 if url else 8, - 'url' : url} - - def setup(self): self.chunk_limit = -1 self.multiDL = True @@ -95,6 +83,7 @@ class BasePlugin(Hoster): try: errmsg += " | " + self.last_check.group(1).strip() + except Exception: pass diff --git a/module/plugins/hoster/CzshareCom.py b/module/plugins/hoster/CzshareCom.py index 3d2de5f7f..6afd9fa2d 100644 --- a/module/plugins/hoster/CzshareCom.py +++ b/module/plugins/hoster/CzshareCom.py @@ -58,6 +58,7 @@ class CzshareCom(SimpleHoster): if credit < self.pyfile.size: self.log_info(_("Not enough credit to download file: %s") % self.pyfile.name) return False + except Exception, e: #: let's continue and see what happens... self.log_error(e) @@ -70,6 +71,7 @@ class CzshareCom(SimpleHoster): try: form = re.search(self.PREMIUM_FORM_PATTERN, self.html, re.S).group(1) inputs = dict(re.findall(self.FORM_INPUT_PATTERN, form)) + except Exception, e: self.log_error(e) self.restart(nopremium=True) diff --git a/module/plugins/hoster/FileboomMe.py b/module/plugins/hoster/FileboomMe.py index 3c11f1d16..4328565f4 100644 --- a/module/plugins/hoster/FileboomMe.py +++ b/module/plugins/hoster/FileboomMe.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- import re - -from urlparse import urljoin +import urlparse from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo @@ -37,7 +36,7 @@ class FileboomMe(SimpleHoster): def handle_free(self, pyfile): - post_url = urljoin(pyfile.url, "file/" + self.info['pattern']['ID']) + post_url = urlparse.urljoin(pyfile.url, "file/" + self.info['pattern']['ID']) m = re.search(r'data-slow-id="(\w+)"', self.html) if m: @@ -46,7 +45,7 @@ class FileboomMe(SimpleHoster): m = re.search(self.LINK_PATTERN, self.html) if m: - self.link = urljoin(pyfile.url, m.group(0)) + self.link = urlparse.urljoin(pyfile.url, m.group(0)) else: for _i in xrange(5): @@ -56,7 +55,7 @@ class FileboomMe(SimpleHoster): m = re.search(self.CAPTCHA_PATTERN, self.html) if m: - captcha = self.captcha.decrypt(urljoin(pyfile.url, m.group(1))) + captcha = self.captcha.decrypt(urlparse.urljoin(pyfile.url, m.group(1))) self.html = self.load(post_url, post={'CaptchaForm[code]' : captcha, @@ -76,7 +75,7 @@ class FileboomMe(SimpleHoster): m = re.search(self.LINK_PATTERN, self.html) if m: - self.link = urljoin(pyfile.url, m.group(0)) + self.link = urlparse.urljoin(pyfile.url, m.group(0)) else: self.captcha.invalid() diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py index aa8ea2343..b13a7c793 100644 --- a/module/plugins/hoster/FilefactoryCom.py +++ b/module/plugins/hoster/FilefactoryCom.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- import re -import urlparse from module.network.RequestFactory import getURL as get_url from module.plugins.internal.SimpleHoster import SimpleHoster, parse_fileInfo diff --git a/module/plugins/hoster/FilerNet.py b/module/plugins/hoster/FilerNet.py index f8c41f4d1..af755e0a6 100644 --- a/module/plugins/hoster/FilerNet.py +++ b/module/plugins/hoster/FilerNet.py @@ -6,7 +6,6 @@ import pycurl import re -import urlparse from module.plugins.captcha.ReCaptcha import ReCaptcha from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo diff --git a/module/plugins/hoster/FilesMailRu.py b/module/plugins/hoster/FilesMailRu.py index a6dd56152..a1c30be7b 100644 --- a/module/plugins/hoster/FilesMailRu.py +++ b/module/plugins/hoster/FilesMailRu.py @@ -21,6 +21,7 @@ def get_info(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 Exception: pass diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py index 12f5bf2c3..c35fab3fc 100644 --- a/module/plugins/hoster/FileserveCom.py +++ b/module/plugins/hoster/FileserveCom.py @@ -24,6 +24,7 @@ def check_file(plugin, urls): parse_size(cols[2]) if cols[2] != '--' else 0, 2 if cols[3].startswith('Available') else 1, cols[0])) + except Exception, e: continue diff --git a/module/plugins/hoster/FourSharedCom.py b/module/plugins/hoster/FourSharedCom.py index e5b309dc1..212eadb3b 100644 --- a/module/plugins/hoster/FourSharedCom.py +++ b/module/plugins/hoster/FourSharedCom.py @@ -55,6 +55,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.log_debug(res) + except Exception: pass diff --git a/module/plugins/hoster/Ftp.py b/module/plugins/hoster/Ftp.py index 25eb44604..c9f5fa6b6 100644 --- a/module/plugins/hoster/Ftp.py +++ b/module/plugins/hoster/Ftp.py @@ -35,6 +35,7 @@ class Ftp(Hoster): pyfile.name = parsed_url.path.rpartition('/')[2] try: pyfile.name = urllib.unquote(str(pyfile.name)).decode('utf8') + except Exception: pass @@ -63,16 +64,22 @@ class Ftp(Hoster): if m: pyfile.size = int(m.group(1)) self.download(pyfile.url) + else: #: 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.urlparse(pyfile.url).path.rpartition('/')[2]]) + pyfile.url += '/' + self.req.http.c.setopt(48, 1) #: CURLOPT_DIRLISTONLY res = self.load(pyfile.url, decode=False) + links = [pyfile.url + x for x in res.splitlines()] self.log_debug("LINKS", links) + self.pyload.api.addPackage(pkgname, links) + else: self.fail(_("Unexpected server response")) diff --git a/module/plugins/hoster/GoogledriveCom.py b/module/plugins/hoster/GoogledriveCom.py index 903b5361e..381bd24dc 100644 --- a/module/plugins/hoster/GoogledriveCom.py +++ b/module/plugins/hoster/GoogledriveCom.py @@ -44,11 +44,9 @@ class GoogledriveCom(SimpleHoster): self.error(_("Free download link not found")) else: - link = html_unescape(m.group(1).decode('unicode-escape')) - if not urlparse.urlparse(link).scheme: - link = urlparse.urljoin("https://docs.google.com/", link) - + link = self.fixurl(link, "https://docs.google.com/") direct_link = self.direct_link(link, False) + if not direct_link: self.html = self.load(link) else: diff --git a/module/plugins/hoster/HellshareCz.py b/module/plugins/hoster/HellshareCz.py index eab819ad9..012b6be63 100644 --- a/module/plugins/hoster/HellshareCz.py +++ b/module/plugins/hoster/HellshareCz.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- -import urlparse - from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo diff --git a/module/plugins/hoster/NowDownloadSx.py b/module/plugins/hoster/NowDownloadSx.py index 876a7bcb5..e03ec2789 100644 --- a/module/plugins/hoster/NowDownloadSx.py +++ b/module/plugins/hoster/NowDownloadSx.py @@ -29,7 +29,7 @@ class NowDownloadSx(SimpleHoster): WAIT_PATTERN = r'\.countdown\(\{until: \+(\d+),' LINK_FREE_PATTERN = r'(http://s\d+(?:\.coolcdn\.info|\.mighycdndelivery\.com)/nowdownload/.+?)["\']' - NAME_REPLACEMENTS = [("&#?\w+;", fixup), (r'<.*?>', '')] + NAME_REPLACEMENTS = [(r'<.*?>', '')] def setup(self): diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py index cef9f6bfb..bba4bf6ad 100644 --- a/module/plugins/hoster/ShareonlineBiz.py +++ b/module/plugins/hoster/ShareonlineBiz.py @@ -3,7 +3,6 @@ import re import time import urllib -import urlparse from module.network.RequestFactory import getURL as get_url from module.plugins.captcha.ReCaptcha import ReCaptcha @@ -160,6 +159,7 @@ class ShareonlineBiz(SimpleHoster): try: self.log_error(errmsg, re.search(self.ERROR_PATTERN, self.html).group(1)) + except Exception: self.log_error(_("Unknown error occurred"), errmsg) diff --git a/module/plugins/hoster/SpeedyshareCom.py b/module/plugins/hoster/SpeedyshareCom.py index 7d7a60f04..4a71c179d 100644 --- a/module/plugins/hoster/SpeedyshareCom.py +++ b/module/plugins/hoster/SpeedyshareCom.py @@ -4,7 +4,6 @@ # http://speedy.sh/ep2qY/Zapp-Brannigan.jpg import re -import urlparse from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py index 697f1febd..a3b9fbc2f 100644 --- a/module/plugins/hoster/UploadedTo.py +++ b/module/plugins/hoster/UploadedTo.py @@ -2,7 +2,6 @@ import re import time -import urlparse from module.network.RequestFactory import getURL as get_url from module.plugins.captcha.ReCaptcha import ReCaptcha diff --git a/module/plugins/hoster/YibaishiwuCom.py b/module/plugins/hoster/YibaishiwuCom.py index 0c1a028f8..b68e87ba6 100644 --- a/module/plugins/hoster/YibaishiwuCom.py +++ b/module/plugins/hoster/YibaishiwuCom.py @@ -52,8 +52,9 @@ class YibaishiwuCom(SimpleHoster): self.link = mr['url'].replace("\\", "") self.log_debug("Trying URL: " + self.link) break + except Exception: - continue + pass else: self.fail(_("No working link found")) diff --git a/module/plugins/hoster/ZeveraCom.py b/module/plugins/hoster/ZeveraCom.py index ff3a43e6d..47286fca1 100644 --- a/module/plugins/hoster/ZeveraCom.py +++ b/module/plugins/hoster/ZeveraCom.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- import re -import urlparse from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo diff --git a/module/plugins/internal/Hoster.py b/module/plugins/internal/Hoster.py index 8457420c1..6ac1e95f6 100644 --- a/module/plugins/internal/Hoster.py +++ b/module/plugins/internal/Hoster.py @@ -416,6 +416,7 @@ class Hoster(Plugin): if not exists(download_location): try: os.makedirs(download_location) + except Exception, e: self.fail(e) @@ -632,6 +633,7 @@ class Hoster(Plugin): else: try: self.log_error(_("Too many redirects")) + except Exception: pass diff --git a/module/plugins/internal/OCR.py b/module/plugins/internal/OCR.py index b24b3058b..5913e604d 100644 --- a/module/plugins/internal/OCR.py +++ b/module/plugins/internal/OCR.py @@ -128,6 +128,7 @@ class OCR(Plugin): try: with open(tmpTxt.name, 'r') as f: self.result_captcha = f.read().replace("\n", "") + except Exception: self.result_captcha = "" @@ -194,6 +195,7 @@ class OCR(Plugin): count += 1 if pixels[x, y - 1] != 255: count += 1 + except Exception: pass diff --git a/module/plugins/internal/Plugin.py b/module/plugins/internal/Plugin.py index 9494d34a6..bbccaa48d 100644 --- a/module/plugins/internal/Plugin.py +++ b/module/plugins/internal/Plugin.py @@ -410,6 +410,7 @@ class Plugin(object): """ try: self.req.close() + except Exception: pass diff --git a/module/plugins/internal/SimpleCrypter.py b/module/plugins/internal/SimpleCrypter.py index 3771956bc..d5a5ce2d7 100644 --- a/module/plugins/internal/SimpleCrypter.py +++ b/module/plugins/internal/SimpleCrypter.py @@ -136,6 +136,7 @@ class SimpleCrypter(Crypter, SimpleHoster): def handle_pages(self, pyfile): try: pages = int(re.search(self.PAGES_PATTERN, self.html).group(1)) + except Exception: pages = 1 diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index 7c47d3620..2a83389b6 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -323,6 +323,7 @@ class SimpleHoster(Hoster): try: errmsg += " | " + self.last_check.group(1).strip() + except Exception: pass @@ -359,7 +360,8 @@ class SimpleHoster(Hoster): m = re.search(self.DL_LIMIT_PATTERN, self.html) try: errmsg = m.group(1).strip() - except Exception: + + except AttributeError: errmsg = m.group(0).strip() self.info['error'] = re.sub(r'<.*?>', " ", errmsg) @@ -382,7 +384,8 @@ class SimpleHoster(Hoster): if m: try: errmsg = m.group(1).strip() - except Exception: + + except AttributeError: errmsg = m.group(0).strip() self.info['error'] = re.sub(r'<.*?>', " ", errmsg) @@ -432,7 +435,8 @@ class SimpleHoster(Hoster): if m: try: waitmsg = m.group(1).strip() - except Exception: + + except AttributeError: waitmsg = m.group(0).strip() wait_time = sum(int(v) * {'hr': 3600, 'hour': 3600, 'min': 60, 'sec': 1, "": 1}[u.lower()] for v, u in |