From 051604eb336b6d0064cd7317e0616e7de540b444 Mon Sep 17 00:00:00 2001 From: GammaC0de Date: Thu, 20 Aug 2015 02:11:00 +0300 Subject: Create TransmissionRPC.py --- module/plugins/hooks/TransmissionRPC.py | 73 +++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 module/plugins/hooks/TransmissionRPC.py (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/TransmissionRPC.py b/module/plugins/hooks/TransmissionRPC.py new file mode 100644 index 000000000..7e2c5250a --- /dev/null +++ b/module/plugins/hooks/TransmissionRPC.py @@ -0,0 +1,73 @@ +# -*- coding: utf-8 -*- + +import re +import random +import pycurl + +from module.common.json_layer import json_loads, json_dumps +from module.network.HTTPRequest import BadHeader +from module.network.RequestFactory import getRequest as get_request +from module.plugins.internal.Addon import Addon + +class TransmissionRPC(Addon): + __name__ = "TransmissionRPC" + __type__ = "hook" + __status__ = "testing" + + __pattern__ = r"https?://.+\.torrent|magnet:\?.+" + __config__ = [("transmissionrpcurl" , "string" , "Transmission RPC URL" , "http://127.0.0.1:9091/transmission/rpc")] + + __version__ = "0.1" + __description__ = """Send torrent and magnet URLs to Transmission Bittorent daemon via RPC""" + __authors__ = [("GammaC0de", None)] + + + def init(self): + self.event_map = {'linksAdded': "links_added"} + + + def links_added(self, links, pid): + for link in links: + m = re.search(self.__pattern__, link) + if m: + self.log_debug("sending link: %s" % link) + self.SendToTransmission(link) + links.remove(link) + + + def SendToTransmission(self, url): + transmission_rpc_url = self.get_config('transmissionrpcurl') + client_request_id = self.__name__ + "".join(random.choice('0123456789ABCDEF') for _i in xrange(4)) + req = get_request() + + try: + response = self.load(transmission_rpc_url, + post=json_dumps({'arguments': {'filename': url}, + 'method' : 'torrent-add', + 'tag' : client_request_id}), + req=req) + + except BadHeader, e: + if e.code == 409: + headers = dict(re.findall(r"(?P.*?): (?P.*?)\r\n", req.header)) + session_id = headers['X-Transmission-Session-Id'] + req.c.setopt(pycurl.HTTPHEADER, ["X-Transmission-Session-Id: %s" % session_id]) + response = self.load(transmission_rpc_url, + post=json_dumps({'arguments': {'filename': url}, + 'method' : 'torrent-add', + 'tag' : client_request_id}), + req=req) + + else: + self.log_error(e) + + except Exception, e: + self.log_error(e) + + try: + res = json_loads(response) + if "result" in res: + self.log_debug("result: %s" % res['result']) + + except Exception, e: + self.log_error(e) -- cgit v1.2.3 From d4616c7bf4f3b353523690decdd30a81d7f9ff04 Mon Sep 17 00:00:00 2001 From: GammaC0de Date: Sun, 23 Aug 2015 22:22:30 +0300 Subject: Update TransmissionRPC.py --- module/plugins/hooks/TransmissionRPC.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/TransmissionRPC.py b/module/plugins/hooks/TransmissionRPC.py index 7e2c5250a..3d10b90c4 100644 --- a/module/plugins/hooks/TransmissionRPC.py +++ b/module/plugins/hooks/TransmissionRPC.py @@ -49,7 +49,7 @@ class TransmissionRPC(Addon): except BadHeader, e: if e.code == 409: - headers = dict(re.findall(r"(?P.*?): (?P.*?)\r\n", req.header)) + headers = dict(re.findall(r"(?P.+?): (?P.+?)\r?\n", req.header)) session_id = headers['X-Transmission-Session-Id'] req.c.setopt(pycurl.HTTPHEADER, ["X-Transmission-Session-Id: %s" % session_id]) response = self.load(transmission_rpc_url, -- cgit v1.2.3 From 7ba2c2414ccc0ac141cea5bfe646d86b7d94a3ad Mon Sep 17 00:00:00 2001 From: Nippey Date: Wed, 2 Sep 2015 17:39:11 +0200 Subject: Update Checksum.py The "is" operator checks for object equality, but in this case we want to compare integers. Reason of change: 02.09.2015 17:32:23 WARNING HOOK Checksum: File abcdefg.rar has incorrect size: 106954752 B (106954752 expected) --- module/plugins/hooks/Checksum.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index da4d35df1..64c5fa3ff 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -38,7 +38,7 @@ def compute_checksum(local_file, algorithm): class Checksum(Addon): __name__ = "Checksum" __type__ = "hook" - __version__ = "0.20" + __version__ = "0.21" __status__ = "testing" __config__ = [("check_checksum", "bool" , "Check checksum? (If False only size will be verified)", True ), @@ -114,7 +114,7 @@ class Checksum(Addon): api_size = int(data['size']) file_size = os.path.getsize(local_file) - if api_size is not file_size: + if api_size != file_size: self.log_warning(_("File %s has incorrect size: %d B (%d expected)") % (pyfile.name, file_size, api_size)) self.check_failed(pyfile, local_file, "Incorrect file size") -- cgit v1.2.3 From 4cd2b7390dd97dc2016ab71f954f191de12f2f46 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 3 Sep 2015 20:37:17 +0200 Subject: Spare fixes (2) --- module/plugins/hooks/ExtractArchive.py | 12 ++++++------ module/plugins/hooks/TransmissionRPC.py | 32 ++++++++++++++++++-------------- 2 files changed, 24 insertions(+), 20 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index eab196160..87cd38ade 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -51,7 +51,7 @@ except ImportError: pass from module.plugins.internal.Addon import Addon, Expose, threaded -from module.plugins.internal.Plugin import replace_patterns +from module.plugins.internal.Plugin import exists, replace_patterns from module.plugins.internal.Extractor import ArchiveError, CRCError, PasswordError from module.utils import fs_encode, save_join as fs_join, uniqify @@ -107,7 +107,7 @@ class ArchiveQueue(object): class ExtractArchive(Addon): __name__ = "ExtractArchive" __type__ = "hook" - __version__ = "1.49" + __version__ = "1.50" __status__ = "testing" __config__ = [("activated" , "bool" , "Activated" , True ), @@ -288,7 +288,7 @@ class ExtractArchive(Addon): if subfolder: out = fs_join(out, pypack.folder) - if not os.path.exists(out): + if not exists(out): os.makedirs(out) matched = False @@ -313,7 +313,7 @@ class ExtractArchive(Addon): for fname, fid, fout in targets: name = os.path.basename(fname) - if not os.path.exists(fname): + if not exists(fname): self.log_debug(name, "File not found") continue @@ -356,7 +356,7 @@ class ExtractArchive(Addon): for filename in new_files: file = fs_encode(fs_join(os.path.dirname(archive.filename), filename)) - if not os.path.exists(file): + if not exists(file): self.log_debug("New file %s does not exists" % filename) continue @@ -476,7 +476,7 @@ class ExtractArchive(Addon): deltotrash = self.get_config('deltotrash') for f in delfiles: file = fs_encode(f) - if not os.path.exists(file): + if not exists(file): continue if not deltotrash: diff --git a/module/plugins/hooks/TransmissionRPC.py b/module/plugins/hooks/TransmissionRPC.py index 3d10b90c4..9a9ee04b7 100644 --- a/module/plugins/hooks/TransmissionRPC.py +++ b/module/plugins/hooks/TransmissionRPC.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- -import re import random +import re + import pycurl from module.common.json_layer import json_loads, json_dumps @@ -9,17 +10,19 @@ from module.network.HTTPRequest import BadHeader from module.network.RequestFactory import getRequest as get_request from module.plugins.internal.Addon import Addon + class TransmissionRPC(Addon): - __name__ = "TransmissionRPC" - __type__ = "hook" + __name__ = "TransmissionRPC" + __type__ = "hook" + __version__ = "0.11" __status__ = "testing" __pattern__ = r"https?://.+\.torrent|magnet:\?.+" - __config__ = [("transmissionrpcurl" , "string" , "Transmission RPC URL" , "http://127.0.0.1:9091/transmission/rpc")] + __config__ = [("rpc_url", "str", "Transmission RPC URL", "http://127.0.0.1:9091/transmission/rpc")] - __version__ = "0.1" __description__ = """Send torrent and magnet URLs to Transmission Bittorent daemon via RPC""" - __authors__ = [("GammaC0de", None)] + __license__ = "GPLv3" + __authors__ = [("GammaC0de", None)] def init(self): @@ -27,16 +30,17 @@ class TransmissionRPC(Addon): def links_added(self, links, pid): - for link in links: - m = re.search(self.__pattern__, link) - if m: - self.log_debug("sending link: %s" % link) - self.SendToTransmission(link) - links.remove(link) + pattern = re.compile(self.__pattern__) + urls = [link for link in links if pattern.match(link)] + + for url in urls: + self.log_debug("Sending link: %s" % url) + self.SendToTransmission(url) + links.remove(url) def SendToTransmission(self, url): - transmission_rpc_url = self.get_config('transmissionrpcurl') + transmission_rpc_url = self.get_config('rpc_url') client_request_id = self.__name__ + "".join(random.choice('0123456789ABCDEF') for _i in xrange(4)) req = get_request() @@ -67,7 +71,7 @@ class TransmissionRPC(Addon): try: res = json_loads(response) if "result" in res: - self.log_debug("result: %s" % res['result']) + self.log_debug("Result: %s" % res['result']) except Exception, e: self.log_error(e) -- cgit v1.2.3 From 353a477e9a92883ba83fad471804eb2fe4ee643c Mon Sep 17 00:00:00 2001 From: GammaC0de Date: Fri, 4 Sep 2015 16:21:21 +0300 Subject: Update TransmissionRPC.py --- module/plugins/hooks/TransmissionRPC.py | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/TransmissionRPC.py b/module/plugins/hooks/TransmissionRPC.py index 9a9ee04b7..2ca06a9ad 100644 --- a/module/plugins/hooks/TransmissionRPC.py +++ b/module/plugins/hooks/TransmissionRPC.py @@ -14,7 +14,7 @@ from module.plugins.internal.Addon import Addon class TransmissionRPC(Addon): __name__ = "TransmissionRPC" __type__ = "hook" - __version__ = "0.11" + __version__ = "0.12" __status__ = "testing" __pattern__ = r"https?://.+\.torrent|magnet:\?.+" @@ -35,11 +35,11 @@ class TransmissionRPC(Addon): for url in urls: self.log_debug("Sending link: %s" % url) - self.SendToTransmission(url) + self.send_to_transmission(url) links.remove(url) - def SendToTransmission(self, url): + def send_to_transmission(self, url): transmission_rpc_url = self.get_config('rpc_url') client_request_id = self.__name__ + "".join(random.choice('0123456789ABCDEF') for _i in xrange(4)) req = get_request() @@ -56,17 +56,24 @@ class TransmissionRPC(Addon): headers = dict(re.findall(r"(?P.+?): (?P.+?)\r?\n", req.header)) session_id = headers['X-Transmission-Session-Id'] req.c.setopt(pycurl.HTTPHEADER, ["X-Transmission-Session-Id: %s" % session_id]) - response = self.load(transmission_rpc_url, - post=json_dumps({'arguments': {'filename': url}, - 'method' : 'torrent-add', - 'tag' : client_request_id}), - req=req) - + try: + response = self.load(transmission_rpc_url, + post=json_dumps({'arguments': {'filename': url}, + 'method' : 'torrent-add', + 'tag' : client_request_id}), + req=req) + + except Exception, e: + self.log_error(e) + return + else: self.log_error(e) + return except Exception, e: self.log_error(e) + return try: res = json_loads(response) -- cgit v1.2.3 From ae83396021a839e85c77d498ae726186c1a5e575 Mon Sep 17 00:00:00 2001 From: emkayyyy Date: Sat, 12 Sep 2015 09:20:52 +0200 Subject: Fix IRCInterface and XMPPInterface Following Error came up when I tried setting up either IRCInterface or XMPPInterface. AttributeError: 'IRCInterface' object has no attribute 'set_daemon' With my change now it works. Might have been caused by the removal of chamelCase. --- module/plugins/hooks/IRCInterface.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index 08b1bad0c..5d8928a57 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -18,7 +18,7 @@ from module.utils import formatSize class IRCInterface(Thread, Addon): __name__ = "IRCInterface" __type__ = "hook" - __version__ = "0.15" + __version__ = "0.16" __status__ = "testing" __config__ = [("host" , "str" , "IRC-Server Address" , "Enter your server here!"), @@ -40,7 +40,7 @@ class IRCInterface(Thread, Addon): def __init__(self, core, manager): Thread.__init__(self) Addon.__init__(self, core, manager) - self.set_daemon(True) + self.setDaemon(True) def activate(self): -- cgit v1.2.3 From 36e54a3ee89aafeffdc7eab789502decf11ca2ac Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 14 Sep 2015 02:08:19 +0200 Subject: Update main Captcha plugin --- module/plugins/hooks/XFileSharingPro.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 7567a31a3..9b9c7f0ad 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -29,18 +29,20 @@ class XFileSharingPro(Hook): r'https?://(?:[^/]+\.)?(?P%s)/(?:user|folder)s?/\w+')} HOSTER_BUILTIN = [#WORKING HOSTERS: - "ani-stream.com", "backin.net", "cloudsix.me", "eyesfile.ca", "file4safe.com", - "fileband.com", "filedwon.com", "fileparadox.in", "filevice.com", - "hostingbulk.com", "junkyvideo.com", "linestorage.com", "ravishare.com", + "ani-stream.com", "backin.net", "cloudsix.me", "eyesfile.ca", + "file4safe.com", "fileband.com", "filedwon.com", "fileparadox.in", + "filevice.com", "hostingbulk.com", "junkyvideo.com", "ravishare.com", "ryushare.com", "salefiles.com", "sendmyway.com", "sharebeast.com", - "sharesix.com", "thefile.me", "verzend.be", "worldbytez.com", "xvidstage.com", + "sharesix.com", "thefile.me", "verzend.be", "worldbytez.com", + "xvidstage.com", #: NOT TESTED: "101shared.com", "4upfiles.com", "filemaze.ws", "filenuke.com", "linkzhost.com", "mightyupload.com", "rockdizfile.com", "sharerepo.com", "shareswift.com", "uploadbaz.com", "uploadc.com", "vidbull.com", "zalaa.com", "zomgupload.com", #: NOT WORKING: - "amonshare.com", "banicrazy.info", "boosterking.com", "host4desi.com", "laoupload.com", "rd-fs.com"] + "amonshare.com", "banicrazy.info", "boosterking.com", "host4desi.com", + "laoupload.com", "rd-fs.com"] CRYPTER_BUILTIN = ["junocloud.me", "rapidfileshare.net"] -- cgit v1.2.3 From 59d2ad3541bf133ddd69fd3b7c633e7e226e4829 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 21 Sep 2015 01:08:35 +0200 Subject: Spare improvements and fixes --- module/plugins/hooks/Checksum.py | 4 ++-- module/plugins/hooks/ExtractArchive.py | 42 +++++++++++++++------------------ module/plugins/hooks/SkipRev.py | 14 +---------- module/plugins/hooks/TransmissionRPC.py | 2 +- 4 files changed, 23 insertions(+), 39 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index 64c5fa3ff..2a650768e 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -38,7 +38,7 @@ def compute_checksum(local_file, algorithm): class Checksum(Addon): __name__ = "Checksum" __type__ = "hook" - __version__ = "0.21" + __version__ = "0.22" __status__ = "testing" __config__ = [("check_checksum", "bool" , "Check checksum? (If False only size will be verified)", True ), @@ -160,7 +160,7 @@ class Checksum(Addon): return elif check_action == "nothing": return - pyfile.plugin.fail(reason=msg) + pyfile.plugin.fail(msg=msg) def package_finished(self, pypack): diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 87cd38ade..469f73141 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -107,7 +107,7 @@ class ArchiveQueue(object): class ExtractArchive(Addon): __name__ = "ExtractArchive" __type__ = "hook" - __version__ = "1.50" + __version__ = "1.51" __status__ = "testing" __config__ = [("activated" , "bool" , "Activated" , True ), @@ -115,7 +115,6 @@ class ExtractArchive(Addon): ("overwrite" , "bool" , "Overwrite files" , False ), ("keepbroken" , "bool" , "Try to extract broken archives" , False ), ("repair" , "bool" , "Repair broken archives (RAR required)" , False ), - ("test" , "bool" , "Test archive before extracting" , False ), ("usepasswordfile", "bool" , "Use password file" , True ), ("passwordfile" , "file" , "Password file" , "passwords.txt" ), ("delete" , "bool" , "Delete archive after extraction" , True ), @@ -348,7 +347,7 @@ class ExtractArchive(Addon): #: Remove processed file and related multiparts from list files_ids = [(fname, fid, fout) for fname, fid, fout in files_ids \ - if fname not in archive.get_delete_files()] + if fname not in archive.items()] self.log_debug("Extracted files: %s" % new_files) for file in new_files: @@ -403,18 +402,10 @@ class ExtractArchive(Addon): passwords = uniqify([password] + self.get_passwords(False)) if self.get_config('usepasswordfile') else [password] for pw in passwords: try: - if self.get_config('test') or self.repair: - pyfile.setCustomStatus(_("archive testing")) - if pw: - self.log_debug("Testing with password: %s" % pw) - pyfile.setProgress(0) - archive.verify(pw) - pyfile.setProgress(100) - else: - archive.check(pw) - - self.add_password(pw) - break + pyfile.setCustomStatus(_("archive testing")) + pyfile.setProgress(0) + archive.verify(pw) + pyfile.setProgress(100) except PasswordError: if not encrypted: @@ -425,9 +416,11 @@ class ExtractArchive(Addon): self.log_debug(name, e) self.log_info(name, _("CRC Error")) - if self.repair: - self.log_warning(name, _("Repairing...")) + if not self.repair: + raise CRCError("Archive damaged") + else: + self.log_warning(name, _("Repairing...")) pyfile.setCustomStatus(_("archive repairing")) pyfile.setProgress(0) repaired = archive.repair() @@ -436,15 +429,18 @@ class ExtractArchive(Addon): if not repaired and not self.get_config('keepbroken'): raise CRCError("Archive damaged") - self.add_password(pw) - break - - raise CRCError("Archive damaged") + else: + self.add_password(pw) + break except ArchiveError, e: raise ArchiveError(e) - pyfile.setCustomStatus(_("extracting")) + else: + self.add_password(pw) + break + + pyfile.setCustomStatus(_("archive extracting")) pyfile.setProgress(0) if not encrypted or not self.get_config('usepasswordfile'): @@ -467,7 +463,7 @@ class ExtractArchive(Addon): pyfile.setProgress(100) pyfile.setStatus("processing") - delfiles = archive.get_delete_files() + delfiles = archive.items() self.log_debug("Would delete: " + ", ".join(delfiles)) if self.get_config('delete'): diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py index a1ddc3094..9f54218d6 100644 --- a/module/plugins/hooks/SkipRev.py +++ b/module/plugins/hooks/SkipRev.py @@ -13,7 +13,7 @@ from module.plugins.internal.Addon import Addon class SkipRev(Addon): __name__ = "SkipRev" __type__ = "hook" - __version__ = "0.33" + __version__ = "0.34" __status__ = "testing" __config__ = [("mode" , "Auto;Manual", "Choose recovery archives to skip" , "Auto"), @@ -24,13 +24,6 @@ class SkipRev(Addon): __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - @staticmethod - def _init(self): - self.pyfile.plugin._init() - if self.pyfile.hasStatus("skipped"): - self.skip(self.pyfile.statusname or self.pyfile.pluginname) - - def _name(self, pyfile): return pyfile.pluginclass.get_info(pyfile.url)['name'] @@ -68,11 +61,6 @@ class SkipRev(Addon): pyfile.setCustomStatus("SkipRev", "skipped") - if not hasattr(pyfile.plugin, "_init"): - #: Work-around: inject status checker inside the preprocessing routine of the plugin - pyfile.plugin._init = pyfile.plugin.init - pyfile.plugin.init = MethodType(self._init, pyfile.plugin) - def download_failed(self, pyfile): #: Check if pyfile is still "failed", maybe might has been restarted in meantime diff --git a/module/plugins/hooks/TransmissionRPC.py b/module/plugins/hooks/TransmissionRPC.py index 2ca06a9ad..715f82edb 100644 --- a/module/plugins/hooks/TransmissionRPC.py +++ b/module/plugins/hooks/TransmissionRPC.py @@ -66,7 +66,7 @@ class TransmissionRPC(Addon): except Exception, e: self.log_error(e) return - + else: self.log_error(e) return -- cgit v1.2.3 From f9fc367427e30b7a3ca2ccad6144cb76b21f0257 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 21 Sep 2015 14:36:22 +0200 Subject: Spare code cosmetics --- module/plugins/hooks/CaptchaBrotherhood.py | 2 ++ module/plugins/hooks/ExtractArchive.py | 1 + module/plugins/hooks/IRCInterface.py | 4 ++++ module/plugins/hooks/ImageTyperz.py | 1 + module/plugins/hooks/SkipRev.py | 1 - module/plugins/hooks/XMPPInterface.py | 5 +++++ 6 files changed, 13 insertions(+), 1 deletion(-) (limited to 'module/plugins/hooks') 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) -- cgit v1.2.3