diff options
Diffstat (limited to 'module/plugins/hooks')
-rw-r--r-- | module/plugins/hooks/AntiVirus.py | 4 | ||||
-rw-r--r-- | module/plugins/hooks/ClickAndLoad.py | 14 | ||||
-rw-r--r-- | module/plugins/hooks/DeleteFinished.py | 7 | ||||
-rw-r--r-- | module/plugins/hooks/HotFolder.py | 18 | ||||
-rw-r--r-- | module/plugins/hooks/LinkdecrypterComHook.py | 2 | ||||
-rw-r--r-- | module/plugins/hooks/RestartFailed.py | 20 | ||||
-rw-r--r-- | module/plugins/hooks/XFileSharingPro.py | 4 |
7 files changed, 26 insertions, 43 deletions
diff --git a/module/plugins/hooks/AntiVirus.py b/module/plugins/hooks/AntiVirus.py index d7ec69031..536675a41 100644 --- a/module/plugins/hooks/AntiVirus.py +++ b/module/plugins/hooks/AntiVirus.py @@ -17,7 +17,7 @@ from module.utils import fs_encode, save_join as fs_join class AntiVirus(Addon): __name__ = "AntiVirus" __type__ = "hook" - __version__ = "0.13" + __version__ = "0.14" __status__ = "testing" #@TODO: add trash option (use Send2Trash lib) @@ -84,7 +84,7 @@ class AntiVirus(Addon): if scanfolder: if action is "Antivirus default": - self.log_warning(_("Delete/Quarantine task skipped in folder scan mode") + self.log_warning(_("Delete/Quarantine task skipped in folder scan mode")) return pyfile.error = _("Infected file") diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py index 475234689..aef014d1a 100644 --- a/module/plugins/hooks/ClickAndLoad.py +++ b/module/plugins/hooks/ClickAndLoad.py @@ -29,13 +29,13 @@ def forward(source, destination): class ClickAndLoad(Addon): __name__ = "ClickAndLoad" __type__ = "hook" - __version__ = "0.47" + __version__ = "0.48" __status__ = "testing" - __config__ = [("activated", "bool", "Activated" , True ), - ("port" , "int" , "Port" , 9666 ), - ("extern" , "bool", "Listen on the public network interface", True ), - ("queue" , "bool", "Add packages to queue" , False)] + __config__ = [("activated", "bool" , "Activated" , True ), + ("port" , "int" , "Port" , 9666 ), + ("extern" , "bool" , "Listen for external connections", True ), + ("dest" , "queue;collector", "Add packages to" , "collector")] __description__ = """Click'n'Load hook plugin""" __license__ = "GPLv3" @@ -55,7 +55,7 @@ class ClickAndLoad(Addon): @threaded - def forward(source, destination, queue=False): + def forward(self, source, destination, queue=False): if queue: old_ids = set(pack.id for pack in self.pyload.api.getCollector()) @@ -109,7 +109,7 @@ class ClickAndLoad(Addon): server_socket.connect(("127.0.0.1", webport)) - self.forward(client_socket, server_socket, self.get_config('queue')) + self.forward(client_socket, server_socket, self.get_config('dest') is "queue") self.forward(server_socket, client_socket) except socket.timeout: diff --git a/module/plugins/hooks/DeleteFinished.py b/module/plugins/hooks/DeleteFinished.py index 75a282808..a38966476 100644 --- a/module/plugins/hooks/DeleteFinished.py +++ b/module/plugins/hooks/DeleteFinished.py @@ -7,7 +7,7 @@ from module.plugins.internal.Addon import Addon class DeleteFinished(Addon): __name__ = "DeleteFinished" __type__ = "hook" - __version__ = "1.14" + __version__ = "1.15" __status__ = "testing" __config__ = [("interval" , "int" , "Check interval in hours" , 72 ), @@ -21,10 +21,9 @@ class DeleteFinished(Addon): MIN_CHECK_INTERVAL = 1 * 60 * 60 #: 1 hour - ## overwritten methods ## - def init(self): - # self.event_map = {'pluginConfigChanged': "plugin_config_changed"} + def activate(self): self.interval = self.MIN_CHECK_INTERVAL + self.init_periodical() def periodical(self): diff --git a/module/plugins/hooks/HotFolder.py b/module/plugins/hooks/HotFolder.py index 5a65146b9..d556537aa 100644 --- a/module/plugins/hooks/HotFolder.py +++ b/module/plugins/hooks/HotFolder.py @@ -14,22 +14,22 @@ from module.utils import fs_encode, save_join as fs_join class HotFolder(Addon): __name__ = "HotFolder" __type__ = "hook" - __version__ = "0.17" + __version__ = "0.18" __status__ = "testing" - __config__ = [("folder" , "str" , "Folder to observe" , "container"), - ("watch_file", "bool", "Observe link file" , False ), - ("keep" , "bool", "Keep added containers", True ), - ("file" , "str" , "Link file" , "links.txt")] + __config__ = [("folder" , "str" , "Folder to watch" , "watchdir" ), + ("watchfile", "bool", "Watch link file" , False ), + ("delete" , "bool", "Delete added containers", False ), + ("file" , "str" , "Link file" , "links.txt")] __description__ = """Observe folder and file for changes and add container and links""" __license__ = "GPLv3" __authors__ = [("RaNaN", "RaNaN@pyload.de")] - def init(self): + def activate(self): self.interval = 30 - self.init_periodical() + self.init_periodical(threaded=True) def periodical(self): @@ -40,7 +40,7 @@ class HotFolder(Addon): if not os.path.isdir(os.path.join(folder, "finished")): os.makedirs(os.path.join(folder, "finished")) - if self.get_config('watch_file'): + if self.get_config('watchfile'): with open(file, "a+") as f: f.seek(0) content = f.read().strip() @@ -62,7 +62,7 @@ class HotFolder(Addon): if not os.path.isfile(path) or f.endswith("~") or f.startswith("#") or f.startswith("."): continue - newpath = os.path.join(folder, "finished", f if self.get_config('keep') else "tmp_" + f) + newpath = os.path.join(folder, "finished", "tmp_" + f if self.get_config('delete') else f) move(path, newpath) self.log_info(_("Added %s from HotFolder") % f) diff --git a/module/plugins/hooks/LinkdecrypterComHook.py b/module/plugins/hooks/LinkdecrypterComHook.py index bd3b03aab..7d39656d3 100644 --- a/module/plugins/hooks/LinkdecrypterComHook.py +++ b/module/plugins/hooks/LinkdecrypterComHook.py @@ -23,7 +23,7 @@ class LinkdecrypterComHook(Addon): def get_hosters(self): - list = re.search(r'>Supported\(\d+\)</b>: <i>(.[\w.\-, ]+)', + list = re.search(r'>Supported\(\d+\)</b>: <i>(.[\w.-, ]+)', self.load("http://linkdecrypter.com/").replace("(g)", "")).group(1).split(', ') try: list.remove("download.serienjunkies.org") diff --git a/module/plugins/hooks/RestartFailed.py b/module/plugins/hooks/RestartFailed.py index 6c3388e3a..812b68f76 100644 --- a/module/plugins/hooks/RestartFailed.py +++ b/module/plugins/hooks/RestartFailed.py @@ -6,7 +6,7 @@ from module.plugins.internal.Addon import Addon class RestartFailed(Addon): __name__ = "RestartFailed" __type__ = "hook" - __version__ = "1.60" + __version__ = "1.61" __status__ = "testing" __config__ = [("interval", "int", "Check interval in minutes", 90)] @@ -19,27 +19,11 @@ class RestartFailed(Addon): MIN_CHECK_INTERVAL = 15 * 60 #: 15 minutes - # def plugin_config_changed(self, plugin, name, value): - # if name == "interval": - # interval = value * 60 - # if self.MIN_CHECK_INTERVAL <= interval is not self.interval: - # self.pyload.scheduler.removeJob(self.cb) - # self.interval = interval - # self.init_periodical() - # else: - # self.log_debug("Invalid interval value, kept current") - - def periodical(self): self.log_debug("Restart failed downloads") self.pyload.api.restartFailed() - def init(self): - # self.event_map = {'pluginConfigChanged': "plugin_config_changed"} - self.interval = self.MIN_CHECK_INTERVAL - - def activate(self): - # self.plugin_config_changed(self.__name__, "interval", self.get_config('interval')) self.interval = max(self.MIN_CHECK_INTERVAL, self.get_config('interval') * 60) + self.init_periodical() diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 70bafba67..04438519b 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -23,9 +23,9 @@ class XFileSharingPro(Hook): __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - regexp = {'hoster' : (r'https?://(?:www\.)?(?:\w+\.)*?(?P<DOMAIN>(?:[\d.]+|[\w\-^_]{3,}(?:\.[a-zA-Z]{2,}){1,2})(?:\:\d+)?)/(?:embed-)?\w{12}(?:\W|$)', + regexp = {'hoster' : (r'https?://(?:www\.)?(?:\w+\.)*?(?P<DOMAIN>(?:[\d.]+|[\w-^_]{3,}(?:\.[a-zA-Z]{2,}){1,2})(?:\:\d+)?)/(?:embed-)?\w{12}(?:\W|$)', r'https?://(?:[^/]+\.)?(?P<DOMAIN>%s)/(?:embed-)?\w+'), - 'crypter': (r'https?://(?:www\.)?(?:\w+\.)*?(?P<DOMAIN>(?:[\d.]+|[\w\-^_]{3,}(?:\.[a-zA-Z]{2,}){1,2})(?:\:\d+)?)/(?:user|folder)s?/\w+', + 'crypter': (r'https?://(?:www\.)?(?:\w+\.)*?(?P<DOMAIN>(?:[\d.]+|[\w-^_]{3,}(?:\.[a-zA-Z]{2,}){1,2})(?:\:\d+)?)/(?:user|folder)s?/\w+', r'https?://(?:[^/]+\.)?(?P<DOMAIN>%s)/(?:user|folder)s?/\w+')} BUILTIN_HOSTERS = [#WORKING HOSTERS: |