From 0fed2d0cbe7741d0a647553a04f95d40960641be Mon Sep 17 00:00:00 2001 From: EvolutionClip Date: Wed, 25 Jun 2014 16:21:58 +0200 Subject: [SimplyPremium] Updated API Merges #655 --- module/plugins/hooks/SimplyPremiumCom.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/SimplyPremiumCom.py b/module/plugins/hooks/SimplyPremiumCom.py index ca1122e45..60d164c66 100644 --- a/module/plugins/hooks/SimplyPremiumCom.py +++ b/module/plugins/hooks/SimplyPremiumCom.py @@ -22,7 +22,7 @@ from module.common.json_layer import json_loads class SimplyPremiumCom(MultiHoster): __name__ = "SimplyPremiumCom" - __version__ = "0.01" + __version__ = "0.02" __type__ = "hook" __config__ = [("activated", "bool", "Activated", "False"), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), @@ -30,13 +30,13 @@ class SimplyPremiumCom(MultiHoster): ("unloadFailing", "bool", "Revert to standard download if download fails", "False"), ("interval", "int", "Reload interval in hours (0 to disable)", "24")] __description__ = """Simply-Premium.Com hook plugin""" - __author_name__ = ("EvolutionClip") - __author_mail__ = ("evolutionclip@live.de") + __author_name__ = "EvolutionClip" + __author_mail__ = "evolutionclip@live.de" def getHoster(self): json_data = getURL('http://www.simply-premium.com/api/hosts.php?format=json&online=1') json_data = json_loads(json_data) - host_list = [element['host'] for element in json_data['result']] + host_list = [element['regex'] for element in json_data['result']] return host_list -- cgit v1.2.3 From 041f72aa8c3d3b91cb1159d54499c945a999fcba Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 26 Jun 2014 21:35:11 +0200 Subject: [UpdateManager] rewritten --- module/plugins/hooks/UpdateManager.py | 269 +++++++++++++++++++--------------- 1 file changed, 151 insertions(+), 118 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 5f88ea6d0..7ed4dc19f 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -2,6 +2,7 @@ import sys import re + from os import remove, stat from os.path import join, isfile from time import time @@ -13,86 +14,120 @@ from module.plugins.Hook import threaded, Expose, Hook class UpdateManager(Hook): __name__ = "UpdateManager" - __version__ = "0.16" - __description__ = """Checks for updates""" + __version__ = "0.22" + __description__ = """Check for updates""" __config__ = [("activated", "bool", "Activated", True), - ("interval", "int", "Check interval in minutes", 480), - ("debug", "bool", "Check for plugin changes when in debug mode", False)] - __author_name__ = ("RaNaN", "stickell") - __author_mail__ = ("ranan@pyload.org", "l.stickell@yahoo.it") + ("mode", "pyLoad + plugins;plugins only", "Check updates for", "pyLoad + plugins"), + ("interval", "int", "Check interval in hours", 8), + ("reloadplugins", "bool", "Monitor plugins for code changes (debug mode only)", True), + ("nodebugupdate", "bool", "Don't check for updates in debug mode", True)] + __author_name__ = ("RaNaN", "stickell", "Walter Purcaro") + __author_mail__ = ("ranan@pyload.org", "l.stickell@yahoo.it", "vuolter@gmail.com") - URL = "http://updatemanager.pyload.org" - MIN_TIME = 3 * 60 * 60 # 3h minimum check interval + SERVER_URL = "http://updatemanager.pyload.org" + MIN_TIME = 3 * 60 * 60 #: 3h minimum check interval - @property - def debug(self): - return self.core.debug and self.getConfig("debug") + event_list = ["pluginConfigChanged"] - def setup(self): - if self.debug: - self.logDebug("Monitoring file changes") - self.interval = 4 - self.last_check = 0 # timestamp of updatecheck - self.old_periodical = self.periodical - self.periodical = self.checkChanges - self.mtimes = {} # recordes times - else: - self.interval = max(self.getConfig("interval") * 60, self.MIN_TIME) - self.updated = False - self.reloaded = True - self.version = "None" + def pluginConfigChanged(self, plugin, name, value): + if name == "interval" and 0 < value != self.interval: + self.interval = max(value * 60 * 60, self.MIN_TIME) + self.initPeriodical() + elif name == "reloadplugins": + if self.cb2: + self.core.scheduler.removeJob(self.cb2) + if value and self.core.debug: + self.periodical2() + def coreReady(self): + self.pluginConfigChanged(self.__name__, "reloadplugins", self.getConfig("reloadplugins")) + + def setup(self): + self.cb2 = None + self.interval = self.MIN_TIME + self.updating = False self.info = {"pyload": False, "plugins": False} + self.mtimes = {} #: store modification time for each plugin - @threaded - def periodical(self): - updates = self.checkForUpdate() - if updates: - self.checkPlugins(updates) - - if self.updated and not self.reloaded: - self.info["plugins"] = True - self.logInfo(_("*** Plugins have been updated, please restart pyLoad ***")) - elif self.updated and self.reloaded: - self.logInfo(_("Plugins updated and reloaded")) - self.updated = False - elif self.version == "None": - self.logInfo(_("No plugin updates available")) + + def periodical2(self): + if not self.updating: + self.autoreloadPlugins() + self.cb2 = self.core.scheduler.addJob(10, self.periodical2, threaded=True) @Expose - def recheckForUpdates(self): - """recheck if updates are available""" - self.periodical() + def autoreloadPlugins(self): + """ reload and reindex all modified plugins """ + modules = filter( + lambda m: m and (m.__name__.startswith("module.plugins.") or m.__name__.startswith( + "userplugins.")) and m.__name__.count(".") >= 2, sys.modules.itervalues()) + + reloads = [] + + for m in modules: + root, type, name = m.__name__.rsplit(".", 2) + id = (type, name) + if type in self.core.pluginManager.plugins: + f = m.__file__.replace(".pyc", ".py") + if not isfile(f): + continue + + mtime = stat(f).st_mtime - def checkForUpdate(self): - """checks if an update is available, return result""" + if id not in self.mtimes: + self.mtimes[id] = mtime + elif self.mtimes[id] < mtime: + reloads.append(id) + self.mtimes[id] = mtime + + return True if self.core.pluginManager.reloadPlugins(reloads) else False + + @threaded + def periodical(self): + if not self.info["pyload"] and not (self.getConfig("nodebugupdate") and self.core.debug): + self.updating = True + self.update(onlyplugin=True if self.getConfig("mode") == "plugins only" else False) + self.updating = False + + def server_response(self): try: - if self.version == "None": # No updated known - version_check = getURL(self.URL, get={'v': self.core.api.getServerVersion()}).splitlines() - self.version = version_check[0] - - # Still no updates, plugins will be checked - if self.version == "None": - self.logInfo(_("No Updates for pyLoad")) - return version_check[1:] - - self.info["pyload"] = True - self.logInfo(_("*** New pyLoad Version %s available ***") % self.version) - self.logInfo(_("*** Get it here: http://pyload.org/download ***")) + return getURL(self.SERVER_URL, get={'v': self.core.api.getServerVersion()}).splitlines() except: - self.logWarning(_("Not able to connect server for updates")) + self.logWarning(_("Not able to connect server to get updates")) - return None # Nothing will be done + @Expose + def updatePlugins(self): + """ simple wrapper for calling plugin update quickly """ + return self.update(onlyplugin=True) + + @Expose + def update(self, onlyplugin=False): + """ check for updates """ + data = self.server_response() + if not data: + r = False + elif data[0] == "None": + self.logInfo(_("No pyLoad version available")) + updates = data[1:] + r = self._updatePlugins(updates) + elif onlyplugin: + r = False + else: + newversion = data[0] + # self.info["pyload"] = newversion + self.logInfo(_("*** New pyLoad Version %s available ***") % newversion) + self.logInfo(_("*** Get it here: https://github.com/pyload/pyload/releases ***")) + r = self.info["pyload"] = True + return r - def checkPlugins(self, updates): - """ checks for plugins updates""" + def _updatePlugins(self, updates): + """ check for plugin updates """ - # plugins were already updated if self.info["plugins"]: - return + return False #: plugins were already updated - reloads = [] + updated = [] vre = re.compile(r'__version__.*=.*("|\')([0-9.]+)') url = updates[0] @@ -123,79 +158,77 @@ class UpdateManager(Hook): plugins = getattr(self.core.pluginManager, "%sPlugins" % type) - if name in plugins: - if float(plugins[name]["v"]) >= float(version): - continue - - if name in IGNORE or (type, name) in IGNORE: + if name not in plugins or name in IGNORE or (type, name) in IGNORE: continue - self.logInfo(_("New version of %(type)s|%(name)s : %(version).2f") % { - "type": type, - "name": name, - "version": float(version) - }) + oldver = float(plugins[name]["v"]) + newver = float(version) + + if oldver >= newver: + continue + else: + self.logInfo(_("New version of [%(type)s] %(name)s (v%(oldver)s -> v%(newver)s)") % { + "type": type, + "name": name, + "oldver": oldver, + "newver": newver + }) try: content = getURL(url % info) except Exception, e: - self.logWarning(_("Error when updating %s") % filename, str(e)) + self.logError(_("Error when updating plugin %s") % filename, str(e)) continue m = vre.search(content) if not m or m.group(2) != version: - self.logWarning(_("Error when updating %s") % name, _("Version mismatch")) + self.logError(_("Error when updating plugin %s") % name, _("Version mismatch")) continue f = open(join("userplugins", prefix, filename), "wb") f.write(content) f.close() - self.updated = True - - reloads.append((prefix, name)) + updated.append((prefix, name)) if blacklist: - self.executeBlacklist(blacklist) - - self.reloaded = self.core.pluginManager.reloadPlugins(reloads) - - def executeBlacklist(self, blacklist): - for b in blacklist: - type, name = b.split('|') - if isfile(join("userplugins", type, name)): - self.logInfo(_("Removing blacklisted plugin %(type)s|%(name)s") % { - "type": type, - "name": name + removed = self.removePlugins(map(lambda x: x.split('|'), blacklist)) + for t, n in removed: + self.logInfo(_("Removed blacklisted plugin: [%(type)s] %(name)s") % { + "type": t, + "name": n }) - remove(join("userplugins", type, name)) - if isfile(join("userplugins", type, name.replace('.py', '.pyc'))): - remove(join("userplugins", type, name.replace('.py', '.pyc'))) - - def checkChanges(self): - if self.last_check + max(self.getConfig("interval") * 60, self.MIN_TIME) < time(): - self.old_periodical() - self.last_check = time() - - modules = filter( - lambda m: m and (m.__name__.startswith("module.plugins.") or m.__name__.startswith( - "userplugins.")) and m.__name__.count(".") >= 2, sys.modules.itervalues()) - - reloads = [] - for m in modules: - root, type, name = m.__name__.rsplit(".", 2) - id = (type, name) - if type in self.core.pluginManager.plugins: - f = m.__file__.replace(".pyc", ".py") - if not isfile(f): - continue - - mtime = stat(f).st_mtime - - if id not in self.mtimes: - self.mtimes[id] = mtime - elif self.mtimes[id] < mtime: - reloads.append(id) - self.mtimes[id] = mtime + if updated: + reloaded = self.core.pluginManager.reloadPlugins(updated) + if reloaded: + self.logInfo(_("Plugins updated and reloaded")) + else: + self.logInfo(_("*** Plugins have been updated, pyLoad will be restarted now ***")) + self.info["plugins"] = True + self.core.scheduler.addJob(4, self.core.api.restart(), threaded=False) #: risky, but pyload doesn't let more + return True + else: + self.logInfo(_("No plugin updates available")) + return False - self.core.pluginManager.reloadPlugins(reloads) + @Expose + def removePlugins(self, type_plugins): + """ delete plugins under userplugins directory""" + if not type_plugins: + return None + + self.logDebug("Request deletion of plugins: %s" % type_plugins) + + removed = [] + + for type, name in type_plugins: + py = join("userplugins", type, name) + pyc = py[::-1].replace('.py', '.pyc')[::-1] + if isfile(py): + id = (type, name) + remove(py) + removed.append(id) + if isfile(pyc): + remove(pyc) + + return removed #: return a list of the plugins successfully removed -- cgit v1.2.3 From d80acfcf88491b758019c8c6881e43089bf17e46 Mon Sep 17 00:00:00 2001 From: stickell Date: Thu, 26 Jun 2014 21:39:23 +0200 Subject: [UpdateManager] bump Fix commit hash on the update manager server --- module/plugins/hooks/UpdateManager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 7ed4dc19f..a824ee902 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -14,7 +14,7 @@ from module.plugins.Hook import threaded, Expose, Hook class UpdateManager(Hook): __name__ = "UpdateManager" - __version__ = "0.22" + __version__ = "0.23" __description__ = """Check for updates""" __config__ = [("activated", "bool", "Activated", True), ("mode", "pyLoad + plugins;plugins only", "Check updates for", "pyLoad + plugins"), -- cgit v1.2.3 From ce7916efe98bac98f178cadd0ab2c6af4d9e5b8f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 26 Jun 2014 22:52:03 +0200 Subject: [UpdateManager] Fix removePlugins method --- module/plugins/hooks/UpdateManager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index a824ee902..5b7bf76b0 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -14,7 +14,7 @@ from module.plugins.Hook import threaded, Expose, Hook class UpdateManager(Hook): __name__ = "UpdateManager" - __version__ = "0.23" + __version__ = "0.24" __description__ = """Check for updates""" __config__ = [("activated", "bool", "Activated", True), ("mode", "pyLoad + plugins;plugins only", "Check updates for", "pyLoad + plugins"), @@ -223,7 +223,7 @@ class UpdateManager(Hook): for type, name in type_plugins: py = join("userplugins", type, name) - pyc = py[::-1].replace('.py', '.pyc')[::-1] + pyc = join("userplugins", type, name.replace('.py', '.pyc')) if isfile(py): id = (type, name) remove(py) -- cgit v1.2.3 From 2945a72664d4b6e8ca6b50fa8efde483edfb9723 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 27 Jun 2014 00:59:12 +0200 Subject: Spare fixes --- module/plugins/hooks/HotFolder.py | 1 - 1 file changed, 1 deletion(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/HotFolder.py b/module/plugins/hooks/HotFolder.py index 38bcaf440..a63b314d1 100644 --- a/module/plugins/hooks/HotFolder.py +++ b/module/plugins/hooks/HotFolder.py @@ -38,7 +38,6 @@ class HotFolder(Hook): ("watch_file", "bool", "Observe link file", False), ("keep", "bool", "Keep added containers", True), ("file", "str", "Link file", "links.txt")] - __threaded__ = [] __author_name__ = "RaNaN" __author_mail__ = "RaNaN@pyload.de" -- cgit v1.2.3 From fb47817e99e9773b0cc1c39d537b7c594f6d71d3 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 27 Jun 2014 01:44:45 +0200 Subject: [UpdateManager] Store new pyload's version number when a system update is available --- module/plugins/hooks/UpdateManager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 5b7bf76b0..9f8ccdb80 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -47,7 +47,7 @@ class UpdateManager(Hook): self.cb2 = None self.interval = self.MIN_TIME self.updating = False - self.info = {"pyload": False, "plugins": False} + self.info = {"pyload": False, "version": None, "plugins": False} self.mtimes = {} #: store modification time for each plugin @@ -115,10 +115,10 @@ class UpdateManager(Hook): r = False else: newversion = data[0] - # self.info["pyload"] = newversion self.logInfo(_("*** New pyLoad Version %s available ***") % newversion) self.logInfo(_("*** Get it here: https://github.com/pyload/pyload/releases ***")) r = self.info["pyload"] = True + self.info["version"] = newversion return r def _updatePlugins(self, updates): -- cgit v1.2.3 From 1340c543e296f41a9a4ab7377f016c50e716535c Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 2 Jul 2014 14:29:44 +0200 Subject: [UpdateManager] Fix interval changing procedure --- module/plugins/hooks/UpdateManager.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 9f8ccdb80..8e8449a51 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -14,7 +14,7 @@ from module.plugins.Hook import threaded, Expose, Hook class UpdateManager(Hook): __name__ = "UpdateManager" - __version__ = "0.24" + __version__ = "0.25" __description__ = """Check for updates""" __config__ = [("activated", "bool", "Activated", True), ("mode", "pyLoad + plugins;plugins only", "Check updates for", "pyLoad + plugins"), @@ -25,15 +25,21 @@ class UpdateManager(Hook): __author_mail__ = ("ranan@pyload.org", "l.stickell@yahoo.it", "vuolter@gmail.com") SERVER_URL = "http://updatemanager.pyload.org" - MIN_TIME = 3 * 60 * 60 #: 3h minimum check interval + MIN_TIME = 3 * 60 * 60 #: 3h minimum check interval (seconds) event_list = ["pluginConfigChanged"] def pluginConfigChanged(self, plugin, name, value): - if name == "interval" and 0 < value != self.interval: - self.interval = max(value * 60 * 60, self.MIN_TIME) - self.initPeriodical() + if name == "interval": + interval = value * 60 * 60 + if self.MIN_TIME <= interval != self.interval: + if self.cb: + self.core.scheduler.removeJob(self.cb) + self.interval = interval + self.initPeriodical() + else: + self.logWarning("Invalid interval value, kept current") elif name == "reloadplugins": if self.cb2: self.core.scheduler.removeJob(self.cb2) -- cgit v1.2.3 From 1609d320be17c87ff0c7640511c9ba911fdd862e Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 5 Jul 2014 02:24:04 +0200 Subject: Fixed https://github.com/pyload/pyload/issues/671 + improved threading --- module/plugins/hooks/UpdateManager.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 8e8449a51..ce06612bd 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -14,7 +14,7 @@ from module.plugins.Hook import threaded, Expose, Hook class UpdateManager(Hook): __name__ = "UpdateManager" - __version__ = "0.25" + __version__ = "0.26" __description__ = """Check for updates""" __config__ = [("activated", "bool", "Activated", True), ("mode", "pyLoad + plugins;plugins only", "Check updates for", "pyLoad + plugins"), @@ -34,8 +34,7 @@ class UpdateManager(Hook): if name == "interval": interval = value * 60 * 60 if self.MIN_TIME <= interval != self.interval: - if self.cb: - self.core.scheduler.removeJob(self.cb) + self.core.scheduler.removeJob(self.cb) self.interval = interval self.initPeriodical() else: @@ -43,10 +42,11 @@ class UpdateManager(Hook): elif name == "reloadplugins": if self.cb2: self.core.scheduler.removeJob(self.cb2) - if value and self.core.debug: + if value == True and self.core.debug: self.periodical2() def coreReady(self): + self.pluginConfigChanged(self.__name__, "interval", self.getConfig("interval")) self.pluginConfigChanged(self.__name__, "reloadplugins", self.getConfig("reloadplugins")) def setup(self): @@ -89,7 +89,6 @@ class UpdateManager(Hook): return True if self.core.pluginManager.reloadPlugins(reloads) else False - @threaded def periodical(self): if not self.info["pyload"] and not (self.getConfig("nodebugupdate") and self.core.debug): self.updating = True @@ -108,6 +107,7 @@ class UpdateManager(Hook): return self.update(onlyplugin=True) @Expose + @threaded def update(self, onlyplugin=False): """ check for updates """ data = self.server_response() -- cgit v1.2.3 From 999a67f7e2a18fd3ef93bd0a5429f5c45ed5fb53 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 5 Jul 2014 18:02:02 +0200 Subject: [UpdateManager] Better if-condition check (thx stickell) --- module/plugins/hooks/UpdateManager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index ce06612bd..c37f026e3 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -42,7 +42,7 @@ class UpdateManager(Hook): elif name == "reloadplugins": if self.cb2: self.core.scheduler.removeJob(self.cb2) - if value == True and self.core.debug: + if value is True and self.core.debug: self.periodical2() def coreReady(self): -- cgit v1.2.3 From c9c16f69e39580ae7744b05f60268578e6032563 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 5 Jul 2014 22:35:14 +0200 Subject: [RestartFailed] Code cleanup --- module/plugins/hooks/RestartFailed.py | 65 ++++++++++++++++------------------- 1 file changed, 30 insertions(+), 35 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/RestartFailed.py b/module/plugins/hooks/RestartFailed.py index 85553d738..89bbcb19e 100644 --- a/module/plugins/hooks/RestartFailed.py +++ b/module/plugins/hooks/RestartFailed.py @@ -1,57 +1,52 @@ # -*- coding: utf-8 -*- - -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . - - @author: Walter Purcaro -""" +############################################################################ +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +############################################################################ from module.plugins.Hook import Hook class RestartFailed(Hook): __name__ = "RestartFailed" - __version__ = "1.53" + __version__ = "1.54" __description__ = """Periodically restart all failed downloads in queue""" __config__ = [("activated", "bool", "Activated", False), - ("interval", "int", "Interval in minutes", 90)] + ("interval", "int", "Check interval in minutes", 90)] __author_name__ = "Walter Purcaro" __author_mail__ = "vuolter@gmail.com" + MIN_INTERVAL = 15 * 60 #: 15m minimum check interval (value is in seconds) + event_list = ["pluginConfigChanged"] - MIN_INTERVAL = 15 * 60 # seconds def periodical(self): - self.logDebug("Restart all failed downloads now") + self.logInfo("Restart failed downloads") self.core.api.restartFailed() - def restartPeriodical(self, interval): - self.logDebug("Set periodical interval to %s seconds" % interval) - if self.cb: - self.core.scheduler.removeJob(self.cb) - self.interval = interval - self.cb = self.core.scheduler.addJob(interval, self._periodical, threaded=False) - def pluginConfigChanged(self, plugin, name, value): - value *= 60 - if name == "interval": - if self.interval != value > self.MIN_INTERVAL: - self.restartPeriodical(value) + if name != "interval": + interval = value * 60 + if self.MIN_INTERVAL <= interval != self.interval: + self.core.scheduler.removeJob(self.cb) + self.interval = interval + self.initPeriodical() else: - self.logWarning("Cannot change interval: given value is equal to the current or \ - smaller than %s seconds" % self.MIN_INTERVAL) + self.logWarning("Invalid interval value, kept current") + + def setup(self): + self.interval = self.MIN_INTERVAL def coreReady(self): - self.pluginConfigChanged(plugin="RestartFailed", name="interval", value=self.getConfig("interval")) + self.pluginConfigChanged(self.__name__, "interval", self.getConfig("interval")) -- cgit v1.2.3 From 4f0ecca2cad57aea6620f713067b465ca34c1a6f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 5 Jul 2014 22:36:50 +0200 Subject: [UpdateManager] Little code cleanup + improved threading --- module/plugins/hooks/UpdateManager.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index c37f026e3..0713cc0b5 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -25,7 +25,7 @@ class UpdateManager(Hook): __author_mail__ = ("ranan@pyload.org", "l.stickell@yahoo.it", "vuolter@gmail.com") SERVER_URL = "http://updatemanager.pyload.org" - MIN_TIME = 3 * 60 * 60 #: 3h minimum check interval (seconds) + MIN_INTERVAL = 3 * 60 * 60 #: 3h minimum check interval (value is in seconds) event_list = ["pluginConfigChanged"] @@ -33,7 +33,7 @@ class UpdateManager(Hook): def pluginConfigChanged(self, plugin, name, value): if name == "interval": interval = value * 60 * 60 - if self.MIN_TIME <= interval != self.interval: + if self.MIN_INTERVAL <= interval != self.interval: self.core.scheduler.removeJob(self.cb) self.interval = interval self.initPeriodical() @@ -51,7 +51,7 @@ class UpdateManager(Hook): def setup(self): self.cb2 = None - self.interval = self.MIN_TIME + self.interval = self.MIN_INTERVAL self.updating = False self.info = {"pyload": False, "version": None, "plugins": False} self.mtimes = {} #: store modification time for each plugin @@ -107,7 +107,6 @@ class UpdateManager(Hook): return self.update(onlyplugin=True) @Expose - @threaded def update(self, onlyplugin=False): """ check for updates """ data = self.server_response() @@ -127,6 +126,7 @@ class UpdateManager(Hook): self.info["version"] = newversion return r + @threaded def _updatePlugins(self, updates): """ check for plugin updates """ -- cgit v1.2.3 From aba96db5e5864703e834a035f524df7405dbe389 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 6 Jul 2014 19:00:03 +0200 Subject: Remove two dead plugins --- module/plugins/hooks/ReloadCc.py | 67 ----------------------------- module/plugins/hooks/Vipleech4uCom.py | 80 ----------------------------------- 2 files changed, 147 deletions(-) delete mode 100644 module/plugins/hooks/ReloadCc.py delete mode 100644 module/plugins/hooks/Vipleech4uCom.py (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/ReloadCc.py b/module/plugins/hooks/ReloadCc.py deleted file mode 100644 index 9960a2699..000000000 --- a/module/plugins/hooks/ReloadCc.py +++ /dev/null @@ -1,67 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.MultiHoster import MultiHoster - -from module.common.json_layer import json_loads -from module.network.RequestFactory import getURL - - -class ReloadCc(MultiHoster): - __name__ = "ReloadCc" - __version__ = "0.3" - __type__ = "hook" - __description__ = """Reload.cc hook plugin""" - - __config__ = [("activated", "bool", "Activated", False), - ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), - ("hosterList", "str", "Hoster list (comma separated)", "")] - - __author_name__ = "Reload Team" - __author_mail__ = "hello@reload.cc" - - interval = 0 # Disable periodic calls - - def getHoster(self): - # If no accounts are available there will be no hosters available - if not self.account or not self.account.canUse(): - print "ReloadCc: No accounts available" - return [] - - # Get account data - (user, data) = self.account.selectAccount() - - # Get supported hosters list from reload.cc using the json API v1 - query_params = dict( - via='pyload', - v=1, - get_supported='true', - get_traffic='true', - user=user - ) - - try: - query_params.update(dict(hash=self.account.infos[user]['pwdhash'])) - except Exception: - query_params.update(dict(pwd=data['password'])) - - answer = getURL("http://api.reload.cc/login", get=query_params) - data = json_loads(answer) - - # If account is not valid thera are no hosters available - if data['status'] != "ok": - print "ReloadCc: Status is not ok: %s" % data['status'] - return [] - - # Extract hosters from json file - return data['msg']['supportedHosters'] - - def coreReady(self): - # Get account plugin and check if there is a valid account available - self.account = self.core.accountManager.getAccountPlugin("ReloadCc") - if not self.account.canUse(): - self.account = None - self.logError("Please add a valid reload.cc account first and restart pyLoad.") - return - - # Run the overwriten core ready which actually enables the multihoster hook - return MultiHoster.coreReady(self) diff --git a/module/plugins/hooks/Vipleech4uCom.py b/module/plugins/hooks/Vipleech4uCom.py deleted file mode 100644 index b2156b017..000000000 --- a/module/plugins/hooks/Vipleech4uCom.py +++ /dev/null @@ -1,80 +0,0 @@ -# -*- coding: utf-8 -*- -import re - -from module.network.RequestFactory import getURL -from module.plugins.internal.MultiHoster import MultiHoster - - -class Vipleech4uCom(MultiHoster): - __name__ = "Vipleech4uCom" - __version__ = "0.01" - __type__ = "hook" - __config__ = [("activated", "bool", "Activated", "False"), - ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), - ("hosterList", "str", "Hoster list (comma separated)", "")] - __description__ = """Vipleech4u.com hook plugin""" - __author_name__ = ("Kagenoshin") - __author_mail__ = ("kagenoshin@gmx.ch") - - HOSTER_PATTERN = re.compile(r'align\s*?=\s*?["\']*?left.*?<\s*?strong\s*?>([^<]*?)<', re.I) - - def getHoster(self): - hosters = { - 'depositfiles': ['depositfiles.com', 'dfiles.eu'], - 'uploaded': ['uploaded.to', 'uploaded.net', 'ul.to'], - 'rapidggator': ['rapidgator.net'], # they have a typo it's called rapidgator - 'freakshare': ['freakshare.net', 'freakshare.com'], - 'filefactory': ['filefactory.com'], - 'bitshare': ['bitshare.com'], - 'share-online': ['share-online.biz', 'egoshare.com'], - 'youtube': ['youtube.com'], - 'turbobit': ['turbobit.net', 'unextfiles.com'], - 'firedrive': ['firedrive.com', 'putlocker.com'], - 'filepost': ['filepost.com', 'fp.io'], - 'netload': ['netload.in'], - 'uploadhero': ['uploadhero.com'], - 'ryushare': ['ryushare.com'], - } - - #check if the list is still valid - self.check_for_new_or_removed_hosters(hosters) - - #build list - hoster_list = [] - - for item in hosters.itervalues(): - hoster_list.extend(item) - - return hoster_list - - def check_for_new_or_removed_hosters(self, hosters): - #get the old hosters - old_hosters = hosters.keys() - - #load the current hosters from vipleech4u.com - page = getURL('http://vipleech4u.com/hosts.php') - current_hosters = self.HOSTER_PATTERN.findall(page) - current_hosters = [x.lower() for x in current_hosters] - - #let's look for new hosters - new_hosters = [] - - for hoster in current_hosters: - if not hoster in old_hosters: - new_hosters.append(hoster) - - #let's look for removed hosters - removed_hosters = [] - - for hoster in old_hosters: - if not hoster in current_hosters: - removed_hosters.append(hoster) - - if new_hosters: - self.logDebug('The following new hosters were found on vipleech4u.com: %s' % str(new_hosters)) - - if removed_hosters: - self.logDebug('The following hosters were removed from vipleech4u.com: %s' % str(removed_hosters)) - - if not (new_hosters and removed_hosters): - self.logDebug('The hoster list is still valid.') -- cgit v1.2.3 From 4778a7ed4fa4750ecd6edf1caa48f9716fe0997e Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 7 Jul 2014 15:14:08 +0200 Subject: [UpdateManager] Fixed broken updating for new plugin + sort updates + better exception handling + improved update speed performance --- module/plugins/hooks/UpdateManager.py | 89 ++++++++++++++++++----------------- 1 file changed, 46 insertions(+), 43 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 0713cc0b5..ceb229758 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -3,26 +3,26 @@ import sys import re +from operator import itemgetter from os import remove, stat from os.path import join, isfile from time import time -from module.ConfigParser import IGNORE from module.network.RequestFactory import getURL from module.plugins.Hook import threaded, Expose, Hook class UpdateManager(Hook): __name__ = "UpdateManager" - __version__ = "0.26" + __version__ = "0.30" __description__ = """Check for updates""" __config__ = [("activated", "bool", "Activated", True), ("mode", "pyLoad + plugins;plugins only", "Check updates for", "pyLoad + plugins"), ("interval", "int", "Check interval in hours", 8), ("reloadplugins", "bool", "Monitor plugins for code changes (debug mode only)", True), ("nodebugupdate", "bool", "Don't check for updates in debug mode", True)] - __author_name__ = ("RaNaN", "stickell", "Walter Purcaro") - __author_mail__ = ("ranan@pyload.org", "l.stickell@yahoo.it", "vuolter@gmail.com") + __author_name__ = "Walter Purcaro" + __author_mail__ = "vuolter@gmail.com" SERVER_URL = "http://updatemanager.pyload.org" MIN_INTERVAL = 3 * 60 * 60 #: 3h minimum check interval (value is in seconds) @@ -38,7 +38,7 @@ class UpdateManager(Hook): self.interval = interval self.initPeriodical() else: - self.logWarning("Invalid interval value, kept current") + self.logDebug("Invalid interval value, kept current") elif name == "reloadplugins": if self.cb2: self.core.scheduler.removeJob(self.cb2) @@ -66,8 +66,9 @@ class UpdateManager(Hook): def autoreloadPlugins(self): """ reload and reindex all modified plugins """ modules = filter( - lambda m: m and (m.__name__.startswith("module.plugins.") or m.__name__.startswith( - "userplugins.")) and m.__name__.count(".") >= 2, sys.modules.itervalues()) + lambda m: m and (m.__name__.startswith("module.plugins.") or + m.__name__.startswith("userplugins.")) and + m.__name__.count(".") >= 2, sys.modules.itervalues()) reloads = [] @@ -137,19 +138,19 @@ class UpdateManager(Hook): vre = re.compile(r'__version__.*=.*("|\')([0-9.]+)') url = updates[0] - schema = updates[1].split("|") - if 'BLACKLIST' in updates: + schema = updates[1].split('|') + if "BLACKLIST" in updates: blacklist = updates[updates.index('BLACKLIST') + 1:] updates = updates[2:updates.index('BLACKLIST')] else: blacklist = None updates = updates[2:] - for plugin in updates: - info = dict(zip(schema, plugin.split("|"))) - filename = info["name"] - prefix = info["type"] - version = info["version"] + data = sorted(map(lambda x: dict(zip(schema, x.split('|'))), updates), key=itemgetter("type", "name")) + for plugin in data: + filename = plugin["name"] + prefix = plugin["type"] + version = plugin["version"] if filename.endswith(".pyc"): name = filename[:filename.find("_")] @@ -164,37 +165,35 @@ class UpdateManager(Hook): plugins = getattr(self.core.pluginManager, "%sPlugins" % type) - if name not in plugins or name in IGNORE or (type, name) in IGNORE: - continue - - oldver = float(plugins[name]["v"]) + oldver = float(plugins[name]["v"]) if name in plugins else None newver = float(version) - if oldver >= newver: - continue + if not oldver: + msg = "New version of [%(type)s] %(name)s (v%(newver)s)" + elif newver > oldver: + msg = "New version of [%(type)s] %(name)s (v%(oldver)s -> v%(newver)s)" else: - self.logInfo(_("New version of [%(type)s] %(name)s (v%(oldver)s -> v%(newver)s)") % { - "type": type, - "name": name, - "oldver": oldver, - "newver": newver - }) + continue + + self.logInfo(_(msg) % { + "type": type, + "name": name, + "oldver": oldver, + "newver": newver + }) try: - content = getURL(url % info) + content = getURL(url % plugin) + m = vre.search(content) + if m and m.group(2) == version: + f = open(join("userplugins", prefix, filename), "wb") + f.write(content) + f.close() + updated.append((prefix, name)) + else: + raise Exception(_("Version mismatch")) except Exception, e: self.logError(_("Error when updating plugin %s") % filename, str(e)) - continue - - m = vre.search(content) - if not m or m.group(2) != version: - self.logError(_("Error when updating plugin %s") % name, _("Version mismatch")) - continue - - f = open(join("userplugins", prefix, filename), "wb") - f.write(content) - f.close() - updated.append((prefix, name)) if blacklist: removed = self.removePlugins(map(lambda x: x.split('|'), blacklist)) @@ -230,11 +229,15 @@ class UpdateManager(Hook): for type, name in type_plugins: py = join("userplugins", type, name) pyc = join("userplugins", type, name.replace('.py', '.pyc')) - if isfile(py): - id = (type, name) - remove(py) + id = (type, name) + try: + if isfile(py): + remove(py) + if isfile(pyc): + remove(pyc) + except Exception, e: + self.logError("Error when deleting %s" % id, str(e)) + else: removed.append(id) - if isfile(pyc): - remove(pyc) return removed #: return a list of the plugins successfully removed -- cgit v1.2.3 From cec2250f13753ea37312a56871cd6acf8d1d09dc Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 7 Jul 2014 18:48:27 +0200 Subject: [RestartFailed] Fixed bad interval checking --- module/plugins/hooks/RestartFailed.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/RestartFailed.py b/module/plugins/hooks/RestartFailed.py index 89bbcb19e..3ee2aeed4 100644 --- a/module/plugins/hooks/RestartFailed.py +++ b/module/plugins/hooks/RestartFailed.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -############################################################################ +############################################################################### # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the @@ -12,14 +12,14 @@ # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -############################################################################ +############################################################################### from module.plugins.Hook import Hook class RestartFailed(Hook): __name__ = "RestartFailed" - __version__ = "1.54" + __version__ = "1.55" __description__ = """Periodically restart all failed downloads in queue""" __config__ = [("activated", "bool", "Activated", False), ("interval", "int", "Check interval in minutes", 90)] @@ -31,21 +31,22 @@ class RestartFailed(Hook): event_list = ["pluginConfigChanged"] - def periodical(self): - self.logInfo("Restart failed downloads") - self.core.api.restartFailed() - def pluginConfigChanged(self, plugin, name, value): - if name != "interval": + if name == "interval": interval = value * 60 if self.MIN_INTERVAL <= interval != self.interval: self.core.scheduler.removeJob(self.cb) self.interval = interval self.initPeriodical() else: - self.logWarning("Invalid interval value, kept current") + self.logDebug("Invalid interval value, kept current") + + def periodical(self): + self.logInfo("Restart failed downloads") + self.api.restartFailed() def setup(self): + self.api = self.core.api self.interval = self.MIN_INTERVAL def coreReady(self): -- cgit v1.2.3 From 0eaca8de20629dd115d1d1f7bf02b26e787ff10d Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 7 Jul 2014 18:50:40 +0200 Subject: [UpdateManager] Improve code a bit more again --- module/plugins/hooks/UpdateManager.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index ceb229758..04e5a8698 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -9,7 +9,7 @@ from os.path import join, isfile from time import time from module.network.RequestFactory import getURL -from module.plugins.Hook import threaded, Expose, Hook +from module.plugins.Hook import Expose, Hook, threaded class UpdateManager(Hook): @@ -34,14 +34,14 @@ class UpdateManager(Hook): if name == "interval": interval = value * 60 * 60 if self.MIN_INTERVAL <= interval != self.interval: - self.core.scheduler.removeJob(self.cb) + self.scheduler.removeJob(self.cb) self.interval = interval self.initPeriodical() else: self.logDebug("Invalid interval value, kept current") elif name == "reloadplugins": if self.cb2: - self.core.scheduler.removeJob(self.cb2) + self.scheduler.removeJob(self.cb2) if value is True and self.core.debug: self.periodical2() @@ -50,6 +50,7 @@ class UpdateManager(Hook): self.pluginConfigChanged(self.__name__, "reloadplugins", self.getConfig("reloadplugins")) def setup(self): + self.scheduler = self.core.scheduler self.cb2 = None self.interval = self.MIN_INTERVAL self.updating = False @@ -60,7 +61,7 @@ class UpdateManager(Hook): def periodical2(self): if not self.updating: self.autoreloadPlugins() - self.cb2 = self.core.scheduler.addJob(10, self.periodical2, threaded=True) + self.cb2 = self.scheduler.addJob(10, self.periodical2, threaded=True) @Expose def autoreloadPlugins(self): @@ -210,7 +211,7 @@ class UpdateManager(Hook): else: self.logInfo(_("*** Plugins have been updated, pyLoad will be restarted now ***")) self.info["plugins"] = True - self.core.scheduler.addJob(4, self.core.api.restart(), threaded=False) #: risky, but pyload doesn't let more + self.scheduler.addJob(4, self.core.api.restart(), threaded=False) #: risky, but pyload doesn't let more return True else: self.logInfo(_("No plugin updates available")) -- cgit v1.2.3 From 7a7e3e211e36af06d00e0effbcc37ac59e152427 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Tue, 8 Jul 2014 20:00:23 +0200 Subject: nopremium.pl files added --- module/plugins/hooks/NoPremiumPl.py | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 module/plugins/hooks/NoPremiumPl.py (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/NoPremiumPl.py b/module/plugins/hooks/NoPremiumPl.py new file mode 100644 index 000000000..154d748f1 --- /dev/null +++ b/module/plugins/hooks/NoPremiumPl.py @@ -0,0 +1,39 @@ +# !/usr/bin/env python +# -*- coding: utf-8 -*- + +""" +@author: Pawel W. +""" + +from module.plugins.internal.MultiHoster import MultiHoster +from module.network.RequestFactory import getURL + +try: + from json import loads +except ImportError: + from simplejson import loads + +class NoPremiumPl(MultiHoster): + __name__ = "NoPremiumPl" + __version__ = "0.01" + __type__ = "hook" + + __config__ = [("activated", "bool", "Activated", "False"), + ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), + ("hosterList", "str", "Hoster list (comma separated)", ""), + ("unloadFailing", "bool", "Try standard download if download fails", "False"), + ("interval", "int", "Reload supported hosts interval in hours (0 to disable)", "24")] + + __description__ = "NoPremium.pl hook" + __author_name__ = ("goddie") + __author_mail__ = ("dev@nopremium.pl") + + def getHoster(self): + + hostings = loads(getURL("https://www.nopremium.pl/clipboard.php?json=3").strip()) + return [domain for row in hostings for domain in row["domains"] if row["sdownload"] == "0"] + + def getHosterCached(self): + return self.getHoster() + + -- cgit v1.2.3 From 2404538888ced4e6964df55823d0514b1c0ba685 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Tue, 8 Jul 2014 20:03:27 +0200 Subject: rapideo.pl files added --- module/plugins/hooks/RapideoPl.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 module/plugins/hooks/RapideoPl.py (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/RapideoPl.py b/module/plugins/hooks/RapideoPl.py new file mode 100644 index 000000000..5d7673826 --- /dev/null +++ b/module/plugins/hooks/RapideoPl.py @@ -0,0 +1,38 @@ +# !/usr/bin/env python +# -*- coding: utf-8 -*- + +""" +@author: Pawel W. +""" +from module.plugins.internal.MultiHoster import MultiHoster +from module.network.RequestFactory import getURL + +try: + from json import loads +except ImportError: + from simplejson import loads + +class RapideoPl(MultiHoster): + __name__ = "RapideoPl" + __version__ = "0.01" + __type__ = "hook" + + __config__ = [("activated", "bool", "Activated", "False"), + ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), + ("hosterList", "str", "Hoster list (comma separated)", ""), + ("unloadFailing", "bool", "Try standard download if download fails", "False"), + ("interval", "int", "Reload supported hosts interval in hours (0 to disable)", "24")] + + __description__ = "Rapideo.pl hook" + __author_name__ = ("goddie") + __author_mail__ = ("dev@rapideo.pl") + + def getHoster(self): + + hostings = loads(getURL("https://www.rapideo.pl/clipboard.php?json=3").strip()) + return [domain for row in hostings for domain in row["domains"] if row["sdownload"] == "0"] + + def getHosterCached(self): + return self.getHoster() + + -- cgit v1.2.3 From ccf15e75c12ad1e8347fdff834f8c62e5e2ab617 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Tue, 8 Jul 2014 21:33:01 +0200 Subject: remove redundant author information --- module/plugins/hooks/NoPremiumPl.py | 4 ---- 1 file changed, 4 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/NoPremiumPl.py b/module/plugins/hooks/NoPremiumPl.py index 154d748f1..527119c5f 100644 --- a/module/plugins/hooks/NoPremiumPl.py +++ b/module/plugins/hooks/NoPremiumPl.py @@ -1,10 +1,6 @@ # !/usr/bin/env python # -*- coding: utf-8 -*- -""" -@author: Pawel W. -""" - from module.plugins.internal.MultiHoster import MultiHoster from module.network.RequestFactory import getURL -- cgit v1.2.3 From ea1cbeda0006bbf427223686892c9e6f87cfbe94 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Tue, 8 Jul 2014 21:36:14 +0200 Subject: remove redundant author information --- module/plugins/hooks/RapideoPl.py | 3 --- 1 file changed, 3 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/RapideoPl.py b/module/plugins/hooks/RapideoPl.py index 5d7673826..e032b426d 100644 --- a/module/plugins/hooks/RapideoPl.py +++ b/module/plugins/hooks/RapideoPl.py @@ -1,9 +1,6 @@ # !/usr/bin/env python # -*- coding: utf-8 -*- -""" -@author: Pawel W. -""" from module.plugins.internal.MultiHoster import MultiHoster from module.network.RequestFactory import getURL -- cgit v1.2.3 From 2ed13d51ab8cd28f2f3db4caabde9b6d2e2cec25 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Wed, 9 Jul 2014 11:55:23 +0200 Subject: remove enviroment line --- module/plugins/hooks/RapideoPl.py | 1 - 1 file changed, 1 deletion(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/RapideoPl.py b/module/plugins/hooks/RapideoPl.py index e032b426d..fa3df9f84 100644 --- a/module/plugins/hooks/RapideoPl.py +++ b/module/plugins/hooks/RapideoPl.py @@ -1,4 +1,3 @@ -# !/usr/bin/env python # -*- coding: utf-8 -*- from module.plugins.internal.MultiHoster import MultiHoster -- cgit v1.2.3 From e325412cd71ae329f3f0b7084e5989e6ffbdbd18 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Wed, 9 Jul 2014 11:57:05 +0200 Subject: remove enviroment line --- module/plugins/hooks/NoPremiumPl.py | 1 - 1 file changed, 1 deletion(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/NoPremiumPl.py b/module/plugins/hooks/NoPremiumPl.py index 527119c5f..ef36331eb 100644 --- a/module/plugins/hooks/NoPremiumPl.py +++ b/module/plugins/hooks/NoPremiumPl.py @@ -1,4 +1,3 @@ -# !/usr/bin/env python # -*- coding: utf-8 -*- from module.plugins.internal.MultiHoster import MultiHoster -- cgit v1.2.3 From 352301e4892d311d1a4cf6127f6bc70bc23eede3 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Wed, 9 Jul 2014 12:02:59 +0200 Subject: remove blank lines and unused imports --- module/plugins/hooks/NoPremiumPl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/NoPremiumPl.py b/module/plugins/hooks/NoPremiumPl.py index ef36331eb..121e92f91 100644 --- a/module/plugins/hooks/NoPremiumPl.py +++ b/module/plugins/hooks/NoPremiumPl.py @@ -24,8 +24,8 @@ class NoPremiumPl(MultiHoster): __author_mail__ = ("dev@nopremium.pl") def getHoster(self): - hostings = loads(getURL("https://www.nopremium.pl/clipboard.php?json=3").strip()) + return [domain for row in hostings for domain in row["domains"] if row["sdownload"] == "0"] def getHosterCached(self): -- cgit v1.2.3 From ce18793af9864acdf9e9c71b7324d923a53adaad Mon Sep 17 00:00:00 2001 From: synweap15 Date: Wed, 9 Jul 2014 12:05:22 +0200 Subject: fix json loads, dumps on ImportError exception --- module/plugins/hooks/NoPremiumPl.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/NoPremiumPl.py b/module/plugins/hooks/NoPremiumPl.py index 121e92f91..47aa117df 100644 --- a/module/plugins/hooks/NoPremiumPl.py +++ b/module/plugins/hooks/NoPremiumPl.py @@ -4,9 +4,10 @@ from module.plugins.internal.MultiHoster import MultiHoster from module.network.RequestFactory import getURL try: - from json import loads + from json import loads, dumps except ImportError: - from simplejson import loads + from module.common.json_layer import json_loads as loads + from module.common.json_layer import json_dumps as dumps class NoPremiumPl(MultiHoster): __name__ = "NoPremiumPl" -- cgit v1.2.3 From dfd5cb44138494b803f66559747cacc1260b5595 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Wed, 9 Jul 2014 12:15:03 +0200 Subject: simplify json loads, replace crypto with hashlib --- module/plugins/hooks/NoPremiumPl.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/NoPremiumPl.py b/module/plugins/hooks/NoPremiumPl.py index 47aa117df..1357c95e8 100644 --- a/module/plugins/hooks/NoPremiumPl.py +++ b/module/plugins/hooks/NoPremiumPl.py @@ -3,11 +3,9 @@ from module.plugins.internal.MultiHoster import MultiHoster from module.network.RequestFactory import getURL -try: - from json import loads, dumps -except ImportError: - from module.common.json_layer import json_loads as loads - from module.common.json_layer import json_dumps as dumps +from module.common.json_layer import json_loads as loads + + class NoPremiumPl(MultiHoster): __name__ = "NoPremiumPl" -- cgit v1.2.3 From 2e8ed2bf0b357e907f6921c7bb88719bb347367b Mon Sep 17 00:00:00 2001 From: synweap15 Date: Wed, 9 Jul 2014 13:47:49 +0200 Subject: remove blank lines and unused imports --- module/plugins/hooks/RapideoPl.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/RapideoPl.py b/module/plugins/hooks/RapideoPl.py index fa3df9f84..de1a80908 100644 --- a/module/plugins/hooks/RapideoPl.py +++ b/module/plugins/hooks/RapideoPl.py @@ -8,6 +8,7 @@ try: except ImportError: from simplejson import loads + class RapideoPl(MultiHoster): __name__ = "RapideoPl" __version__ = "0.01" @@ -24,8 +25,8 @@ class RapideoPl(MultiHoster): __author_mail__ = ("dev@rapideo.pl") def getHoster(self): - hostings = loads(getURL("https://www.rapideo.pl/clipboard.php?json=3").strip()) + return [domain for row in hostings for domain in row["domains"] if row["sdownload"] == "0"] def getHosterCached(self): -- cgit v1.2.3 From 25d2cceff065a0268a7e183449ef54edf98f1783 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Wed, 9 Jul 2014 13:49:12 +0200 Subject: simplify json loads, replace crypto with hashlib --- module/plugins/hooks/RapideoPl.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/RapideoPl.py b/module/plugins/hooks/RapideoPl.py index de1a80908..0c5327903 100644 --- a/module/plugins/hooks/RapideoPl.py +++ b/module/plugins/hooks/RapideoPl.py @@ -2,12 +2,7 @@ from module.plugins.internal.MultiHoster import MultiHoster from module.network.RequestFactory import getURL - -try: - from json import loads -except ImportError: - from simplejson import loads - +from module.common.json_layer import json_loads as loads class RapideoPl(MultiHoster): __name__ = "RapideoPl" -- cgit v1.2.3 From 88ba5ecd9027ffa7a8bb5eb207085295ad35724d Mon Sep 17 00:00:00 2001 From: synweap15 Date: Wed, 9 Jul 2014 13:49:42 +0200 Subject: newline fix --- module/plugins/hooks/RapideoPl.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/RapideoPl.py b/module/plugins/hooks/RapideoPl.py index 0c5327903..910dd175b 100644 --- a/module/plugins/hooks/RapideoPl.py +++ b/module/plugins/hooks/RapideoPl.py @@ -4,6 +4,7 @@ from module.plugins.internal.MultiHoster import MultiHoster from module.network.RequestFactory import getURL from module.common.json_layer import json_loads as loads + class RapideoPl(MultiHoster): __name__ = "RapideoPl" __version__ = "0.01" -- cgit v1.2.3 From 0824528da43d0842c15ffa0d4fe132309ca592eb Mon Sep 17 00:00:00 2001 From: synweap15 Date: Wed, 9 Jul 2014 14:05:40 +0200 Subject: newline fix --- module/plugins/hooks/NoPremiumPl.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/NoPremiumPl.py b/module/plugins/hooks/NoPremiumPl.py index 1357c95e8..757af6037 100644 --- a/module/plugins/hooks/NoPremiumPl.py +++ b/module/plugins/hooks/NoPremiumPl.py @@ -2,11 +2,9 @@ from module.plugins.internal.MultiHoster import MultiHoster from module.network.RequestFactory import getURL - from module.common.json_layer import json_loads as loads - class NoPremiumPl(MultiHoster): __name__ = "NoPremiumPl" __version__ = "0.01" -- cgit v1.2.3 From 85d58360d2adb7f4405a5b8351377a82c4d7ee7d Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 13 Jul 2014 22:19:28 +0200 Subject: [CaptchaTrader] Removed because service is dead --- module/plugins/hooks/CaptchaTrader.py | 157 ---------------------------------- 1 file changed, 157 deletions(-) delete mode 100644 module/plugins/hooks/CaptchaTrader.py (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/CaptchaTrader.py b/module/plugins/hooks/CaptchaTrader.py deleted file mode 100644 index 051dc6c2b..000000000 --- a/module/plugins/hooks/CaptchaTrader.py +++ /dev/null @@ -1,157 +0,0 @@ -# -*- coding: utf-8 -*- - -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . - - @author: mkaay, RaNaN -""" - -from thread import start_new_thread -from pycurl import FORM_FILE, LOW_SPEED_TIME - -from module.common.json_layer import json_loads -from module.network.RequestFactory import getURL, getRequest -from module.network.HTTPRequest import BadHeader -from module.plugins.Hook import Hook - -PYLOAD_KEY = "9f65e7f381c3af2b076ea680ae96b0b7" - - -class CaptchaTraderException(Exception): - def __init__(self, err): - self.err = err - - def getCode(self): - return self.err - - def __str__(self): - return "" % self.err - - def __repr__(self): - return "" % self.err - - -class CaptchaTrader(Hook): - __name__ = "CaptchaTrader" - __version__ = "0.16" - __description__ = """Send captchas to captchatrader.com""" - __config__ = [("activated", "bool", "Activated", False), - ("username", "str", "Username", ""), - ("force", "bool", "Force CT even if client is connected", False), - ("passkey", "password", "Password", "")] - __author_name__ = "RaNaN" - __author_mail__ = "RaNaN@pyload.org" - - SUBMIT_URL = "http://api.captchatrader.com/submit" - RESPOND_URL = "http://api.captchatrader.com/respond" - GETCREDITS_URL = "http://api.captchatrader.com/get_credits/username:%(user)s/password:%(password)s/" - - def setup(self): - self.info = {} - - def getCredits(self): - json = getURL(CaptchaTrader.GETCREDITS_URL % {"user": self.getConfig("username"), - "password": self.getConfig("passkey")}) - response = json_loads(json) - if response[0] < 0: - raise CaptchaTraderException(response[1]) - else: - self.logInfo(_("%s credits left") % response[1]) - self.info["credits"] = response[1] - return response[1] - - def submit(self, captcha, captchaType="file", match=None): - if not PYLOAD_KEY: - raise CaptchaTraderException("No API Key Specified!") - - #if type(captcha) == str and captchaType == "file": - # raise CaptchaTraderException("Invalid Type") - assert captchaType in ("file", "url-jpg", "url-jpeg", "url-png", "url-bmp") - - req = getRequest() - - #raise timeout threshold - req.c.setopt(LOW_SPEED_TIME, 80) - - try: - json = req.load(CaptchaTrader.SUBMIT_URL, post={"api_key": PYLOAD_KEY, - "username": self.getConfig("username"), - "password": self.getConfig("passkey"), - "value": (FORM_FILE, captcha), - "type": captchaType}, multipart=True) - finally: - req.close() - - response = json_loads(json) - if response[0] < 0: - raise CaptchaTraderException(response[1]) - - ticket = response[0] - result = response[1] - self.logDebug("result %s : %s" % (ticket, result)) - - return ticket, result - - def respond(self, ticket, success): - try: - json = getURL(CaptchaTrader.RESPOND_URL, post={"is_correct": 1 if success else 0, - "username": self.getConfig("username"), - "password": self.getConfig("passkey"), - "ticket": ticket}) - - response = json_loads(json) - if response[0] < 0: - raise CaptchaTraderException(response[1]) - - except BadHeader, e: - self.logError(_("Could not send response."), str(e)) - - def newCaptchaTask(self, task): - if not task.isTextual(): - return False - - if not self.getConfig("username") or not self.getConfig("passkey"): - return False - - if self.core.isClientConnected() and not self.getConfig("force"): - return False - - if self.getCredits() > 10: - task.handler.append(self) - task.setWaiting(100) - start_new_thread(self.processCaptcha, (task,)) - - else: - self.logInfo(_("Your CaptchaTrader Account has not enough credits")) - - def captchaCorrect(self, task): - if "ticket" in task.data: - ticket = task.data["ticket"] - self.respond(ticket, True) - - def captchaInvalid(self, task): - if "ticket" in task.data: - ticket = task.data["ticket"] - self.respond(ticket, False) - - def processCaptcha(self, task): - c = task.captchaFile - try: - ticket, result = self.submit(c) - except CaptchaTraderException, e: - task.error = e.getCode() - return - - task.data["ticket"] = ticket - task.setResult(result) -- cgit v1.2.3 From 4811058490989e5150fd57ea8f0afedddba98069 Mon Sep 17 00:00:00 2001 From: Stefano Date: Mon, 14 Jul 2014 21:05:08 +0200 Subject: [l18n] Improved few source strings --- module/plugins/hooks/UpdateManager.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 04e5a8698..f017acd92 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -14,7 +14,7 @@ from module.plugins.Hook import Expose, Hook, threaded class UpdateManager(Hook): __name__ = "UpdateManager" - __version__ = "0.30" + __version__ = "0.31" __description__ = """Check for updates""" __config__ = [("activated", "bool", "Activated", True), ("mode", "pyLoad + plugins;plugins only", "Check updates for", "pyLoad + plugins"), @@ -101,7 +101,7 @@ class UpdateManager(Hook): try: return getURL(self.SERVER_URL, get={'v': self.core.api.getServerVersion()}).splitlines() except: - self.logWarning(_("Not able to connect server to get updates")) + self.logWarning(_("Unable to contact server to get updates")) @Expose def updatePlugins(self): @@ -115,7 +115,7 @@ class UpdateManager(Hook): if not data: r = False elif data[0] == "None": - self.logInfo(_("No pyLoad version available")) + self.logInfo(_("No new pyLoad version available")) updates = data[1:] r = self._updatePlugins(updates) elif onlyplugin: @@ -194,7 +194,7 @@ class UpdateManager(Hook): else: raise Exception(_("Version mismatch")) except Exception, e: - self.logError(_("Error when updating plugin %s") % filename, str(e)) + self.logError(_("Error updating plugin %s") % filename, str(e)) if blacklist: removed = self.removePlugins(map(lambda x: x.split('|'), blacklist)) @@ -237,7 +237,7 @@ class UpdateManager(Hook): if isfile(pyc): remove(pyc) except Exception, e: - self.logError("Error when deleting %s" % id, str(e)) + self.logError("Error deleting %s" % id, str(e)) else: removed.append(id) -- cgit v1.2.3 From 48c0c42fd6faffc56432d5f037cd575979f180cc Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 14 Jul 2014 02:23:37 +0200 Subject: Removed all @author flags + key attributes cleanup for internal & hooks plugins --- module/plugins/hooks/AlldebridCom.py | 1 + module/plugins/hooks/BypassCaptcha.py | 8 +++++--- module/plugins/hooks/Captcha9kw.py | 8 +++++--- module/plugins/hooks/CaptchaBrotherhood.py | 8 +++++--- module/plugins/hooks/Checksum.py | 8 +++++--- module/plugins/hooks/ClickAndLoad.py | 9 +++++---- module/plugins/hooks/DeathByCaptcha.py | 8 +++++--- module/plugins/hooks/DebridItaliaCom.py | 2 ++ module/plugins/hooks/DeleteFinished.py | 16 ++++++++-------- module/plugins/hooks/DownloadScheduler.py | 7 +++++-- module/plugins/hooks/EasybytezCom.py | 3 +++ module/plugins/hooks/Ev0InFetcher.py | 8 +++++--- module/plugins/hooks/ExpertDecoders.py | 8 +++++--- module/plugins/hooks/ExternalScripts.py | 9 +++++---- module/plugins/hooks/ExtractArchive.py | 10 +++++++--- module/plugins/hooks/FastixRu.py | 3 +++ module/plugins/hooks/FreeWayMe.py | 7 ++++--- module/plugins/hooks/HotFolder.py | 9 +++++---- module/plugins/hooks/IRCInterface.py | 10 +++++----- module/plugins/hooks/ImageTyperz.py | 8 +++++--- module/plugins/hooks/LinkdecrypterCom.py | 8 +++++--- module/plugins/hooks/LinksnappyCom.py | 2 ++ module/plugins/hooks/MegaDebridEu.py | 3 +++ module/plugins/hooks/MergeFiles.py | 12 +++++++----- module/plugins/hooks/MultiDebridCom.py | 2 ++ module/plugins/hooks/MultiHome.py | 8 +++++--- module/plugins/hooks/MultishareCz.py | 3 +++ module/plugins/hooks/OverLoadMe.py | 3 +++ module/plugins/hooks/Premium4Me.py | 2 ++ module/plugins/hooks/PremiumizeMe.py | 3 ++- module/plugins/hooks/RPNetBiz.py | 5 ++++- module/plugins/hooks/RealdebridCom.py | 2 ++ module/plugins/hooks/RehostTo.py | 1 + module/plugins/hooks/RestartFailed.py | 5 ++++- module/plugins/hooks/SimplyPremiumCom.py | 3 +++ module/plugins/hooks/SimplydebridCom.py | 3 +++ module/plugins/hooks/UnSkipOnFail.py | 10 ++++++---- module/plugins/hooks/UnrestrictLi.py | 2 ++ module/plugins/hooks/UpdateManager.py | 5 ++++- module/plugins/hooks/WindowsPhoneToastNotify.py | 12 +++++++----- module/plugins/hooks/XFileSharingPro.py | 3 +++ module/plugins/hooks/XMPPInterface.py | 9 +++++---- module/plugins/hooks/ZeveraCom.py | 3 +++ 43 files changed, 174 insertions(+), 85 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/AlldebridCom.py b/module/plugins/hooks/AlldebridCom.py index 0f8d3bfbb..1ef9b252a 100644 --- a/module/plugins/hooks/AlldebridCom.py +++ b/module/plugins/hooks/AlldebridCom.py @@ -22,6 +22,7 @@ class AlldebridCom(MultiHoster): __author_name__ = "Andy Voigt" __author_mail__ = "spamsales@online.de" + def getHoster(self): https = "https" if self.getConfig("https") else "http" page = getURL(https + "://www.alldebrid.com/api.php?action=get_host").replace("\"", "").strip() diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index 70e60f56c..1c9c4e722 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -13,8 +13,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . - - @author: RaNaN, Godofdream, zoidberg """ from thread import start_new_thread @@ -45,10 +43,13 @@ class BypassCaptchaException(Exception): class BypassCaptcha(Hook): __name__ = "BypassCaptcha" __version__ = "0.04" - __description__ = """Send captchas to BypassCaptcha.com""" + __type__ = "hook" + __config__ = [("activated", "bool", "Activated", False), ("force", "bool", "Force BC even if client is connected", False), ("passkey", "password", "Passkey", "")] + + __description__ = """Send captchas to BypassCaptcha.com""" __author_name__ = ("RaNaN", "Godofdream", "zoidberg") __author_mail__ = ("RaNaN@pyload.org", "soilfcition@gmail.com", "zoidberg@mujmail.cz") @@ -56,6 +57,7 @@ class BypassCaptcha(Hook): RESPOND_URL = "http://bypasscaptcha.com/check_value.php" GETCREDITS_URL = "http://bypasscaptcha.com/ex_left.php" + def setup(self): self.info = {} diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index c86f92972..28bce3d2b 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -13,8 +13,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . - - @author: mkaay, RaNaN, zoidberg """ from __future__ import with_statement @@ -31,7 +29,8 @@ from module.plugins.Hook import Hook class Captcha9kw(Hook): __name__ = "Captcha9kw" __version__ = "0.09" - __description__ = """Send captchas to 9kw.eu""" + __type__ = "hook" + __config__ = [("activated", "bool", "Activated", False), ("force", "bool", "Force CT even if client is connected", True), ("https", "bool", "Enable HTTPS", False), @@ -43,11 +42,14 @@ class Captcha9kw(Hook): False), ("timeout", "int", "Timeout (max. 300)", 300), ("passkey", "password", "API key", "")] + + __description__ = """Send captchas to 9kw.eu""" __author_name__ = "RaNaN" __author_mail__ = "RaNaN@pyload.org" API_URL = "://www.9kw.eu/index.cgi" + def setup(self): self.API_URL = "https" + self.API_URL if self.getConfig("https") else "http" + self.API_URL self.info = {} diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py index 23d71ff5f..86768b76b 100644 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ b/module/plugins/hooks/CaptchaBrotherhood.py @@ -13,8 +13,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . - - @author: mkaay, RaNaN, zoidberg """ from __future__ import with_statement @@ -47,16 +45,20 @@ class CaptchaBrotherhoodException(Exception): class CaptchaBrotherhood(Hook): __name__ = "CaptchaBrotherhood" __version__ = "0.05" - __description__ = """Send captchas to CaptchaBrotherhood.com""" + __type__ = "hook" + __config__ = [("activated", "bool", "Activated", False), ("username", "str", "Username", ""), ("force", "bool", "Force CT even if client is connected", False), ("passkey", "password", "Password", "")] + + __description__ = """Send captchas to CaptchaBrotherhood.com""" __author_name__ = ("RaNaN", "zoidberg") __author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz") API_URL = "http://www.captchabrotherhood.com/" + def setup(self): self.info = {} diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index af37d69e6..8566a847e 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -13,8 +13,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . - - @author: zoidberg """ from __future__ import with_statement @@ -55,12 +53,15 @@ def computeChecksum(local_file, algorithm): class Checksum(Hook): __name__ = "Checksum" __version__ = "0.12" - __description__ = """Verify downloaded file size and checksum""" + __type__ = "hook" + __config__ = [("activated", "bool", "Activated", False), ("check_action", "fail;retry;nothing", "What to do if check fails?", "retry"), ("max_tries", "int", "Number of retries", 2), ("retry_action", "fail;nothing", "What to do if all retries fail?", "fail"), ("wait_time", "int", "Time to wait before each retry (seconds)", 1)] + + __description__ = """Verify downloaded file size and checksum""" __author_name__ = ("zoidberg", "Walter Purcaro") __author_mail__ = ("zoidberg@mujmail.cz", "vuolter@gmail.com") @@ -70,6 +71,7 @@ class Checksum(Hook): 'crc': r'filename=(?P.+)\nsize=(?P\d+)\ncrc32=(?P[0-9A-Fa-f]{8})$', 'default': r'^(?P[0-9A-Fa-f]+)\s+\*?(?P.+)$'} + def coreReady(self): if not self.config['general']['checksum']: self.logInfo("Checksum validation is disabled in general configuration") diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py index 002fd4cd7..3c47d30ce 100644 --- a/module/plugins/hooks/ClickAndLoad.py +++ b/module/plugins/hooks/ClickAndLoad.py @@ -13,9 +13,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . - - @author: RaNaN - @interface-version: 0.2 """ import socket @@ -27,12 +24,16 @@ from module.plugins.Hook import Hook class ClickAndLoad(Hook): __name__ = "ClickAndLoad" __version__ = "0.22" - __description__ = """Gives abillity to use jd's click and load. depends on webinterface""" + __type__ = "hook" + __config__ = [("activated", "bool", "Activated", True), ("extern", "bool", "Allow external link adding", False)] + + __description__ = """Gives abillity to use jd's click and load. depends on webinterface""" __author_name__ = ("RaNaN", "mkaay") __author_mail__ = ("RaNaN@pyload.de", "mkaay@mkaay.de") + def coreReady(self): self.port = int(self.config['webinterface']['port']) if self.config['webinterface']['activated']: diff --git a/module/plugins/hooks/DeathByCaptcha.py b/module/plugins/hooks/DeathByCaptcha.py index f7bc1b90f..5a5ab7933 100644 --- a/module/plugins/hooks/DeathByCaptcha.py +++ b/module/plugins/hooks/DeathByCaptcha.py @@ -13,8 +13,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . - - @author: mkaay, RaNaN, zoidberg """ from __future__ import with_statement @@ -62,16 +60,20 @@ class DeathByCaptchaException(Exception): class DeathByCaptcha(Hook): __name__ = "DeathByCaptcha" __version__ = "0.03" - __description__ = """Send captchas to DeathByCaptcha.com""" + __type__ = "hook" + __config__ = [("activated", "bool", "Activated", False), ("username", "str", "Username", ""), ("passkey", "password", "Password", ""), ("force", "bool", "Force DBC even if client is connected", False)] + + __description__ = """Send captchas to DeathByCaptcha.com""" __author_name__ = ("RaNaN", "zoidberg") __author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz") API_URL = "http://api.dbcapi.me/api/" + def setup(self): self.info = {} diff --git a/module/plugins/hooks/DebridItaliaCom.py b/module/plugins/hooks/DebridItaliaCom.py index fb6be674f..1a081da7a 100644 --- a/module/plugins/hooks/DebridItaliaCom.py +++ b/module/plugins/hooks/DebridItaliaCom.py @@ -21,6 +21,7 @@ class DebridItaliaCom(MultiHoster): __name__ = "DebridItaliaCom" __version__ = "0.07" __type__ = "hook" + __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("hosterList", "str", "Hoster list (comma separated)", ""), @@ -31,6 +32,7 @@ class DebridItaliaCom(MultiHoster): __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" + def getHoster(self): return ["netload.in", "hotfile.com", "rapidshare.com", "multiupload.com", "uploading.com", "megashares.com", "crocko.com", "filepost.com", diff --git a/module/plugins/hooks/DeleteFinished.py b/module/plugins/hooks/DeleteFinished.py index 3bc98a7b3..48b262392 100644 --- a/module/plugins/hooks/DeleteFinished.py +++ b/module/plugins/hooks/DeleteFinished.py @@ -13,8 +13,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . - - @author: Walter Purcaro """ from module.database import style @@ -24,15 +22,17 @@ from module.plugins.Hook import Hook class DeleteFinished(Hook): __name__ = 'DeleteFinished' __version__ = '1.09' - __description__ = 'Automatically delete all finished packages from queue' - __config__ = [ - ('activated', 'bool', 'Activated', 'False'), - ('interval', 'int', 'Delete every (hours)', '72'), - ('deloffline', 'bool', 'Delete packages with offline links', 'False') - ] + __type__ = "hook" + + __config__ = [('activated', 'bool', 'Activated', 'False'), + ('interval', 'int', 'Delete every (hours)', '72'), + ('deloffline', 'bool', 'Delete packages with offline links', 'False')] + + __description__ = """Automatically delete all finished packages from queue""" __author_name__ = ('Walter Purcaro') __author_mail__ = ('vuolter@gmail.com') + ## overwritten methods ## def periodical(self): if not self.info['sleep']: diff --git a/module/plugins/hooks/DownloadScheduler.py b/module/plugins/hooks/DownloadScheduler.py index 41a20e5d1..070c0634e 100644 --- a/module/plugins/hooks/DownloadScheduler.py +++ b/module/plugins/hooks/DownloadScheduler.py @@ -12,7 +12,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . - @author: zoidberg Original idea by new.cze """ @@ -25,14 +24,18 @@ from module.plugins.Hook import Hook class DownloadScheduler(Hook): __name__ = "DownloadScheduler" __version__ = "0.21" - __description__ = """Download Scheduler""" + __type__ = "hook" + __config__ = [("activated", "bool", "Activated", False), ("timetable", "str", "List time periods as hh:mm full or number(kB/s)", "0:00 full, 7:00 250, 10:00 0, 17:00 150"), ("abort", "bool", "Abort active downloads when start period with speed 0", False)] + + __description__ = """Download Scheduler""" __author_name__ = ("zoidberg", "stickell") __author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it") + def setup(self): self.cb = None # callback to scheduler job; will be by removed hookmanager when hook unloaded diff --git a/module/plugins/hooks/EasybytezCom.py b/module/plugins/hooks/EasybytezCom.py index a3a2dcb92..d3cda7b80 100644 --- a/module/plugins/hooks/EasybytezCom.py +++ b/module/plugins/hooks/EasybytezCom.py @@ -9,13 +9,16 @@ class EasybytezCom(MultiHoster): __name__ = "EasybytezCom" __version__ = "0.03" __type__ = "hook" + __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("hosterList", "str", "Hoster list (comma separated)", "")] + __description__ = """EasyBytez.com hook plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" + def getHoster(self): self.account = self.core.accountManager.getAccountPlugin(self.__name__) user = self.account.selectAccount()[0] diff --git a/module/plugins/hooks/Ev0InFetcher.py b/module/plugins/hooks/Ev0InFetcher.py index 1e2b62062..d2caa19ac 100644 --- a/module/plugins/hooks/Ev0InFetcher.py +++ b/module/plugins/hooks/Ev0InFetcher.py @@ -13,8 +13,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . - - @author: mkaay """ from time import mktime, time @@ -25,7 +23,8 @@ from module.plugins.Hook import Hook class Ev0InFetcher(Hook): __name__ = "Ev0InFetcher" __version__ = "0.21" - __description__ = """Checks rss feeds for Ev0.in""" + __type__ = "hook" + __config__ = [("activated", "bool", "Activated", False), ("interval", "int", "Check interval in minutes", 10), ("queue", "bool", "Move new shows directly to Queue", False), @@ -33,9 +32,12 @@ class Ev0InFetcher(Hook): ("quality", "xvid;x264;rmvb", "Video Format", "xvid"), ("hoster", "str", "Hoster to use (comma seperated)", "NetloadIn,RapidshareCom,MegauploadCom,HotfileCom")] + + __description__ = """Checks rss feeds for Ev0.in""" __author_name__ = "mkaay" __author_mail__ = "mkaay@mkaay.de" + def setup(self): self.interval = self.getConfig("interval") * 60 diff --git a/module/plugins/hooks/ExpertDecoders.py b/module/plugins/hooks/ExpertDecoders.py index 7be30f86e..65edd487b 100644 --- a/module/plugins/hooks/ExpertDecoders.py +++ b/module/plugins/hooks/ExpertDecoders.py @@ -13,8 +13,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . - - @author: mkaay, RaNaN, zoidberg """ from __future__ import with_statement @@ -32,15 +30,19 @@ from module.plugins.Hook import Hook class ExpertDecoders(Hook): __name__ = "ExpertDecoders" __version__ = "0.01" - __description__ = """Send captchas to expertdecoders.com""" + __type__ = "hook" + __config__ = [("activated", "bool", "Activated", False), ("force", "bool", "Force CT even if client is connected", False), ("passkey", "password", "Access key", "")] + + __description__ = """Send captchas to expertdecoders.com""" __author_name__ = ("RaNaN", "zoidberg") __author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz") API_URL = "http://www.fasttypers.org/imagepost.ashx" + def setup(self): self.info = {} diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index 3d84dcc3d..55aae1093 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -13,9 +13,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . - - @author: mkaay - @interface-version: 0.1 """ import subprocess @@ -29,13 +26,17 @@ from module.utils import save_join class ExternalScripts(Hook): __name__ = "ExternalScripts" __version__ = "0.23" - __description__ = """Run external scripts""" + __type__ = "hook" + __config__ = [("activated", "bool", "Activated", True)] + + __description__ = """Run external scripts""" __author_name__ = ("mkaay", "RaNaN", "spoob") __author_mail__ = ("mkaay@mkaay.de", "ranan@pyload.org", "spoob@pyload.org") event_list = ["unrarFinished", "allDownloadsFinished", "allDownloadsProcessed"] + def setup(self): self.scripts = {} diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 12e53fe50..a2e7d1dac 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -59,7 +59,8 @@ class ExtractArchive(Hook): """ __name__ = "ExtractArchive" __version__ = "0.16" - __description__ = """Extract different kind of archives""" + __type__ = "hook" + __config__ = [("activated", "bool", "Activated", True), ("fullpath", "bool", "Extract full path", True), ("overwrite", "bool", "Overwrite files", True), @@ -71,11 +72,14 @@ class ExtractArchive(Hook): ("recursive", "bool", "Extract archives in archvies", True), ("queue", "bool", "Wait for all downloads to be finished", True), ("renice", "int", "CPU Priority", 0)] - __author_name__ = ("pyload Team", "AndroKev") - __author_mail__ = ("adminpyload.org", "@pyloadforum") + + __description__ = """Extract different kind of archives""" + __author_name__ = ("pyLoad Team", "AndroKev") + __author_mail__ = ("admin@pyload.org", "@pyloadforum") event_list = ["allDownloadsProcessed"] + def setup(self): self.plugins = [] self.passwords = [] diff --git a/module/plugins/hooks/FastixRu.py b/module/plugins/hooks/FastixRu.py index 558da1b86..aa020ea37 100644 --- a/module/plugins/hooks/FastixRu.py +++ b/module/plugins/hooks/FastixRu.py @@ -11,14 +11,17 @@ class FastixRu(MultiHoster): __name__ = "FastixRu" __version__ = "0.02" __type__ = "hook" + __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("unloadFailing", "bool", "Revert to standard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 24)] + __description__ = """Fastix.ru hook plugin""" __author_name__ = "Massimo Rosamilia" __author_mail__ = "max@spiritix.eu" + def getHoster(self): page = getURL( "http://fastix.ru/api_v2/?apikey=5182964c3f8f9a7f0b00000a_kelmFB4n1IrnCDYuIFn2y&sub=allowed_sources") diff --git a/module/plugins/hooks/FreeWayMe.py b/module/plugins/hooks/FreeWayMe.py index 7d4bcc852..3d2f7fcef 100644 --- a/module/plugins/hooks/FreeWayMe.py +++ b/module/plugins/hooks/FreeWayMe.py @@ -13,8 +13,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . - - @author: Nicolas Giese """ from module.network.RequestFactory import getURL @@ -25,15 +23,18 @@ class FreeWayMe(MultiHoster): __name__ = "FreeWayMe" __version__ = "0.11" __type__ = "hook" - __description__ = """FreeWay.me hook plugin""" + __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), ("hosterList", "str", "Hoster list (comma separated)", ""), ("unloadFailing", "bool", "Revert to stanard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 24)] + + __description__ = """FreeWay.me hook plugin""" __author_name__ = "Nicolas Giese" __author_mail__ = "james@free-way.me" + def getHoster(self): hostis = getURL("https://www.free-way.me/ajax/jd.php", get={"id": 3}).replace("\"", "").strip() self.logDebug("hosters: %s" % hostis) diff --git a/module/plugins/hooks/HotFolder.py b/module/plugins/hooks/HotFolder.py index a63b314d1..bd57712af 100644 --- a/module/plugins/hooks/HotFolder.py +++ b/module/plugins/hooks/HotFolder.py @@ -13,9 +13,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . - - @author: RaNaN - @interface-version: 0.2 """ from os import makedirs @@ -32,15 +29,19 @@ from module.plugins.Hook import Hook class HotFolder(Hook): __name__ = "HotFolder" __version__ = "0.11" - __description__ = """Observe folder and file for changes and add container and links""" + __type__ = "hook" + __config__ = [("activated", "bool", "Activated", False), ("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")] + + __description__ = """Observe folder and file for changes and add container and links""" __author_name__ = "RaNaN" __author_mail__ = "RaNaN@pyload.de" + def setup(self): self.interval = 10 diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index 760c1a4df..41ca352a4 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -13,10 +13,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . - - @author: RaNaN - @author: jeix - @interface-version: 0.2 """ from select import select @@ -37,7 +33,8 @@ from module.Api import PackageDoesNotExists, FileDoesNotExists class IRCInterface(Thread, Hook): __name__ = "IRCInterface" __version__ = "0.11" - __description__ = """Connect to irc and let owner perform different tasks""" + __type__ = "hook" + __config__ = [("activated", "bool", "Activated", False), ("host", "str", "IRC-Server Address", "Enter your server here!"), ("port", "int", "IRC-Server Port", 6667), @@ -48,9 +45,12 @@ class IRCInterface(Thread, Hook): ("info_file", "bool", "Inform about every file finished", False), ("info_pack", "bool", "Inform about every package finished", True), ("captcha", "bool", "Send captcha requests", True)] + + __description__ = """Connect to irc and let owner perform different tasks""" __author_name__ = "Jeix" __author_mail__ = "Jeix@hasnomail.com" + def __init__(self, core, manager): Thread.__init__(self) Hook.__init__(self, core, manager) diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py index e2e9d93d5..3c23f9567 100644 --- a/module/plugins/hooks/ImageTyperz.py +++ b/module/plugins/hooks/ImageTyperz.py @@ -13,8 +13,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . - - @author: mkaay, RaNaN, zoidberg """ from __future__ import with_statement from thread import start_new_thread @@ -43,11 +41,14 @@ class ImageTyperzException(Exception): class ImageTyperz(Hook): __name__ = "ImageTyperz" __version__ = "0.04" - __description__ = """Send captchas to ImageTyperz.com""" + __type__ = "hook" + __config__ = [("activated", "bool", "Activated", False), ("username", "str", "Username", ""), ("passkey", "password", "Password", ""), ("force", "bool", "Force IT even if client is connected", False)] + + __description__ = """Send captchas to ImageTyperz.com""" __author_name__ = ("RaNaN", "zoidberg") __author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz") @@ -55,6 +56,7 @@ class ImageTyperz(Hook): RESPOND_URL = "http://captchatypers.com/Forms/SetBadImage.ashx" GETCREDITS_URL = "http://captchatypers.com/Forms/RequestBalance.ashx" + def setup(self): self.info = {} diff --git a/module/plugins/hooks/LinkdecrypterCom.py b/module/plugins/hooks/LinkdecrypterCom.py index dd9cd79f2..75995faf2 100644 --- a/module/plugins/hooks/LinkdecrypterCom.py +++ b/module/plugins/hooks/LinkdecrypterCom.py @@ -13,8 +13,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . - - @author: zoidberg """ import re @@ -27,11 +25,15 @@ from module.utils import remove_chars class LinkdecrypterCom(Hook): __name__ = "LinkdecrypterCom" __version__ = "0.19" - __description__ = """Linkdecrypter.com hook plugin""" + __type__ = "hook" + __config__ = [("activated", "bool", "Activated", False)] + + __description__ = """Linkdecrypter.com hook plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" + def coreReady(self): try: self.loadPatterns() diff --git a/module/plugins/hooks/LinksnappyCom.py b/module/plugins/hooks/LinksnappyCom.py index 110731228..a0e5b8d38 100644 --- a/module/plugins/hooks/LinksnappyCom.py +++ b/module/plugins/hooks/LinksnappyCom.py @@ -9,6 +9,7 @@ class LinksnappyCom(MultiHoster): __name__ = "LinksnappyCom" __version__ = "0.01" __type__ = "hook" + __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("hosterList", "str", "Hoster list (comma separated)", ""), @@ -19,6 +20,7 @@ class LinksnappyCom(MultiHoster): __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" + def getHoster(self): json_data = getURL('http://gen.linksnappy.com/lseAPI.php?act=FILEHOSTS') json_data = json_loads(json_data) diff --git a/module/plugins/hooks/MegaDebridEu.py b/module/plugins/hooks/MegaDebridEu.py index 0c3bb99f6..31be74fdd 100644 --- a/module/plugins/hooks/MegaDebridEu.py +++ b/module/plugins/hooks/MegaDebridEu.py @@ -23,12 +23,15 @@ class MegaDebridEu(MultiHoster): __name__ = "MegaDebridEu" __version__ = "0.02" __type__ = "hook" + __config__ = [("activated", "bool", "Activated", False), ("unloadFailing", "bool", "Revert to standard download if download fails", False)] + __description__ = """mega-debrid.eu hook plugin""" __author_name__ = "D.Ducatel" __author_mail__ = "dducatel@je-geek.fr" + def getHoster(self): reponse = getURL('http://www.mega-debrid.eu/api.php?action=getHosters') json_data = json_loads(reponse) diff --git a/module/plugins/hooks/MergeFiles.py b/module/plugins/hooks/MergeFiles.py index 99b0aafc6..e7bd63d17 100644 --- a/module/plugins/hooks/MergeFiles.py +++ b/module/plugins/hooks/MergeFiles.py @@ -13,8 +13,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . - - @author: and9000 """ import os @@ -23,7 +21,7 @@ import traceback from os.path import join from module.utils import save_join, fs_encode -from module.plugins.Hook import Hook +from module.plugins.Hook import Hook, threaded BUFFER_SIZE = 4096 @@ -31,16 +29,20 @@ BUFFER_SIZE = 4096 class MergeFiles(Hook): __name__ = "MergeFiles" __version__ = "0.12" - __description__ = """Merges parts splitted with hjsplit""" + __type__ = "hook" + __config__ = [("activated", "bool", "Activated", False)] - __threaded__ = ["packageFinished"] + + __description__ = """Merges parts splitted with hjsplit""" __author_name__ = "and9000" __author_mail__ = "me@has-no-mail.com" + def setup(self): # nothing to do pass + @threaded def packageFinished(self, pack): files = {} fid_dict = {} diff --git a/module/plugins/hooks/MultiDebridCom.py b/module/plugins/hooks/MultiDebridCom.py index f2dfb18ca..3309fb9a8 100644 --- a/module/plugins/hooks/MultiDebridCom.py +++ b/module/plugins/hooks/MultiDebridCom.py @@ -23,6 +23,7 @@ class MultiDebridCom(MultiHoster): __name__ = "MultiDebridCom" __version__ = "0.01" __type__ = "hook" + __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("hosterList", "str", "Hoster list (comma separated)", ""), @@ -33,6 +34,7 @@ class MultiDebridCom(MultiHoster): __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" + def getHoster(self): json_data = getURL('http://multi-debrid.com/api.php?hosts', decode=True) self.logDebug('JSON data: ' + json_data) diff --git a/module/plugins/hooks/MultiHome.py b/module/plugins/hooks/MultiHome.py index b1635a588..5a7e53b0d 100644 --- a/module/plugins/hooks/MultiHome.py +++ b/module/plugins/hooks/MultiHome.py @@ -13,8 +13,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . - - @author: mkaay """ from time import time @@ -25,12 +23,16 @@ from module.plugins.Hook import Hook class MultiHome(Hook): __name__ = "MultiHome" __version__ = "0.11" - __description__ = """Ip address changer""" + __type__ = "hook" + __config__ = [("activated", "bool", "Activated", False), ("interfaces", "str", "Interfaces", "None")] + + __description__ = """Ip address changer""" __author_name__ = "mkaay" __author_mail__ = "mkaay@mkaay.de" + def setup(self): self.register = {} self.interfaces = [] diff --git a/module/plugins/hooks/MultishareCz.py b/module/plugins/hooks/MultishareCz.py index 0291738f5..8baa4bb07 100644 --- a/module/plugins/hooks/MultishareCz.py +++ b/module/plugins/hooks/MultishareCz.py @@ -10,15 +10,18 @@ class MultishareCz(MultiHoster): __name__ = "MultishareCz" __version__ = "0.04" __type__ = "hook" + __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("hosterList", "str", "Hoster list (comma separated)", "uloz.to")] + __description__ = """MultiShare.cz hook plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" HOSTER_PATTERN = r']*?alt="([^"]+)">\s*[^>]*?alt="OK"' + def getHoster(self): page = getURL("http://www.multishare.cz/monitoring/") return re.findall(self.HOSTER_PATTERN, page) diff --git a/module/plugins/hooks/OverLoadMe.py b/module/plugins/hooks/OverLoadMe.py index e15d0b05f..dcc57aa75 100644 --- a/module/plugins/hooks/OverLoadMe.py +++ b/module/plugins/hooks/OverLoadMe.py @@ -8,16 +8,19 @@ class OverLoadMe(MultiHoster): __name__ = "OverLoadMe" __version__ = "0.01" __type__ = "hook" + __config__ = [("activated", "bool", "Activated", False), ("https", "bool", "Enable HTTPS", True), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), ("hosterList", "str", "Hoster list (comma separated)", ""), ("unloadFailing", "bool", "Revert to standard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 12)] + __description__ = """Over-Load.me hook plugin""" __author_name__ = "marley" __author_mail__ = "marley@over-load.me" + def getHoster(self): https = "https" if self.getConfig("https") else "http" page = getURL(https + "://api.over-load.me/hoster.php", diff --git a/module/plugins/hooks/Premium4Me.py b/module/plugins/hooks/Premium4Me.py index 57b188bb9..242e72f3e 100644 --- a/module/plugins/hooks/Premium4Me.py +++ b/module/plugins/hooks/Premium4Me.py @@ -12,10 +12,12 @@ class Premium4Me(MultiHoster): __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for downloads from supported hosters:", "all"), ("hosterList", "str", "Hoster list (comma separated)", "")] + __description__ = """Premium.to hook plugin""" __author_name__ = ("RaNaN", "zoidberg", "stickell") __author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz", "l.stickell@yahoo.it") + def getHoster(self): page = getURL("http://premium.to/api/hosters.php?authcode=%s" % self.account.authcode) return [x.strip() for x in page.replace("\"", "").split(";")] diff --git a/module/plugins/hooks/PremiumizeMe.py b/module/plugins/hooks/PremiumizeMe.py index 9f1a70a70..1a35460de 100644 --- a/module/plugins/hooks/PremiumizeMe.py +++ b/module/plugins/hooks/PremiumizeMe.py @@ -10,7 +10,6 @@ class PremiumizeMe(MultiHoster): __name__ = "PremiumizeMe" __version__ = "0.12" __type__ = "hook" - __description__ = """Premiumize.me hook plugin""" __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), @@ -18,9 +17,11 @@ class PremiumizeMe(MultiHoster): ("unloadFailing", "bool", "Revert to stanard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 24)] + __description__ = """Premiumize.me hook plugin""" __author_name__ = "Florian Franzen" __author_mail__ = "FlorianFranzen@gmail.com" + def getHoster(self): # If no accounts are available there will be no hosters available if not self.account or not self.account.canUse(): diff --git a/module/plugins/hooks/RPNetBiz.py b/module/plugins/hooks/RPNetBiz.py index 54f814231..36cf69b4b 100644 --- a/module/plugins/hooks/RPNetBiz.py +++ b/module/plugins/hooks/RPNetBiz.py @@ -9,15 +9,18 @@ class RPNetBiz(MultiHoster): __name__ = "RPNetBiz" __version__ = "0.1" __type__ = "hook" - __description__ = """RPNet.biz hook plugin""" + __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), ("hosterList", "str", "Hoster list (comma separated)", ""), ("unloadFailing", "bool", "Revert to stanard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 24)] + + __description__ = """RPNet.biz hook plugin""" __author_name__ = "Dman" __author_mail__ = "dmanugm@gmail.com" + def getHoster(self): # No hosts supported if no account if not self.account or not self.account.canUse(): diff --git a/module/plugins/hooks/RealdebridCom.py b/module/plugins/hooks/RealdebridCom.py index 566f9005f..4477fba4a 100644 --- a/module/plugins/hooks/RealdebridCom.py +++ b/module/plugins/hooks/RealdebridCom.py @@ -15,10 +15,12 @@ class RealdebridCom(MultiHoster): ("hosterList", "str", "Hoster list (comma separated)", ""), ("unloadFailing", "bool", "Revert to stanard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 24)] + __description__ = """Real-Debrid.com hook plugin""" __author_name__ = "Devirex Hazzard" __author_mail__ = "naibaf_11@yahoo.de" + def getHoster(self): https = "https" if self.getConfig("https") else "http" page = getURL(https + "://real-debrid.com/api/hosters.php").replace("\"", "").strip() diff --git a/module/plugins/hooks/RehostTo.py b/module/plugins/hooks/RehostTo.py index 6c3a77ca3..0841e07a6 100644 --- a/module/plugins/hooks/RehostTo.py +++ b/module/plugins/hooks/RehostTo.py @@ -19,6 +19,7 @@ class RehostTo(MultiHoster): __author_name__ = "RaNaN" __author_mail__ = "RaNaN@pyload.org" + def getHoster(self): page = getURL("http://rehost.to/api.php?cmd=get_supported_och_dl&long_ses=%s" % self.long_ses) return [x.strip() for x in page.replace("\"", "").split(",")] diff --git a/module/plugins/hooks/RestartFailed.py b/module/plugins/hooks/RestartFailed.py index 3ee2aeed4..2bd0e28db 100644 --- a/module/plugins/hooks/RestartFailed.py +++ b/module/plugins/hooks/RestartFailed.py @@ -20,9 +20,12 @@ from module.plugins.Hook import Hook class RestartFailed(Hook): __name__ = "RestartFailed" __version__ = "1.55" - __description__ = """Periodically restart all failed downloads in queue""" + __type__ = "hook" + __config__ = [("activated", "bool", "Activated", False), ("interval", "int", "Check interval in minutes", 90)] + + __description__ = """Periodically restart all failed downloads in queue""" __author_name__ = "Walter Purcaro" __author_mail__ = "vuolter@gmail.com" diff --git a/module/plugins/hooks/SimplyPremiumCom.py b/module/plugins/hooks/SimplyPremiumCom.py index 60d164c66..dbba3d1e9 100644 --- a/module/plugins/hooks/SimplyPremiumCom.py +++ b/module/plugins/hooks/SimplyPremiumCom.py @@ -24,15 +24,18 @@ class SimplyPremiumCom(MultiHoster): __name__ = "SimplyPremiumCom" __version__ = "0.02" __type__ = "hook" + __config__ = [("activated", "bool", "Activated", "False"), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("hosterList", "str", "Hoster list (comma separated)", ""), ("unloadFailing", "bool", "Revert to standard download if download fails", "False"), ("interval", "int", "Reload interval in hours (0 to disable)", "24")] + __description__ = """Simply-Premium.Com hook plugin""" __author_name__ = "EvolutionClip" __author_mail__ = "evolutionclip@live.de" + def getHoster(self): json_data = getURL('http://www.simply-premium.com/api/hosts.php?format=json&online=1') json_data = json_loads(json_data) diff --git a/module/plugins/hooks/SimplydebridCom.py b/module/plugins/hooks/SimplydebridCom.py index a523d2404..345d37e4a 100644 --- a/module/plugins/hooks/SimplydebridCom.py +++ b/module/plugins/hooks/SimplydebridCom.py @@ -8,13 +8,16 @@ class SimplydebridCom(MultiHoster): __name__ = "SimplydebridCom" __version__ = "0.01" __type__ = "hook" + __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("hosterList", "str", "Hoster list (comma separated)", "")] + __description__ = """Simply-Debrid.com hook plugin""" __author_name__ = "Kagenoshin" __author_mail__ = "kagenoshin@gmx.ch" + def getHoster(self): page = getURL("http://simply-debrid.com/api.php?list=1") return [x.strip() for x in page.rstrip(';').replace("\"", "").split(";")] diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index af6039ecd..f25482b79 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -13,8 +13,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . - - @author: hgg """ from os.path import basename @@ -26,10 +24,14 @@ from module.PyFile import PyFile class UnSkipOnFail(Hook): __name__ = 'UnSkipOnFail' __version__ = '0.01' - __description__ = """When a download fails, restart skipped duplicates""" + __type__ = "hook" + __config__ = [("activated", "bool", "Activated", True)] + + __description__ = """When a download fails, restart skipped duplicates""" __author_name__ = "hagg" - __author_mail__ = "" + __author_mail__ = None + def downloadFailed(self, pyfile): pyfile_name = basename(pyfile.name) diff --git a/module/plugins/hooks/UnrestrictLi.py b/module/plugins/hooks/UnrestrictLi.py index 4f8f11625..3303c7355 100644 --- a/module/plugins/hooks/UnrestrictLi.py +++ b/module/plugins/hooks/UnrestrictLi.py @@ -23,6 +23,7 @@ class UnrestrictLi(MultiHoster): __name__ = "UnrestrictLi" __version__ = "0.02" __type__ = "hook" + __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("hosterList", "str", "Hoster list (comma separated)", ""), @@ -34,6 +35,7 @@ class UnrestrictLi(MultiHoster): __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" + def getHoster(self): json_data = getURL('http://unrestrict.li/api/jdownloader/hosts.php?format=json') json_data = json_loads(json_data) diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index f017acd92..242659d9e 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -15,12 +15,15 @@ from module.plugins.Hook import Expose, Hook, threaded class UpdateManager(Hook): __name__ = "UpdateManager" __version__ = "0.31" - __description__ = """Check for updates""" + __type__ = "hook" + __config__ = [("activated", "bool", "Activated", True), ("mode", "pyLoad + plugins;plugins only", "Check updates for", "pyLoad + plugins"), ("interval", "int", "Check interval in hours", 8), ("reloadplugins", "bool", "Monitor plugins for code changes (debug mode only)", True), ("nodebugupdate", "bool", "Don't check for updates in debug mode", True)] + + __description__ = """Check for updates""" __author_name__ = "Walter Purcaro" __author_mail__ = "vuolter@gmail.com" diff --git a/module/plugins/hooks/WindowsPhoneToastNotify.py b/module/plugins/hooks/WindowsPhoneToastNotify.py index 7c005fcbb..25fa3abe5 100644 --- a/module/plugins/hooks/WindowsPhoneToastNotify.py +++ b/module/plugins/hooks/WindowsPhoneToastNotify.py @@ -13,8 +13,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . - - @author: RaNaN, Godofdream, zoidberg """ import time import httplib @@ -24,15 +22,19 @@ from module.plugins.Hook import Hook class WindowsPhoneToastNotify(Hook): __name__ = "WindowsPhoneToastNotify" __version__ = "0.02" - __description__ = """Send push notifications to Windows Phone""" - __author_name__ = "Andy Voigt" - __author_mail__ = "phone-support@hotmail.de" + __type__ = "hook" + __config__ = [("activated", "bool", "Activated", False), ("force", "bool", "Force even if client is connected", False), ("pushId", "str", "pushId", ""), ("pushUrl", "str", "pushUrl", ""), ("pushTimeout", "int", "Timeout between notifications in seconds", 0)] + __description__ = """Send push notifications to Windows Phone""" + __author_name__ = "Andy Voigt" + __author_mail__ = "phone-support@hotmail.de" + + def setup(self): self.info = {} diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 19ecc08b6..09d035e10 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -9,14 +9,17 @@ class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __version__ = "0.11" __type__ = "hook" + __config__ = [("activated", "bool", "Activated", True), ("loadDefault", "bool", "Include default (built-in) hoster list", True), ("includeList", "str", "Include hosters (comma separated)", ""), ("excludeList", "str", "Exclude hosters (comma separated)", "")] + __description__ = """XFileSharingPro hook plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" + def coreReady(self): self.loadPattern() diff --git a/module/plugins/hooks/XMPPInterface.py b/module/plugins/hooks/XMPPInterface.py index 5ecf4e153..7b179d41a 100644 --- a/module/plugins/hooks/XMPPInterface.py +++ b/module/plugins/hooks/XMPPInterface.py @@ -13,9 +13,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . - - @author: RaNaN - @interface-version: 0.2 """ from pyxmpp import streamtls @@ -30,7 +27,8 @@ from module.plugins.hooks.IRCInterface import IRCInterface class XMPPInterface(IRCInterface, JabberClient): __name__ = "XMPPInterface" __version__ = "0.11" - __description__ = """Connect to jabber and let owner perform different tasks""" + __type__ = "hook" + __config__ = [("activated", "bool", "Activated", False), ("jid", "str", "Jabber ID", "user@exmaple-jabber-server.org"), ("pw", "str", "Password", ""), @@ -39,9 +37,12 @@ class XMPPInterface(IRCInterface, JabberClient): ("info_file", "bool", "Inform about every file finished", False), ("info_pack", "bool", "Inform about every package finished", True), ("captcha", "bool", "Send captcha requests", True)] + + __description__ = """Connect to jabber and let owner perform different tasks""" __author_name__ = "RaNaN" __author_mail__ = "RaNaN@pyload.org" + implements(IMessageHandlersProvider) def __init__(self, core, manager): diff --git a/module/plugins/hooks/ZeveraCom.py b/module/plugins/hooks/ZeveraCom.py index 4dee83ccb..49fc68b30 100644 --- a/module/plugins/hooks/ZeveraCom.py +++ b/module/plugins/hooks/ZeveraCom.py @@ -8,13 +8,16 @@ class ZeveraCom(MultiHoster): __name__ = "ZeveraCom" __version__ = "0.02" __type__ = "hook" + __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("hosterList", "str", "Hoster list (comma separated)", "")] + __description__ = """Real-Debrid.com hook plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" + def getHoster(self): page = getURL("http://www.zevera.com/jDownloader.ashx?cmd=gethosters") return [x.strip() for x in page.replace("\"", "").split(",")] -- cgit v1.2.3 From 5060e4c6374a5116d0d8b02528f910f8c5f8bcf9 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 15 Jul 2014 16:25:41 +0200 Subject: Fix code indentation, some bad whitespaces and missing authors + use 'not' instead 'is None' + replace __pattern__'s r" with r' + other minor cosmetics --- module/plugins/hooks/BypassCaptcha.py | 1 + module/plugins/hooks/CaptchaBrotherhood.py | 1 + module/plugins/hooks/DeleteFinished.py | 8 ++++---- module/plugins/hooks/DownloadScheduler.py | 2 +- module/plugins/hooks/Ev0InFetcher.py | 2 ++ module/plugins/hooks/HotFolder.py | 1 - module/plugins/hooks/IRCInterface.py | 3 +-- module/plugins/hooks/ImageTyperz.py | 1 + module/plugins/hooks/MultiHome.py | 1 + module/plugins/hooks/SimplyPremiumCom.py | 7 +++---- module/plugins/hooks/UnSkipOnFail.py | 4 ++-- module/plugins/hooks/XMPPInterface.py | 2 +- 12 files changed, 18 insertions(+), 15 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index 1c9c4e722..05cf29500 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -27,6 +27,7 @@ PYLOAD_KEY = "4f771155b640970d5607f919a615bdefc67e7d32" class BypassCaptchaException(Exception): + def __init__(self, err): self.err = err diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py index 86768b76b..b413bdb59 100644 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ b/module/plugins/hooks/CaptchaBrotherhood.py @@ -29,6 +29,7 @@ from module.plugins.Hook import Hook class CaptchaBrotherhoodException(Exception): + def __init__(self, err): self.err = err diff --git a/module/plugins/hooks/DeleteFinished.py b/module/plugins/hooks/DeleteFinished.py index 48b262392..1c80facc9 100644 --- a/module/plugins/hooks/DeleteFinished.py +++ b/module/plugins/hooks/DeleteFinished.py @@ -20,8 +20,8 @@ from module.plugins.Hook import Hook class DeleteFinished(Hook): - __name__ = 'DeleteFinished' - __version__ = '1.09' + __name__ = "DeleteFinished" + __version__ = "1.09" __type__ = "hook" __config__ = [('activated', 'bool', 'Activated', 'False'), @@ -29,8 +29,8 @@ class DeleteFinished(Hook): ('deloffline', 'bool', 'Delete packages with offline links', 'False')] __description__ = """Automatically delete all finished packages from queue""" - __author_name__ = ('Walter Purcaro') - __author_mail__ = ('vuolter@gmail.com') + __author_name__ = "Walter Purcaro" + __author_mail__ = "vuolter@gmail.com" ## overwritten methods ## diff --git a/module/plugins/hooks/DownloadScheduler.py b/module/plugins/hooks/DownloadScheduler.py index 070c0634e..dbc1019e3 100644 --- a/module/plugins/hooks/DownloadScheduler.py +++ b/module/plugins/hooks/DownloadScheduler.py @@ -43,7 +43,7 @@ class DownloadScheduler(Hook): self.updateSchedule() def updateSchedule(self, schedule=None): - if schedule is None: + if not schedule: schedule = self.getConfig("timetable") schedule = re.findall("(\d{1,2}):(\d{2})[\s]*(-?\d+)", diff --git a/module/plugins/hooks/Ev0InFetcher.py b/module/plugins/hooks/Ev0InFetcher.py index d2caa19ac..3a98abbf7 100644 --- a/module/plugins/hooks/Ev0InFetcher.py +++ b/module/plugins/hooks/Ev0InFetcher.py @@ -57,7 +57,9 @@ class Ev0InFetcher(Hook): continue return [] + def periodical(self): + def normalizefiletitle(filename): filename = filename.replace('.', ' ') filename = filename.replace('_', ' ') diff --git a/module/plugins/hooks/HotFolder.py b/module/plugins/hooks/HotFolder.py index bd57712af..08ef93812 100644 --- a/module/plugins/hooks/HotFolder.py +++ b/module/plugins/hooks/HotFolder.py @@ -46,7 +46,6 @@ class HotFolder(Hook): self.interval = 10 def periodical(self): - if not exists(join(self.getConfig("folder"), "finished")): makedirs(join(self.getConfig("folder"), "finished")) diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index 41ca352a4..7dbe835c7 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -311,12 +311,10 @@ class IRCInterface(Thread, Hook): return lines def event_start(self, args): - self.api.unpauseServer() return ["INFO: Starting downloads."] def event_stop(self, args): - self.api.pauseServer() return ["INFO: No new downloads will be started."] @@ -415,6 +413,7 @@ class IRCInterface(Thread, Hook): class IRCError(Exception): + def __init__(self, value): self.value = value diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py index 3c23f9567..794db3913 100644 --- a/module/plugins/hooks/ImageTyperz.py +++ b/module/plugins/hooks/ImageTyperz.py @@ -25,6 +25,7 @@ from module.plugins.Hook import Hook class ImageTyperzException(Exception): + def __init__(self, err): self.err = err diff --git a/module/plugins/hooks/MultiHome.py b/module/plugins/hooks/MultiHome.py index 5a7e53b0d..31bbbcc9a 100644 --- a/module/plugins/hooks/MultiHome.py +++ b/module/plugins/hooks/MultiHome.py @@ -73,6 +73,7 @@ class MultiHome(Hook): class Interface(object): + def __init__(self, adress): self.adress = adress self.history = {} diff --git a/module/plugins/hooks/SimplyPremiumCom.py b/module/plugins/hooks/SimplyPremiumCom.py index dbba3d1e9..41268e231 100644 --- a/module/plugins/hooks/SimplyPremiumCom.py +++ b/module/plugins/hooks/SimplyPremiumCom.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- - ############################################################################ # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU Affero General Public License as # @@ -15,9 +14,9 @@ # along with this program. If not, see . # ############################################################################ -from module.plugins.internal.MultiHoster import MultiHoster -from module.network.RequestFactory import getURL from module.common.json_layer import json_loads +from module.network.RequestFactory import getURL +from module.plugins.internal.MultiHoster import MultiHoster class SimplyPremiumCom(MultiHoster): @@ -31,7 +30,7 @@ class SimplyPremiumCom(MultiHoster): ("unloadFailing", "bool", "Revert to standard download if download fails", "False"), ("interval", "int", "Reload interval in hours (0 to disable)", "24")] - __description__ = """Simply-Premium.Com hook plugin""" + __description__ = """Simply-Premium.com hook plugin""" __author_name__ = "EvolutionClip" __author_mail__ = "evolutionclip@live.de" diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index f25482b79..d40854e99 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -22,8 +22,8 @@ from module.PyFile import PyFile class UnSkipOnFail(Hook): - __name__ = 'UnSkipOnFail' - __version__ = '0.01' + __name__ = "UnSkipOnFail" + __version__ = "0.01" __type__ = "hook" __config__ = [("activated", "bool", "Activated", True)] diff --git a/module/plugins/hooks/XMPPInterface.py b/module/plugins/hooks/XMPPInterface.py index 7b179d41a..57a997a4b 100644 --- a/module/plugins/hooks/XMPPInterface.py +++ b/module/plugins/hooks/XMPPInterface.py @@ -130,7 +130,7 @@ class XMPPInterface(IRCInterface, JabberClient): subject = stanza.get_subject() body = stanza.get_body() t = stanza.get_type() - self.logDebug(u'pyLoad XMPP: Message from %s received.' % (unicode(stanza.get_from(), ))) + self.logDebug(u'pyLoad XMPP: Message from %s received.' % (unicode(stanza.get_from(),))) self.logDebug(u'pyLoad XMPP: Body: %s Subject: %s Type: %s' % (body, subject, t)) if t == "headline": -- cgit v1.2.3 From 7b8c458cca7d21a029620f98e453f746fce69cd1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 14 Jul 2014 16:10:01 +0200 Subject: Prefer single quote for dict key name --- module/plugins/hooks/BypassCaptcha.py | 6 +++--- module/plugins/hooks/Captcha9kw.py | 8 ++++---- module/plugins/hooks/CaptchaBrotherhood.py | 4 ++-- module/plugins/hooks/Checksum.py | 18 +++++++++--------- module/plugins/hooks/DeathByCaptcha.py | 6 +++--- module/plugins/hooks/EasybytezCom.py | 6 +++--- module/plugins/hooks/ExpertDecoders.py | 6 +++--- module/plugins/hooks/ExternalScripts.py | 12 ++++++------ module/plugins/hooks/ExtractArchive.py | 14 +++++++------- module/plugins/hooks/IRCInterface.py | 24 ++++++++++++------------ module/plugins/hooks/ImageTyperz.py | 4 ++-- module/plugins/hooks/LinkdecrypterCom.py | 6 +++--- module/plugins/hooks/MegaDebridEu.py | 2 +- module/plugins/hooks/MergeFiles.py | 12 ++++++------ module/plugins/hooks/MultiHome.py | 2 +- module/plugins/hooks/RehostTo.py | 4 ++-- module/plugins/hooks/UpdateManager.py | 18 +++++++++--------- module/plugins/hooks/XFileSharingPro.py | 8 ++++---- module/plugins/hooks/XMPPInterface.py | 8 ++------ 19 files changed, 82 insertions(+), 86 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index 05cf29500..5ac117818 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -125,11 +125,11 @@ class BypassCaptcha(Hook): def captchaCorrect(self, task): if task.data['service'] == self.__name__ and "ticket" in task.data: - self.respond(task.data["ticket"], True) + self.respond(task.data['ticket'], True) def captchaInvalid(self, task): if task.data['service'] == self.__name__ and "ticket" in task.data: - self.respond(task.data["ticket"], False) + self.respond(task.data['ticket'], False) def processCaptcha(self, task): c = task.captchaFile @@ -139,5 +139,5 @@ class BypassCaptcha(Hook): task.error = e.getCode() return - task.data["ticket"] = ticket + task.data['ticket'] = ticket task.setResult(result) diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index 28bce3d2b..b4e3ad34b 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -60,7 +60,7 @@ class Captcha9kw(Hook): if response.isdigit(): self.logInfo(_("%s credits left") % response) - self.info["credits"] = credits = int(response) + self.info['credits'] = credits = int(response) return credits else: self.logError(response) @@ -106,7 +106,7 @@ class Captcha9kw(Hook): time.sleep(3) result = response2 - task.data["ticket"] = response + task.data['ticket'] = response self.logInfo("result %s : %s" % (response, result)) task.setResult(result) else: @@ -142,7 +142,7 @@ class Captcha9kw(Hook): "correct": "1", "pyload": "1", "source": "pyload", - "id": task.data["ticket"]}) + "id": task.data['ticket']}) self.logInfo("Request correct: %s" % response) except BadHeader, e: @@ -161,7 +161,7 @@ class Captcha9kw(Hook): "correct": "2", "pyload": "1", "source": "pyload", - "id": task.data["ticket"]}) + "id": task.data['ticket']}) self.logInfo("Request refund: %s" % response) except BadHeader, e: diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py index b413bdb59..54dfbe4d6 100644 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ b/module/plugins/hooks/CaptchaBrotherhood.py @@ -71,7 +71,7 @@ class CaptchaBrotherhood(Hook): else: credits = int(response[3:]) self.logInfo(_("%d credits left") % credits) - self.info["credits"] = credits + self.info['credits'] = credits return credits def submit(self, captcha, captchaType="file", match=None): @@ -167,5 +167,5 @@ class CaptchaBrotherhood(Hook): task.error = e.getCode() return - task.data["ticket"] = ticket + task.data['ticket'] = ticket task.setResult(result) diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index 8566a847e..a51eb4b47 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -80,7 +80,7 @@ class Checksum(Hook): self.algorithms = sorted( getattr(hashlib, "algorithms", ("md5", "sha1", "sha224", "sha256", "sha384", "sha512")), reverse=True) self.algorithms.extend(["crc32", "adler32"]) - self.formats = self.algorithms + ['sfv', 'crc', 'hash'] + self.formats = self.algorithms + ["sfv", "crc", "hash"] def downloadFinished(self, pyfile): """ @@ -158,15 +158,15 @@ class Checksum(Hook): download_folder = save_join(self.config['general']['download_folder'], pypack.folder, "") for link in pypack.getChildren().itervalues(): - file_type = splitext(link["name"])[1][1:].lower() + file_type = splitext(link['name'])[1][1:].lower() #self.logDebug(link, file_type) if file_type not in self.formats: continue - hash_file = fs_encode(save_join(download_folder, link["name"])) + hash_file = fs_encode(save_join(download_folder, link['name'])) if not isfile(hash_file): - self.logWarning("File not found: %s" % link["name"]) + self.logWarning("File not found: %s" % link['name']) continue with open(hash_file) as f: @@ -174,14 +174,14 @@ class Checksum(Hook): for m in re.finditer(self.regexps.get(file_type, self.regexps['default']), text): data = m.groupdict() - self.logDebug(link["name"], data) + self.logDebug(link['name'], data) - local_file = fs_encode(save_join(download_folder, data["name"])) + local_file = fs_encode(save_join(download_folder, data['name'])) algorithm = self.methods.get(file_type, file_type) checksum = computeChecksum(local_file, algorithm) - if checksum == data["hash"]: + if checksum == data['hash']: self.logInfo('File integrity of "%s" verified by %s checksum (%s).' % - (data["name"], algorithm, checksum)) + (data['name'], algorithm, checksum)) else: self.logWarning("%s checksum for file %s does not match (%s != %s)" % - (algorithm, data["name"], checksum, data["hash"])) + (algorithm, data['name'], checksum, data['hash'])) diff --git a/module/plugins/hooks/DeathByCaptcha.py b/module/plugins/hooks/DeathByCaptcha.py index 5a5ab7933..64ed2280f 100644 --- a/module/plugins/hooks/DeathByCaptcha.py +++ b/module/plugins/hooks/DeathByCaptcha.py @@ -183,7 +183,7 @@ class DeathByCaptcha(Hook): self.logError(e.getDesc()) return False - balance, rate = self.info["balance"], self.info["rate"] + balance, rate = self.info['balance'], self.info['rate'] self.logInfo("Account balance: US$%.3f (%d captchas left at %.2f cents each)" % (balance / 100, balance // rate, rate)) @@ -196,7 +196,7 @@ class DeathByCaptcha(Hook): def captchaInvalid(self, task): if task.data['service'] == self.__name__ and "ticket" in task.data: try: - response = self.call_api("captcha/%d/report" % task.data["ticket"], True) + response = self.call_api("captcha/%d/report" % task.data['ticket'], True) except DeathByCaptchaException, e: self.logError(e.getDesc()) except Exception, e: @@ -211,5 +211,5 @@ class DeathByCaptcha(Hook): self.logError(e.getDesc()) return - task.data["ticket"] = ticket + task.data['ticket'] = ticket task.setResult(result) diff --git a/module/plugins/hooks/EasybytezCom.py b/module/plugins/hooks/EasybytezCom.py index d3cda7b80..533301a4e 100644 --- a/module/plugins/hooks/EasybytezCom.py +++ b/module/plugins/hooks/EasybytezCom.py @@ -32,6 +32,6 @@ class EasybytezCom(MultiHoster): except Exception, e: self.logDebug(e) self.logWarning("Unable to load supported hoster list, using last known") - return ['bitshare.com', 'crocko.com', 'ddlstorage.com', 'depositfiles.com', 'extabit.com', 'hotfile.com', - 'mediafire.com', 'netload.in', 'rapidgator.net', 'rapidshare.com', 'uploading.com', 'uload.to', - 'uploaded.to'] + return ["bitshare.com", "crocko.com", "ddlstorage.com", "depositfiles.com", "extabit.com", "hotfile.com", + "mediafire.com", "netload.in", "rapidgator.net", "rapidshare.com", "uploading.com", "uload.to", + "uploaded.to"] diff --git a/module/plugins/hooks/ExpertDecoders.py b/module/plugins/hooks/ExpertDecoders.py index 65edd487b..9e151f8f6 100644 --- a/module/plugins/hooks/ExpertDecoders.py +++ b/module/plugins/hooks/ExpertDecoders.py @@ -51,14 +51,14 @@ class ExpertDecoders(Hook): if response.isdigit(): self.logInfo(_("%s credits left") % response) - self.info["credits"] = credits = int(response) + self.info['credits'] = credits = int(response) return credits else: self.logError(response) return 0 def processCaptcha(self, task): - task.data["ticket"] = ticket = uuid4() + task.data['ticket'] = ticket = uuid4() result = None with open(task.captchaFile, 'rb') as f: @@ -102,7 +102,7 @@ class ExpertDecoders(Hook): try: response = getURL(self.API_URL, post={"action": "refund", "key": self.getConfig("passkey"), - "gen_task_id": task.data["ticket"]}) + "gen_task_id": task.data['ticket']}) self.logInfo("Request refund: %s" % response) except BadHeader, e: diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index 55aae1093..7f76df1cd 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -40,9 +40,9 @@ class ExternalScripts(Hook): def setup(self): self.scripts = {} - folders = ['download_preparing', 'download_finished', 'package_finished', - 'before_reconnect', 'after_reconnect', 'unrar_finished', - 'all_dls_finished', 'all_dls_processed'] + folders = ["download_preparing", "download_finished", "package_finished", + "before_reconnect", "after_reconnect", "unrar_finished", + "all_dls_finished", "all_dls_processed"] for folder in folders: self.scripts[folder] = [] @@ -106,13 +106,13 @@ class ExternalScripts(Hook): self.callScript(script, ip) def unrarFinished(self, folder, fname): - for script in self.scripts["unrar_finished"]: + for script in self.scripts['unrar_finished']: self.callScript(script, folder, fname) def allDownloadsFinished(self): - for script in self.scripts["all_dls_finished"]: + for script in self.scripts['all_dls_finished']: self.callScript(script) def allDownloadsProcessed(self): - for script in self.scripts["all_dls_processed"]: + for script in self.scripts['all_dls_processed']: self.callScript(script) diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index a2e7d1dac..c307deb8f 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -163,7 +163,7 @@ class ExtractArchive(Hook): if not exists(out): makedirs(out) - files_ids = [(save_join(dl, p.folder, x["name"]), x["id"]) for x in p.getChildren().itervalues()] + files_ids = [(save_join(dl, p.folder, x['name']), x['id']) for x in p.getChildren().itervalues()] matched = False # check as long there are unseen files @@ -307,15 +307,15 @@ class ExtractArchive(Hook): if not exists(f): continue try: - if self.config["permission"]["change_file"]: + if self.config['permission']['change_file']: if isfile(f): - chmod(f, int(self.config["permission"]["file"], 8)) + chmod(f, int(self.config['permission']['file'], 8)) elif isdir(f): - chmod(f, int(self.config["permission"]["folder"], 8)) + chmod(f, int(self.config['permission']['folder'], 8)) - if self.config["permission"]["change_dl"] and os.name != "nt": - uid = getpwnam(self.config["permission"]["user"])[2] - gid = getgrnam(self.config["permission"]["group"])[2] + if self.config['permission']['change_dl'] and os.name != "nt": + uid = getpwnam(self.config['permission']['user'])[2] + gid = getgrnam(self.config['permission']['group'])[2] chown(f, uid, gid) except Exception, e: self.logWarning(_("Setting User and Group failed"), e) diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index 7dbe835c7..9a9bab9b4 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -155,25 +155,25 @@ class IRCInterface(Thread, Hook): self.handle_events(msg) def handle_events(self, msg): - if not msg["origin"].split("!", 1)[0] in self.getConfig("owner").split(): + if not msg['origin'].split("!", 1)[0] in self.getConfig("owner").split(): return - if msg["target"].split("!", 1)[0] != self.getConfig("nick"): + if msg['target'].split("!", 1)[0] != self.getConfig("nick"): return - if msg["action"] != "PRIVMSG": + if msg['action'] != "PRIVMSG": return # HANDLE CTCP ANTI FLOOD/BOT PROTECTION - if msg["text"] == "\x01VERSION\x01": + if msg['text'] == "\x01VERSION\x01": self.logDebug("Sending CTCP VERSION.") self.sock.send("NOTICE %s :%s\r\n" % (msg['origin'], "pyLoad! IRC Interface")) return - elif msg["text"] == "\x01TIME\x01": + elif msg['text'] == "\x01TIME\x01": self.logDebug("Sending CTCP TIME.") self.sock.send("NOTICE %s :%d\r\n" % (msg['origin'], time.time())) return - elif msg["text"] == "\x01LAG\x01": + elif msg['text'] == "\x01LAG\x01": self.logDebug("Received CTCP LAG.") # don't know how to answer return @@ -181,7 +181,7 @@ class IRCInterface(Thread, Hook): args = None try: - temp = msg["text"].split() + temp = msg['text'].split() trigger = temp[0] if len(temp) > 1: args = temp[1:] @@ -192,7 +192,7 @@ class IRCInterface(Thread, Hook): try: res = handler(args) for line in res: - self.response(line, msg["origin"]) + self.response(line, msg['origin']) except Exception, e: self.logError("pyLoad IRC: " + repr(e)) @@ -258,7 +258,7 @@ class IRCInterface(Thread, Hook): def event_info(self, args): if not args: - return ['ERROR: Use info like this: info '] + return ["ERROR: Use info like this: info "] info = None try: @@ -271,7 +271,7 @@ class IRCInterface(Thread, Hook): def event_packinfo(self, args): if not args: - return ['ERROR: Use packinfo like this: packinfo '] + return ["ERROR: Use packinfo like this: packinfo "] lines = [] pack = None @@ -321,7 +321,7 @@ class IRCInterface(Thread, Hook): def event_add(self, args): if len(args) < 2: return ['ERROR: Add links like this: "add links". ', - 'This will add the link to to the package / the package with id !'] + "This will add the link to to the package / the package with id !"] pack = args[0].strip() links = [x.strip() for x in args[1:]] @@ -336,7 +336,7 @@ class IRCInterface(Thread, Hook): #TODO add links - return ["INFO: Added %d links to Package %s [#%d]" % (len(links), pack["name"], id)] + return ["INFO: Added %d links to Package %s [#%d]" % (len(links), pack['name'], id)] except: # create new package diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py index 794db3913..4d7be96e3 100644 --- a/module/plugins/hooks/ImageTyperz.py +++ b/module/plugins/hooks/ImageTyperz.py @@ -136,7 +136,7 @@ class ImageTyperz(Hook): if task.data['service'] == self.__name__ and "ticket" in task.data: response = getURL(self.RESPOND_URL, post={"action": "SETBADIMAGE", "username": self.getConfig("username"), "password": self.getConfig("passkey"), - "imageid": task.data["ticket"]}) + "imageid": task.data['ticket']}) if response == "SUCCESS": self.logInfo("Bad captcha solution received, requested refund") @@ -151,5 +151,5 @@ class ImageTyperz(Hook): task.error = e.getCode() return - task.data["ticket"] = ticket + task.data['ticket'] = ticket task.setResult(result) diff --git a/module/plugins/hooks/LinkdecrypterCom.py b/module/plugins/hooks/LinkdecrypterCom.py index 75995faf2..d6acac4a9 100644 --- a/module/plugins/hooks/LinkdecrypterCom.py +++ b/module/plugins/hooks/LinkdecrypterCom.py @@ -48,7 +48,7 @@ class LinkdecrypterCom(Hook): return builtin = [name.lower() for name in self.core.pluginManager.crypterPlugins.keys()] - builtin.extend(["downloadserienjunkiesorg"]) + builtin.append("downloadserienjunkiesorg") crypter_pattern = re.compile("(\w[\w.-]+)") online = [] @@ -64,7 +64,7 @@ class LinkdecrypterCom(Hook): regexp = r"https?://([^.]+\.)*?(%s)/.*" % "|".join(online) dict = self.core.pluginManager.crypterPlugins[self.__name__] - dict["pattern"] = regexp - dict["re"] = re.compile(regexp) + dict['pattern'] = regexp + dict['re'] = re.compile(regexp) self.logDebug("REGEXP: " + regexp) diff --git a/module/plugins/hooks/MegaDebridEu.py b/module/plugins/hooks/MegaDebridEu.py index 31be74fdd..22945cc0f 100644 --- a/module/plugins/hooks/MegaDebridEu.py +++ b/module/plugins/hooks/MegaDebridEu.py @@ -36,7 +36,7 @@ class MegaDebridEu(MultiHoster): reponse = getURL('http://www.mega-debrid.eu/api.php?action=getHosters') json_data = json_loads(reponse) - if json_data["response_code"] == "ok": + if json_data['response_code'] == "ok": host_list = [element[0] for element in json_data['hosters']] else: self.logError("Unable to retrieve hoster list") diff --git a/module/plugins/hooks/MergeFiles.py b/module/plugins/hooks/MergeFiles.py index e7bd63d17..5d6c208a7 100644 --- a/module/plugins/hooks/MergeFiles.py +++ b/module/plugins/hooks/MergeFiles.py @@ -47,12 +47,12 @@ class MergeFiles(Hook): files = {} fid_dict = {} for fid, data in pack.getChildren().iteritems(): - if re.search("\.[0-9]{3}$", data["name"]): - if data["name"][:-4] not in files: - files[data["name"][:-4]] = [] - files[data["name"][:-4]].append(data["name"]) - files[data["name"][:-4]].sort() - fid_dict[data["name"]] = fid + if re.search("\.[0-9]{3}$", data['name']): + if data['name'][:-4] not in files: + files[data['name'][:-4]] = [] + files[data['name'][:-4]].append(data['name']) + files[data['name'][:-4]].sort() + fid_dict[data['name']] = fid download_folder = self.config['general']['download_folder'] diff --git a/module/plugins/hooks/MultiHome.py b/module/plugins/hooks/MultiHome.py index 31bbbcc9a..b9c663046 100644 --- a/module/plugins/hooks/MultiHome.py +++ b/module/plugins/hooks/MultiHome.py @@ -38,7 +38,7 @@ class MultiHome(Hook): self.interfaces = [] self.parseInterfaces(self.getConfig("interfaces").split(";")) if not self.interfaces: - self.parseInterfaces([self.config["download"]["interface"]]) + self.parseInterfaces([self.config['download']['interface']]) self.setConfig("interfaces", self.toConfig()) def toConfig(self): diff --git a/module/plugins/hooks/RehostTo.py b/module/plugins/hooks/RehostTo.py index 0841e07a6..96e06950e 100644 --- a/module/plugins/hooks/RehostTo.py +++ b/module/plugins/hooks/RehostTo.py @@ -34,7 +34,7 @@ class RehostTo(MultiHoster): return data = self.account.getAccountInfo(user) - self.ses = data["ses"] - self.long_ses = data["long_ses"] + self.ses = data['ses'] + self.long_ses = data['long_ses'] return MultiHoster.coreReady(self) diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 242659d9e..b6ba853a7 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -95,7 +95,7 @@ class UpdateManager(Hook): return True if self.core.pluginManager.reloadPlugins(reloads) else False def periodical(self): - if not self.info["pyload"] and not (self.getConfig("nodebugupdate") and self.core.debug): + if not self.info['pyload'] and not (self.getConfig("nodebugupdate") and self.core.debug): self.updating = True self.update(onlyplugin=True if self.getConfig("mode") == "plugins only" else False) self.updating = False @@ -127,15 +127,15 @@ class UpdateManager(Hook): newversion = data[0] self.logInfo(_("*** New pyLoad Version %s available ***") % newversion) self.logInfo(_("*** Get it here: https://github.com/pyload/pyload/releases ***")) - r = self.info["pyload"] = True - self.info["version"] = newversion + r = self.info['pyload'] = True + self.info['version'] = newversion return r @threaded def _updatePlugins(self, updates): """ check for plugin updates """ - if self.info["plugins"]: + if self.info['plugins']: return False #: plugins were already updated updated = [] @@ -152,9 +152,9 @@ class UpdateManager(Hook): data = sorted(map(lambda x: dict(zip(schema, x.split('|'))), updates), key=itemgetter("type", "name")) for plugin in data: - filename = plugin["name"] - prefix = plugin["type"] - version = plugin["version"] + filename = plugin['name'] + prefix = plugin['type'] + version = plugin['version'] if filename.endswith(".pyc"): name = filename[:filename.find("_")] @@ -169,7 +169,7 @@ class UpdateManager(Hook): plugins = getattr(self.core.pluginManager, "%sPlugins" % type) - oldver = float(plugins[name]["v"]) if name in plugins else None + oldver = float(plugins[name]['v']) if name in plugins else None newver = float(version) if not oldver: @@ -213,7 +213,7 @@ class UpdateManager(Hook): self.logInfo(_("Plugins updated and reloaded")) else: self.logInfo(_("*** Plugins have been updated, pyLoad will be restarted now ***")) - self.info["plugins"] = True + self.info['plugins'] = True self.scheduler.addJob(4, self.core.api.restart(), threaded=False) #: risky, but pyload doesn't let more return True else: diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 09d035e10..37a464b33 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -64,8 +64,8 @@ class XFileSharingPro(Hook): #self.logDebug(regexp) dict = self.core.pluginManager.hosterPlugins['XFileSharingPro'] - dict["pattern"] = regexp - dict["re"] = re.compile(regexp) + dict['pattern'] = regexp + dict['re'] = re.compile(regexp) self.logDebug("Pattern loaded - handling %d hosters" % len(hosterList)) def getConfigSet(self, option): @@ -74,5 +74,5 @@ class XFileSharingPro(Hook): def unload(self): dict = self.core.pluginManager.hosterPlugins['XFileSharingPro'] - dict["pattern"] = r"^unmatchable$" - dict["re"] = re.compile(r"^unmatchable$") + dict['pattern'] = r'^unmatchable$' + dict['re'] = re.compile(r'^unmatchable$') diff --git a/module/plugins/hooks/XMPPInterface.py b/module/plugins/hooks/XMPPInterface.py index 57a997a4b..a60d31b89 100644 --- a/module/plugins/hooks/XMPPInterface.py +++ b/module/plugins/hooks/XMPPInterface.py @@ -121,9 +121,7 @@ class XMPPInterface(IRCInterface, JabberClient): The handlers returned will be called when matching message is received in a client session.""" - return [ - ("normal", self.message), - ] + return [("normal", self.message)] def message(self, stanza): """Message handler for the component.""" @@ -231,9 +229,7 @@ class VersionHandler(object): def get_iq_get_handlers(self): """Return list of tuples (element_name, namespace, handler) describing handlers of stanzas""" - return [ - ("query", "jabber:iq:version", self.get_version), - ] + return [("query", "jabber:iq:version", self.get_version)] def get_iq_set_handlers(self): """Return empty list, as this class provides no stanza handler.""" -- cgit v1.2.3 From 0ec49b88b61490f3247a87dd610547a5dd5eb121 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 15 Jul 2014 01:36:58 +0200 Subject: [UpdateManager] Fix https://github.com/pyload/pyload/issues/687 --- module/plugins/hooks/UpdateManager.py | 84 ++++++++++++++++++++--------------- 1 file changed, 49 insertions(+), 35 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index b6ba853a7..e67a784bd 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -import sys import re +import sys from operator import itemgetter from os import remove, stat @@ -14,7 +14,7 @@ from module.plugins.Hook import Expose, Hook, threaded class UpdateManager(Hook): __name__ = "UpdateManager" - __version__ = "0.31" + __version__ = "0.32" __type__ = "hook" __config__ = [("activated", "bool", "Activated", True), @@ -27,11 +27,11 @@ class UpdateManager(Hook): __author_name__ = "Walter Purcaro" __author_mail__ = "vuolter@gmail.com" + event_list = ["pluginConfigChanged"] + SERVER_URL = "http://updatemanager.pyload.org" MIN_INTERVAL = 3 * 60 * 60 #: 3h minimum check interval (value is in seconds) - event_list = ["pluginConfigChanged"] - def pluginConfigChanged(self, plugin, name, value): if name == "interval": @@ -60,11 +60,10 @@ class UpdateManager(Hook): self.info = {"pyload": False, "version": None, "plugins": False} self.mtimes = {} #: store modification time for each plugin - def periodical2(self): if not self.updating: self.autoreloadPlugins() - self.cb2 = self.scheduler.addJob(10, self.periodical2, threaded=True) + self.cb2 = self.scheduler.addJob(4, self.periodical2, threaded=False) @Expose def autoreloadPlugins(self): @@ -72,7 +71,8 @@ class UpdateManager(Hook): modules = filter( lambda m: m and (m.__name__.startswith("module.plugins.") or m.__name__.startswith("userplugins.")) and - m.__name__.count(".") >= 2, sys.modules.itervalues()) + m.__name__.count(".") >= 2, sys.modules.itervalues() + ) reloads = [] @@ -96,16 +96,23 @@ class UpdateManager(Hook): def periodical(self): if not self.info['pyload'] and not (self.getConfig("nodebugupdate") and self.core.debug): - self.updating = True - self.update(onlyplugin=True if self.getConfig("mode") == "plugins only" else False) - self.updating = False + self.updateThread() - def server_response(self): + def server_request(self): try: return getURL(self.SERVER_URL, get={'v': self.core.api.getServerVersion()}).splitlines() except: self.logWarning(_("Unable to contact server to get updates")) + @threaded + def updateThread(self): + self.updating = True + status = self.update(onlyplugin=True if self.getConfig("mode") == "plugins only" else False) + if status == 2: + self.core.api.restart() + else: + self.updating = False + @Expose def updatePlugins(self): """ simple wrapper for calling plugin update quickly """ @@ -114,24 +121,24 @@ class UpdateManager(Hook): @Expose def update(self, onlyplugin=False): """ check for updates """ - data = self.server_response() + data = self.server_request() if not data: - r = False + exitcode = 0 elif data[0] == "None": self.logInfo(_("No new pyLoad version available")) updates = data[1:] - r = self._updatePlugins(updates) + exitcode = self._updatePlugins(updates) elif onlyplugin: - r = False + exitcode = 0 else: newversion = data[0] self.logInfo(_("*** New pyLoad Version %s available ***") % newversion) self.logInfo(_("*** Get it here: https://github.com/pyload/pyload/releases ***")) - r = self.info['pyload'] = True + exitcode = 3 + self.info['pyload'] = True self.info['version'] = newversion - return r + return exitcode #: 0 = No plugins updated; 1 = Plugins updated; 2 = Plugins updated, but restart required; 3 = No plugins updated, new pyLoad version available - @threaded def _updatePlugins(self, updates): """ check for plugin updates """ @@ -150,8 +157,8 @@ class UpdateManager(Hook): blacklist = None updates = updates[2:] - data = sorted(map(lambda x: dict(zip(schema, x.split('|'))), updates), key=itemgetter("type", "name")) - for plugin in data: + upgradable = sorted(map(lambda x: dict(zip(schema, x.split('|'))), updates), key=itemgetter("type", "name")) + for plugin in upgradable: filename = plugin['name'] prefix = plugin['type'] version = plugin['version'] @@ -200,9 +207,14 @@ class UpdateManager(Hook): self.logError(_("Error updating plugin %s") % filename, str(e)) if blacklist: - removed = self.removePlugins(map(lambda x: x.split('|'), blacklist)) + blacklisted = sorted(map(lambda x: x.split('|'), blacklist)) + for t, n in blacklisted: + if t == "hook": + self.manager.deactivateHook(n) + + removed = self.removePlugins(blacklisted) for t, n in removed: - self.logInfo(_("Removed blacklisted plugin: [%(type)s] %(name)s") % { + self.logInfo(_("Removed blacklisted plugin [%(type)s] %(name)s") % { "type": t, "name": n }) @@ -211,18 +223,21 @@ class UpdateManager(Hook): reloaded = self.core.pluginManager.reloadPlugins(updated) if reloaded: self.logInfo(_("Plugins updated and reloaded")) + exitcode = 1 else: - self.logInfo(_("*** Plugins have been updated, pyLoad will be restarted now ***")) + self.logInfo(_("*** Plugins have been updated, but need a pyLoad restart to be reloaded ***")) self.info['plugins'] = True - self.scheduler.addJob(4, self.core.api.restart(), threaded=False) #: risky, but pyload doesn't let more - return True + exitcode = 2 else: self.logInfo(_("No plugin updates available")) - return False + exitcode = 0 + + return exitcode #: 0 = No plugins updated; 1 = Plugins updated; 2 = Plugins updated, but restart required @Expose def removePlugins(self, type_plugins): - """ delete plugins under userplugins directory""" + """ delete plugins from disk""" + if not type_plugins: return None @@ -231,17 +246,16 @@ class UpdateManager(Hook): removed = [] for type, name in type_plugins: - py = join("userplugins", type, name) - pyc = join("userplugins", type, name.replace('.py', '.pyc')) id = (type, name) + pyfile = join("userplugins", type, name) + pycfile = pyfile.replace(".py", ".pyc") try: - if isfile(py): - remove(py) - if isfile(pyc): - remove(pyc) + if isfile(pyfile): + remove(pyfile) + removed.append(id) + if isfile(pycfile): + remove(pycfile) except Exception, e: self.logError("Error deleting %s" % id, str(e)) - else: - removed.append(id) return removed #: return a list of the plugins successfully removed -- cgit v1.2.3 From 05d258d98dd8c2faf0b769840fa1e3c4acccdce8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 20 Jul 2014 03:25:14 +0200 Subject: Fix and improve 5060e4c6374a5116d0d8b02528f910f8c5f8bcf9 --- module/plugins/hooks/DownloadScheduler.py | 2 +- module/plugins/hooks/IRCInterface.py | 5 +---- module/plugins/hooks/LinkdecrypterCom.py | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/DownloadScheduler.py b/module/plugins/hooks/DownloadScheduler.py index dbc1019e3..070c0634e 100644 --- a/module/plugins/hooks/DownloadScheduler.py +++ b/module/plugins/hooks/DownloadScheduler.py @@ -43,7 +43,7 @@ class DownloadScheduler(Hook): self.updateSchedule() def updateSchedule(self, schedule=None): - if not schedule: + if schedule is None: schedule = self.getConfig("timetable") schedule = re.findall("(\d{1,2}):(\d{2})[\s]*(-?\d+)", diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index 9a9bab9b4..a29874469 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -59,12 +59,9 @@ class IRCInterface(Thread, Hook): self.api = core.api # todo, only use api def coreReady(self): - self.new_package = {} - self.abort = False - - self.links_added = 0 self.more = [] + self.new_package = {} self.start() diff --git a/module/plugins/hooks/LinkdecrypterCom.py b/module/plugins/hooks/LinkdecrypterCom.py index d6acac4a9..4e08372fe 100644 --- a/module/plugins/hooks/LinkdecrypterCom.py +++ b/module/plugins/hooks/LinkdecrypterCom.py @@ -43,7 +43,7 @@ class LinkdecrypterCom(Hook): def loadPatterns(self): page = getURL("http://linkdecrypter.com/") m = re.search(r'Supported\(\d+\): ([^+<]*)', page) - if not m: + if m is None: self.logError(_("Crypter list not found")) return -- cgit v1.2.3 From b5eda37f8b7e540ae6581fd612aa7e0ec7c1e9b2 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 20 Jul 2014 03:32:28 +0200 Subject: [UpdateManager] Rewritten removePlugins method + protect from self-removing --- module/plugins/hooks/UpdateManager.py | 58 +++++++++++++++++++++++------------ 1 file changed, 39 insertions(+), 19 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index e67a784bd..6ed756d13 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -5,16 +5,17 @@ import sys from operator import itemgetter from os import remove, stat -from os.path import join, isfile +from os.path import isfile from time import time from module.network.RequestFactory import getURL from module.plugins.Hook import Expose, Hook, threaded +from module.utils import save_join class UpdateManager(Hook): __name__ = "UpdateManager" - __version__ = "0.32" + __version__ = "0.33" __type__ = "hook" __config__ = [("activated", "bool", "Activated", True), @@ -63,7 +64,7 @@ class UpdateManager(Hook): def periodical2(self): if not self.updating: self.autoreloadPlugins() - self.cb2 = self.scheduler.addJob(4, self.periodical2, threaded=False) + self.cb2 = self.scheduler.addJob(10, self.periodical2, threaded=False) @Expose def autoreloadPlugins(self): @@ -197,7 +198,7 @@ class UpdateManager(Hook): content = getURL(url % plugin) m = vre.search(content) if m and m.group(2) == version: - f = open(join("userplugins", prefix, filename), "wb") + f = open(save_join("userplugins", prefix, filename), "wb") f.write(content) f.close() updated.append((prefix, name)) @@ -207,10 +208,13 @@ class UpdateManager(Hook): self.logError(_("Error updating plugin %s") % filename, str(e)) if blacklist: - blacklisted = sorted(map(lambda x: x.split('|'), blacklist)) - for t, n in blacklisted: - if t == "hook": - self.manager.deactivateHook(n) + blacklisted = sorted(map(lambda x: (x.split('|')[0], x.split('|')[1].rsplit('.', 1)[0]), blacklist)) + + # Always protect UpdateManager from self-removing + try: + blacklisted.remove(("hook", "UpdateManager")) + except: + pass removed = self.removePlugins(blacklisted) for t, n in removed: @@ -246,16 +250,32 @@ class UpdateManager(Hook): removed = [] for type, name in type_plugins: - id = (type, name) - pyfile = join("userplugins", type, name) - pycfile = pyfile.replace(".py", ".pyc") - try: - if isfile(pyfile): - remove(pyfile) - removed.append(id) - if isfile(pycfile): - remove(pycfile) - except Exception, e: - self.logError("Error deleting %s" % id, str(e)) + rflag = False + py_file = name + ".py" + pyc_file = name + ".pyc" + + for root in ("userplugins", save_join(pypath, "module", "plugins")): + py_filename = save_join(root, type, py_file) + pyc_filename = save_join(root, type, pyc_file) + + if isfile(py_filename): + try: + remove(py_filename) + except Exception, e: + self.logError("Error deleting file %s" % py_filename, str(e)) + rflag = False + else: + rflag = True + + if isfile(pyc_filename): + try: + if type == "hook": + self.manager.deactivateHook(name) + remove(pyc_filename) + except Exception, e: + self.logError("Error deleting file %s" % pyc_filename, str(e)) + if rflag: + id = (type, name) + removed.append(id) return removed #: return a list of the plugins successfully removed -- cgit v1.2.3 From 9395182da7afed55a29bde1c7cbefe4204e783f0 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 20 Jul 2014 03:02:09 +0200 Subject: Store all re.search/match object as "m" instead "found" --- module/plugins/hooks/EasybytezCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/EasybytezCom.py b/module/plugins/hooks/EasybytezCom.py index 533301a4e..1cf5e40ae 100644 --- a/module/plugins/hooks/EasybytezCom.py +++ b/module/plugins/hooks/EasybytezCom.py @@ -27,8 +27,8 @@ class EasybytezCom(MultiHoster): req = self.account.getAccountRequest(user) page = req.load("http://www.easybytez.com") - found = re.search(r'\s*Supported sites:(.*)', page) - return found.group(1).split(',') + m = re.search(r'\s*Supported sites:(.*)', page) + return m.group(1).split(',') except Exception, e: self.logDebug(e) self.logWarning("Unable to load supported hoster list, using last known") -- cgit v1.2.3 From 36b5bfedc2e57bd000831559ca8fb4d7e7899e24 Mon Sep 17 00:00:00 2001 From: tjeh Date: Sun, 20 Jul 2014 21:49:27 +0200 Subject: Added support for Multihosters.com multihoster. --- module/plugins/hooks/MultihostersCom.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 module/plugins/hooks/MultihostersCom.py (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/MultihostersCom.py b/module/plugins/hooks/MultihostersCom.py new file mode 100644 index 000000000..5ada3aa56 --- /dev/null +++ b/module/plugins/hooks/MultihostersCom.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- + +from module.network.RequestFactory import getURL +from module.plugins.internal.MultiHoster import MultiHoster + +class MultihostersCom(MultiHoster): + __name__ = "MultihostersCom" + __version__ = "0.01" + __type__ = "hook" + __config__ = [("activated", "bool", "Activated", False), + ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), + ("hosterList", "str", "Hoster list (comma separated)", ""), + ("unloadFailing", "bool", "Revert to standard download if download fails", False), + ("interval", "int", "Reload interval in hours (0 to disable)", 24)] + + __description__ = """Multihosters.com hook plugin""" + __author_name__ = "tjeh" + __author_mail__ = "tjeh@gmx.net" + + def getHoster(self): + page = getURL("http://www.multihosters.com/jDownloader.ashx?cmd=gethosters") + return [x.strip() for x in page.split(",")] \ No newline at end of file -- cgit v1.2.3 From 77c7afff0fb6d89911a5ec2ca5751cdb266698db Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 1 Aug 2014 17:01:16 +0200 Subject: [UpdateManager] Disable reloadplugins schedule on plugin deactivation --- module/plugins/hooks/UpdateManager.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 6ed756d13..5f71ad6fa 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -15,8 +15,8 @@ from module.utils import save_join class UpdateManager(Hook): __name__ = "UpdateManager" - __version__ = "0.33" __type__ = "hook" + __version__ = "0.34" __config__ = [("activated", "bool", "Activated", True), ("mode", "pyLoad + plugins;plugins only", "Check updates for", "pyLoad + plugins"), @@ -53,6 +53,9 @@ class UpdateManager(Hook): self.pluginConfigChanged(self.__name__, "interval", self.getConfig("interval")) self.pluginConfigChanged(self.__name__, "reloadplugins", self.getConfig("reloadplugins")) + def unload(self): + self.pluginConfigChanged(self.__name__, "reloadplugins", False) + def setup(self): self.scheduler = self.core.scheduler self.cb2 = None @@ -181,7 +184,7 @@ class UpdateManager(Hook): newver = float(version) if not oldver: - msg = "New version of [%(type)s] %(name)s (v%(newver)s)" + msg = "New [%(type)s] %(name)s (v%(newver)s)" elif newver > oldver: msg = "New version of [%(type)s] %(name)s (v%(oldver)s -> v%(newver)s)" else: -- cgit v1.2.3 From ba916633f2bedb04c7358000b91aed69f52e8e43 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 1 Aug 2014 19:35:59 +0200 Subject: Remove trailing whitespaces + remove license headers + import urllib methods directly + sort and fix key attributes + use save_join instead join + sort some import declarations + other minor code cosmetics --- module/plugins/hooks/AlldebridCom.py | 4 +--- module/plugins/hooks/BypassCaptcha.py | 28 +++++------------------ module/plugins/hooks/Captcha9kw.py | 24 +++++--------------- module/plugins/hooks/CaptchaBrotherhood.py | 26 +++++---------------- module/plugins/hooks/Checksum.py | 23 +++++-------------- module/plugins/hooks/ClickAndLoad.py | 17 +------------- module/plugins/hooks/DeathByCaptcha.py | 29 +++++++----------------- module/plugins/hooks/DebridItaliaCom.py | 16 +------------ module/plugins/hooks/DeleteFinished.py | 17 +------------- module/plugins/hooks/DownloadScheduler.py | 18 ++------------- module/plugins/hooks/EasybytezCom.py | 2 +- module/plugins/hooks/Ev0InFetcher.py | 17 ++------------ module/plugins/hooks/ExpertDecoders.py | 23 ++++--------------- module/plugins/hooks/ExternalScripts.py | 18 ++------------- module/plugins/hooks/ExtractArchive.py | 21 +++++++++-------- module/plugins/hooks/FastixRu.py | 6 ++--- module/plugins/hooks/FreeWayMe.py | 17 +------------- module/plugins/hooks/HotFolder.py | 27 +++++----------------- module/plugins/hooks/IRCInterface.py | 28 ++++++----------------- module/plugins/hooks/ImageTyperz.py | 24 +++++--------------- module/plugins/hooks/LinkdecrypterCom.py | 19 ++-------------- module/plugins/hooks/LinksnappyCom.py | 6 ++--- module/plugins/hooks/MegaDebridEu.py | 20 +++-------------- module/plugins/hooks/MergeFiles.py | 30 ++++++------------------- module/plugins/hooks/MultiDebridCom.py | 20 +++-------------- module/plugins/hooks/MultiHome.py | 17 +------------- module/plugins/hooks/MultishareCz.py | 2 +- module/plugins/hooks/OverLoadMe.py | 2 +- module/plugins/hooks/Premium4Me.py | 2 +- module/plugins/hooks/PremiumizeMe.py | 9 ++++---- module/plugins/hooks/RPNetBiz.py | 8 +++---- module/plugins/hooks/RealdebridCom.py | 2 +- module/plugins/hooks/RehostTo.py | 2 +- module/plugins/hooks/RestartFailed.py | 16 +------------ module/plugins/hooks/SimplyPremiumCom.py | 16 +------------ module/plugins/hooks/SimplydebridCom.py | 2 +- module/plugins/hooks/UnSkipOnFail.py | 20 +++-------------- module/plugins/hooks/UnrestrictLi.py | 20 +++-------------- module/plugins/hooks/UpdateManager.py | 4 ++-- module/plugins/hooks/WindowsPhoneToastNotify.py | 19 +++------------- module/plugins/hooks/XFileSharingPro.py | 2 +- module/plugins/hooks/XMPPInterface.py | 19 ++-------------- module/plugins/hooks/ZeveraCom.py | 2 +- 43 files changed, 126 insertions(+), 518 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/AlldebridCom.py b/module/plugins/hooks/AlldebridCom.py index 1ef9b252a..906875a69 100644 --- a/module/plugins/hooks/AlldebridCom.py +++ b/module/plugins/hooks/AlldebridCom.py @@ -1,15 +1,13 @@ # -*- coding: utf-8 -*- -# should be working - from module.network.RequestFactory import getURL from module.plugins.internal.MultiHoster import MultiHoster class AlldebridCom(MultiHoster): __name__ = "AlldebridCom" - __version__ = "0.13" __type__ = "hook" + __version__ = "0.13" __config__ = [("activated", "bool", "Activated", False), ("https", "bool", "Enable HTTPS", False), diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index 5ac117818..d62de24a7 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -1,30 +1,12 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . -""" - -from thread import start_new_thread from pycurl import FORM_FILE, LOW_SPEED_TIME +from thread import start_new_thread -from module.network.RequestFactory import getURL, getRequest from module.network.HTTPRequest import BadHeader - +from module.network.RequestFactory import getURL, getRequest from module.plugins.Hook import Hook -PYLOAD_KEY = "4f771155b640970d5607f919a615bdefc67e7d32" - class BypassCaptchaException(Exception): @@ -43,8 +25,8 @@ class BypassCaptchaException(Exception): class BypassCaptcha(Hook): __name__ = "BypassCaptcha" - __version__ = "0.04" __type__ = "hook" + __version__ = "0.04" __config__ = [("activated", "bool", "Activated", False), ("force", "bool", "Force BC even if client is connected", False), @@ -54,6 +36,8 @@ class BypassCaptcha(Hook): __author_name__ = ("RaNaN", "Godofdream", "zoidberg") __author_mail__ = ("RaNaN@pyload.org", "soilfcition@gmail.com", "zoidberg@mujmail.cz") + PYLOAD_KEY = "4f771155b640970d5607f919a615bdefc67e7d32" + SUBMIT_URL = "http://bypasscaptcha.com/upload.php" RESPOND_URL = "http://bypasscaptcha.com/check_value.php" GETCREDITS_URL = "http://bypasscaptcha.com/ex_left.php" @@ -76,7 +60,7 @@ class BypassCaptcha(Hook): try: response = req.load(self.SUBMIT_URL, - post={"vendor_key": PYLOAD_KEY, + post={"vendor_key": self.PYLOAD_KEY, "key": self.getConfig("passkey"), "gen_task_id": "1", "file": (FORM_FILE, captcha)}, diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index b4e3ad34b..1b7406edd 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -1,35 +1,21 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . -""" from __future__ import with_statement -from thread import start_new_thread -from base64 import b64encode import time -from module.network.RequestFactory import getURL -from module.network.HTTPRequest import BadHeader +from base64 import b64encode +from thread import start_new_thread +from module.network.HTTPRequest import BadHeader +from module.network.RequestFactory import getURL from module.plugins.Hook import Hook class Captcha9kw(Hook): __name__ = "Captcha9kw" - __version__ = "0.09" __type__ = "hook" + __version__ = "0.09" __config__ = [("activated", "bool", "Activated", False), ("force", "bool", "Force CT even if client is connected", True), diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py index 54dfbe4d6..e240cbbc0 100644 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ b/module/plugins/hooks/CaptchaBrotherhood.py @@ -1,28 +1,14 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . -""" from __future__ import with_statement -from thread import start_new_thread - -import pycurl import StringIO -from urllib import urlencode -from time import sleep +import pycurl + from PIL import Image +from thread import start_new_thread +from time import sleep +from urllib import urlencode from module.network.RequestFactory import getURL, getRequest from module.plugins.Hook import Hook @@ -45,8 +31,8 @@ class CaptchaBrotherhoodException(Exception): class CaptchaBrotherhood(Hook): __name__ = "CaptchaBrotherhood" - __version__ = "0.05" __type__ = "hook" + __version__ = "0.05" __config__ = [("activated", "bool", "Activated", False), ("username", "str", "Username", ""), diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index a51eb4b47..0fe2ae88c 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -1,29 +1,16 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . -""" - from __future__ import with_statement + import hashlib +import re import zlib + from os import remove from os.path import getsize, isfile, splitext -import re -from module.utils import save_join, fs_encode from module.plugins.Hook import Hook +from module.utils import save_join, fs_encode def computeChecksum(local_file, algorithm): @@ -52,8 +39,8 @@ def computeChecksum(local_file, algorithm): class Checksum(Hook): __name__ = "Checksum" - __version__ = "0.12" __type__ = "hook" + __version__ = "0.12" __config__ = [("activated", "bool", "Activated", False), ("check_action", "fail;retry;nothing", "What to do if check fails?", "retry"), diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py index 3c47d30ce..5c523caf7 100644 --- a/module/plugins/hooks/ClickAndLoad.py +++ b/module/plugins/hooks/ClickAndLoad.py @@ -1,20 +1,5 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . -""" - import socket import thread @@ -23,8 +8,8 @@ from module.plugins.Hook import Hook class ClickAndLoad(Hook): __name__ = "ClickAndLoad" - __version__ = "0.22" __type__ = "hook" + __version__ = "0.22" __config__ = [("activated", "bool", "Activated", True), ("extern", "bool", "Allow external link adding", False)] diff --git a/module/plugins/hooks/DeathByCaptcha.py b/module/plugins/hooks/DeathByCaptcha.py index 64ed2280f..530395d32 100644 --- a/module/plugins/hooks/DeathByCaptcha.py +++ b/module/plugins/hooks/DeathByCaptcha.py @@ -1,31 +1,18 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . -""" from __future__ import with_statement -from thread import start_new_thread +import re + +from base64 import b64encode from pycurl import FORM_FILE, HTTPHEADER +from thread import start_new_thread from time import sleep -from base64 import b64encode -import re -from module.network.RequestFactory import getRequest +from module.common.json_layer import json_loads from module.network.HTTPRequest import BadHeader +from module.network.RequestFactory import getRequest from module.plugins.Hook import Hook -from module.common.json_layer import json_loads class DeathByCaptchaException(Exception): @@ -59,8 +46,8 @@ class DeathByCaptchaException(Exception): class DeathByCaptcha(Hook): __name__ = "DeathByCaptcha" - __version__ = "0.03" __type__ = "hook" + __version__ = "0.03" __config__ = [("activated", "bool", "Activated", False), ("username", "str", "Username", ""), @@ -134,7 +121,7 @@ class DeathByCaptcha(Hook): raise DeathByCaptchaException('service-overload') def submit(self, captcha, captchaType="file", match=None): - #workaround multipart-post bug in HTTPRequest.py + #workaround multipart-post bug in HTTPRequest.py if re.match("^[A-Za-z0-9]*$", self.getConfig("passkey")): multipart = True data = (FORM_FILE, captcha) diff --git a/module/plugins/hooks/DebridItaliaCom.py b/module/plugins/hooks/DebridItaliaCom.py index 1a081da7a..88efb6b2a 100644 --- a/module/plugins/hooks/DebridItaliaCom.py +++ b/module/plugins/hooks/DebridItaliaCom.py @@ -1,26 +1,12 @@ # -*- coding: utf-8 -*- -############################################################################ -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero General Public License as # -# published by the Free Software Foundation, either version 3 of the # -# License, or (at your option) any later version. # -# # -# This program is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see . # -############################################################################ from module.plugins.internal.MultiHoster import MultiHoster class DebridItaliaCom(MultiHoster): __name__ = "DebridItaliaCom" - __version__ = "0.07" __type__ = "hook" + __version__ = "0.07" __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), diff --git a/module/plugins/hooks/DeleteFinished.py b/module/plugins/hooks/DeleteFinished.py index 1c80facc9..bc926906f 100644 --- a/module/plugins/hooks/DeleteFinished.py +++ b/module/plugins/hooks/DeleteFinished.py @@ -1,28 +1,13 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . -""" - from module.database import style from module.plugins.Hook import Hook class DeleteFinished(Hook): __name__ = "DeleteFinished" - __version__ = "1.09" __type__ = "hook" + __version__ = "1.09" __config__ = [('activated', 'bool', 'Activated', 'False'), ('interval', 'int', 'Delete every (hours)', '72'), diff --git a/module/plugins/hooks/DownloadScheduler.py b/module/plugins/hooks/DownloadScheduler.py index 070c0634e..a3d70b3ab 100644 --- a/module/plugins/hooks/DownloadScheduler.py +++ b/module/plugins/hooks/DownloadScheduler.py @@ -1,21 +1,7 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - You should have received a copy of the GNU General Public License - along with this program; if not, see . - - Original idea by new.cze -""" - import re + from time import localtime from module.plugins.Hook import Hook @@ -23,8 +9,8 @@ from module.plugins.Hook import Hook class DownloadScheduler(Hook): __name__ = "DownloadScheduler" - __version__ = "0.21" __type__ = "hook" + __version__ = "0.21" __config__ = [("activated", "bool", "Activated", False), ("timetable", "str", "List time periods as hh:mm full or number(kB/s)", diff --git a/module/plugins/hooks/EasybytezCom.py b/module/plugins/hooks/EasybytezCom.py index 1cf5e40ae..da37297d9 100644 --- a/module/plugins/hooks/EasybytezCom.py +++ b/module/plugins/hooks/EasybytezCom.py @@ -7,8 +7,8 @@ from module.plugins.internal.MultiHoster import MultiHoster class EasybytezCom(MultiHoster): __name__ = "EasybytezCom" - __version__ = "0.03" __type__ = "hook" + __version__ = "0.03" __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), diff --git a/module/plugins/hooks/Ev0InFetcher.py b/module/plugins/hooks/Ev0InFetcher.py index 3a98abbf7..c54c38bc6 100644 --- a/module/plugins/hooks/Ev0InFetcher.py +++ b/module/plugins/hooks/Ev0InFetcher.py @@ -1,29 +1,16 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . -""" from time import mktime, time from module.lib import feedparser + from module.plugins.Hook import Hook class Ev0InFetcher(Hook): __name__ = "Ev0InFetcher" - __version__ = "0.21" __type__ = "hook" + __version__ = "0.21" __config__ = [("activated", "bool", "Activated", False), ("interval", "int", "Check interval in minutes", 10), diff --git a/module/plugins/hooks/ExpertDecoders.py b/module/plugins/hooks/ExpertDecoders.py index 9e151f8f6..c7ab80da0 100644 --- a/module/plugins/hooks/ExpertDecoders.py +++ b/module/plugins/hooks/ExpertDecoders.py @@ -1,36 +1,21 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . -""" from __future__ import with_statement -from thread import start_new_thread +from base64 import b64encode from pycurl import LOW_SPEED_TIME +from thread import start_new_thread from uuid import uuid4 -from base64 import b64encode -from module.network.RequestFactory import getURL, getRequest from module.network.HTTPRequest import BadHeader - +from module.network.RequestFactory import getURL, getRequest from module.plugins.Hook import Hook class ExpertDecoders(Hook): __name__ = "ExpertDecoders" - __version__ = "0.01" __type__ = "hook" + __version__ = "0.01" __config__ = [("activated", "bool", "Activated", False), ("force", "bool", "Force CT even if client is connected", False), diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index 7f76df1cd..8d03d27d4 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -1,21 +1,7 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . -""" - import subprocess + from os import listdir, access, X_OK, makedirs from os.path import join, exists, basename, abspath @@ -25,8 +11,8 @@ from module.utils import save_join class ExternalScripts(Hook): __name__ = "ExternalScripts" - __version__ = "0.23" __type__ = "hook" + __version__ = "0.23" __config__ = [("activated", "bool", "Activated", True)] diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index c307deb8f..144829459 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -1,19 +1,18 @@ # -*- coding: utf-8 -*- -import sys import os +import sys + +from copy import copy from os import remove, chmod, makedirs -from os.path import exists, basename, isfile, isdir, join +from os.path import exists, basename, isfile, isdir from traceback import print_exc -from copy import copy # monkey patch bug in python 2.6 and lower -# see 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": - from subprocess import Popen import errno + from subprocess import Popen def _eintr_retry_call(func, *args): while True: @@ -44,13 +43,13 @@ if sys.version_info < (2, 7) and os.name != "nt": Popen.wait = wait if os.name != "nt": + from grp import getgrnam from os import chown from pwd import getpwnam - from grp import getgrnam -from module.utils import save_join, fs_encode from module.plugins.Hook import Hook, threaded, Expose from module.plugins.internal.AbstractExtractor import ArchiveError, CRCError, WrongPassword +from module.utils import save_join, fs_encode class ExtractArchive(Hook): @@ -58,8 +57,8 @@ class ExtractArchive(Hook): Provides: unrarFinished (folder, filename) """ __name__ = "ExtractArchive" - __version__ = "0.16" __type__ = "hook" + __version__ = "0.16" __config__ = [("activated", "bool", "Activated", True), ("fullpath", "bool", "Extract full path", True), @@ -158,7 +157,7 @@ class ExtractArchive(Hook): #relative to package folder if destination is relative, otherwise absolute path overwrites them if self.getConfig("subfolder"): - out = join(out, fs_encode(p.folder)) + out = save_join(out, fs_encode(p.folder)) if not exists(out): makedirs(out) diff --git a/module/plugins/hooks/FastixRu.py b/module/plugins/hooks/FastixRu.py index aa020ea37..879dba277 100644 --- a/module/plugins/hooks/FastixRu.py +++ b/module/plugins/hooks/FastixRu.py @@ -1,16 +1,14 @@ # -*- coding: utf-8 -*- -# should be working - +from module.common.json_layer import json_loads from module.network.RequestFactory import getURL from module.plugins.internal.MultiHoster import MultiHoster -from module.common.json_layer import json_loads class FastixRu(MultiHoster): __name__ = "FastixRu" - __version__ = "0.02" __type__ = "hook" + __version__ = "0.02" __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), diff --git a/module/plugins/hooks/FreeWayMe.py b/module/plugins/hooks/FreeWayMe.py index 3d2f7fcef..12d58ac8a 100644 --- a/module/plugins/hooks/FreeWayMe.py +++ b/module/plugins/hooks/FreeWayMe.py @@ -1,28 +1,13 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . -""" - from module.network.RequestFactory import getURL from module.plugins.internal.MultiHoster import MultiHoster class FreeWayMe(MultiHoster): __name__ = "FreeWayMe" - __version__ = "0.11" __type__ = "hook" + __version__ = "0.11" __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), diff --git a/module/plugins/hooks/HotFolder.py b/module/plugins/hooks/HotFolder.py index 08ef93812..4c81292e3 100644 --- a/module/plugins/hooks/HotFolder.py +++ b/module/plugins/hooks/HotFolder.py @@ -1,35 +1,18 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . -""" - -from os import makedirs -from os import listdir -from os.path import exists -from os.path import join -from os.path import isfile -from shutil import move import time +from os import listdir, makedirs +from os.path import exists, isfile, join +from shutil import move + from module.plugins.Hook import Hook class HotFolder(Hook): __name__ = "HotFolder" - __version__ = "0.11" __type__ = "hook" + __version__ = "0.11" __config__ = [("activated", "bool", "Activated", False), ("folder", "str", "Folder to observe", "container"), diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index a29874469..7ebc0275f 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -1,39 +1,25 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . -""" +import re +import socket +import time +from pycurl import FORM_FILE from select import select -import socket from threading import Thread -import time from time import sleep from traceback import print_exc -import re -from pycurl import FORM_FILE -from module.plugins.Hook import Hook +from module.Api import PackageDoesNotExists, FileDoesNotExists from module.network.RequestFactory import getURL +from module.plugins.Hook import Hook from module.utils import formatSize -from module.Api import PackageDoesNotExists, FileDoesNotExists class IRCInterface(Thread, Hook): __name__ = "IRCInterface" - __version__ = "0.11" __type__ = "hook" + __version__ = "0.11" __config__ = [("activated", "bool", "Activated", False), ("host", "str", "IRC-Server Address", "Enter your server here!"), diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py index 4d7be96e3..d9d4e547e 100644 --- a/module/plugins/hooks/ImageTyperz.py +++ b/module/plugins/hooks/ImageTyperz.py @@ -1,24 +1,12 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . -""" from __future__ import with_statement -from thread import start_new_thread -from pycurl import FORM_FILE, LOW_SPEED_TIME + import re + from base64 import b64encode +from pycurl import FORM_FILE, LOW_SPEED_TIME +from thread import start_new_thread from module.network.RequestFactory import getURL, getRequest from module.plugins.Hook import Hook @@ -41,8 +29,8 @@ class ImageTyperzException(Exception): class ImageTyperz(Hook): __name__ = "ImageTyperz" - __version__ = "0.04" __type__ = "hook" + __version__ = "0.04" __config__ = [("activated", "bool", "Activated", False), ("username", "str", "Username", ""), @@ -82,7 +70,7 @@ class ImageTyperz(Hook): req.c.setopt(LOW_SPEED_TIME, 80) try: - #workaround multipart-post bug in HTTPRequest.py + #workaround multipart-post bug in HTTPRequest.py if re.match("^[A-Za-z0-9]*$", self.getConfig("passkey")): multipart = True data = (FORM_FILE, captcha) diff --git a/module/plugins/hooks/LinkdecrypterCom.py b/module/plugins/hooks/LinkdecrypterCom.py index 4e08372fe..1aa8f7ca1 100644 --- a/module/plugins/hooks/LinkdecrypterCom.py +++ b/module/plugins/hooks/LinkdecrypterCom.py @@ -1,31 +1,16 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . -""" - import re -from module.plugins.Hook import Hook from module.network.RequestFactory import getURL +from module.plugins.Hook import Hook from module.utils import remove_chars class LinkdecrypterCom(Hook): __name__ = "LinkdecrypterCom" - __version__ = "0.19" __type__ = "hook" + __version__ = "0.19" __config__ = [("activated", "bool", "Activated", False)] diff --git a/module/plugins/hooks/LinksnappyCom.py b/module/plugins/hooks/LinksnappyCom.py index a0e5b8d38..20da68632 100644 --- a/module/plugins/hooks/LinksnappyCom.py +++ b/module/plugins/hooks/LinksnappyCom.py @@ -1,14 +1,14 @@ # -*- coding: utf-8 -*- -from module.plugins.internal.MultiHoster import MultiHoster -from module.network.RequestFactory import getURL from module.common.json_layer import json_loads +from module.network.RequestFactory import getURL +from module.plugins.internal.MultiHoster import MultiHoster class LinksnappyCom(MultiHoster): __name__ = "LinksnappyCom" - __version__ = "0.01" __type__ = "hook" + __version__ = "0.01" __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), diff --git a/module/plugins/hooks/MegaDebridEu.py b/module/plugins/hooks/MegaDebridEu.py index 22945cc0f..605b04f21 100644 --- a/module/plugins/hooks/MegaDebridEu.py +++ b/module/plugins/hooks/MegaDebridEu.py @@ -1,28 +1,14 @@ # -*- coding: utf-8 -*- -############################################################################ -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero General Public License as # -# published by the Free Software Foundation, either version 3 of the # -# License, or (at your option) any later version. # -# # -# This program is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see . # -############################################################################ -from module.plugins.internal.MultiHoster import MultiHoster -from module.network.RequestFactory import getURL from module.common.json_layer import json_loads +from module.network.RequestFactory import getURL +from module.plugins.internal.MultiHoster import MultiHoster class MegaDebridEu(MultiHoster): __name__ = "MegaDebridEu" - __version__ = "0.02" __type__ = "hook" + __version__ = "0.02" __config__ = [("activated", "bool", "Activated", False), ("unloadFailing", "bool", "Revert to standard download if download fails", False)] diff --git a/module/plugins/hooks/MergeFiles.py b/module/plugins/hooks/MergeFiles.py index 5d6c208a7..a859092fb 100644 --- a/module/plugins/hooks/MergeFiles.py +++ b/module/plugins/hooks/MergeFiles.py @@ -1,35 +1,17 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . -""" - import os import re import traceback -from os.path import join -from module.utils import save_join, fs_encode from module.plugins.Hook import Hook, threaded - -BUFFER_SIZE = 4096 +from module.utils import save_join, fs_encode class MergeFiles(Hook): __name__ = "MergeFiles" - __version__ = "0.12" __type__ = "hook" + __version__ = "0.12" __config__ = [("activated", "bool", "Activated", False)] @@ -37,6 +19,8 @@ class MergeFiles(Hook): __author_name__ = "and9000" __author_mail__ = "me@has-no-mail.com" + BUFFER_SIZE = 4096 + def setup(self): # nothing to do @@ -61,7 +45,7 @@ class MergeFiles(Hook): for name, file_list in files.iteritems(): self.logInfo("Starting merging of %s" % name) - final_file = open(join(download_folder, fs_encode(name)), "wb") + final_file = open(save_join(download_folder, name), "wb") for splitted_file in file_list: self.logDebug("Merging part %s" % splitted_file) @@ -72,10 +56,10 @@ class MergeFiles(Hook): size_written = 0 s_file_size = int(os.path.getsize(os.path.join(download_folder, splitted_file))) while True: - f_buffer = s_file.read(BUFFER_SIZE) + f_buffer = s_file.read(self.BUFFER_SIZE) if f_buffer: final_file.write(f_buffer) - size_written += BUFFER_SIZE + size_written += self.BUFFER_SIZE pyfile.setProgress((size_written * 100) / s_file_size) else: break diff --git a/module/plugins/hooks/MultiDebridCom.py b/module/plugins/hooks/MultiDebridCom.py index 3309fb9a8..c5d1464f8 100644 --- a/module/plugins/hooks/MultiDebridCom.py +++ b/module/plugins/hooks/MultiDebridCom.py @@ -1,28 +1,14 @@ # -*- coding: utf-8 -*- -############################################################################ -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero General Public License as # -# published by the Free Software Foundation, either version 3 of the # -# License, or (at your option) any later version. # -# # -# This program is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see . # -############################################################################ -from module.plugins.internal.MultiHoster import MultiHoster -from module.network.RequestFactory import getURL from module.common.json_layer import json_loads +from module.network.RequestFactory import getURL +from module.plugins.internal.MultiHoster import MultiHoster class MultiDebridCom(MultiHoster): __name__ = "MultiDebridCom" - __version__ = "0.01" __type__ = "hook" + __version__ = "0.01" __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), diff --git a/module/plugins/hooks/MultiHome.py b/module/plugins/hooks/MultiHome.py index b9c663046..e2167b65e 100644 --- a/module/plugins/hooks/MultiHome.py +++ b/module/plugins/hooks/MultiHome.py @@ -1,20 +1,5 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . -""" - from time import time from module.plugins.Hook import Hook @@ -22,8 +7,8 @@ from module.plugins.Hook import Hook class MultiHome(Hook): __name__ = "MultiHome" - __version__ = "0.11" __type__ = "hook" + __version__ = "0.11" __config__ = [("activated", "bool", "Activated", False), ("interfaces", "str", "Interfaces", "None")] diff --git a/module/plugins/hooks/MultishareCz.py b/module/plugins/hooks/MultishareCz.py index 8baa4bb07..9249106d6 100644 --- a/module/plugins/hooks/MultishareCz.py +++ b/module/plugins/hooks/MultishareCz.py @@ -8,8 +8,8 @@ from module.plugins.internal.MultiHoster import MultiHoster class MultishareCz(MultiHoster): __name__ = "MultishareCz" - __version__ = "0.04" __type__ = "hook" + __version__ = "0.04" __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), diff --git a/module/plugins/hooks/OverLoadMe.py b/module/plugins/hooks/OverLoadMe.py index dcc57aa75..5be0b8482 100644 --- a/module/plugins/hooks/OverLoadMe.py +++ b/module/plugins/hooks/OverLoadMe.py @@ -6,8 +6,8 @@ from module.plugins.internal.MultiHoster import MultiHoster class OverLoadMe(MultiHoster): __name__ = "OverLoadMe" - __version__ = "0.01" __type__ = "hook" + __version__ = "0.01" __config__ = [("activated", "bool", "Activated", False), ("https", "bool", "Enable HTTPS", True), diff --git a/module/plugins/hooks/Premium4Me.py b/module/plugins/hooks/Premium4Me.py index 242e72f3e..9c6701b06 100644 --- a/module/plugins/hooks/Premium4Me.py +++ b/module/plugins/hooks/Premium4Me.py @@ -6,8 +6,8 @@ from module.plugins.internal.MultiHoster import MultiHoster class Premium4Me(MultiHoster): __name__ = "Premium4Me" - __version__ = "0.03" __type__ = "hook" + __version__ = "0.03" __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for downloads from supported hosters:", "all"), diff --git a/module/plugins/hooks/PremiumizeMe.py b/module/plugins/hooks/PremiumizeMe.py index 1a35460de..e7291ece9 100644 --- a/module/plugins/hooks/PremiumizeMe.py +++ b/module/plugins/hooks/PremiumizeMe.py @@ -1,15 +1,14 @@ # -*- coding: utf-8 -*- -from module.plugins.internal.MultiHoster import MultiHoster - from module.common.json_layer import json_loads from module.network.RequestFactory import getURL +from module.plugins.internal.MultiHoster import MultiHoster class PremiumizeMe(MultiHoster): __name__ = "PremiumizeMe" - __version__ = "0.12" __type__ = "hook" + __version__ = "0.12" __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), @@ -40,7 +39,7 @@ class PremiumizeMe(MultiHoster): if data['status'] != 200: return [] - # Extract hosters from json file + # Extract hosters from json file return data['result']['hosterlist'] def coreReady(self): @@ -51,5 +50,5 @@ class PremiumizeMe(MultiHoster): self.logError(_("Please add a valid premiumize.me account first and restart pyLoad.")) return - # Run the overwriten core ready which actually enables the multihoster hook + # Run the overwriten core ready which actually enables the multihoster hook return MultiHoster.coreReady(self) diff --git a/module/plugins/hooks/RPNetBiz.py b/module/plugins/hooks/RPNetBiz.py index 36cf69b4b..9b9b7cda9 100644 --- a/module/plugins/hooks/RPNetBiz.py +++ b/module/plugins/hooks/RPNetBiz.py @@ -1,14 +1,14 @@ # -*- coding: utf-8 -*- -from module.plugins.internal.MultiHoster import MultiHoster from module.common.json_layer import json_loads from module.network.RequestFactory import getURL +from module.plugins.internal.MultiHoster import MultiHoster class RPNetBiz(MultiHoster): __name__ = "RPNetBiz" - __version__ = "0.1" __type__ = "hook" + __version__ = "0.1" __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), @@ -37,7 +37,7 @@ class RPNetBiz(MultiHoster): if 'error' in hoster_list: return [] - # Extract hosters from json file + # Extract hosters from json file return hoster_list['hosters'] def coreReady(self): @@ -48,5 +48,5 @@ class RPNetBiz(MultiHoster): self.logError(_("Please enter your %s account or deactivate this plugin") % "rpnet") return - # Run the overwriten core ready which actually enables the multihoster hook + # Run the overwriten core ready which actually enables the multihoster hook return MultiHoster.coreReady(self) diff --git a/module/plugins/hooks/RealdebridCom.py b/module/plugins/hooks/RealdebridCom.py index 4477fba4a..87902ac7f 100644 --- a/module/plugins/hooks/RealdebridCom.py +++ b/module/plugins/hooks/RealdebridCom.py @@ -6,8 +6,8 @@ from module.plugins.internal.MultiHoster import MultiHoster class RealdebridCom(MultiHoster): __name__ = "RealdebridCom" - __version__ = "0.43" __type__ = "hook" + __version__ = "0.43" __config__ = [("activated", "bool", "Activated", False), ("https", "bool", "Enable HTTPS", False), diff --git a/module/plugins/hooks/RehostTo.py b/module/plugins/hooks/RehostTo.py index 96e06950e..d504bb83b 100644 --- a/module/plugins/hooks/RehostTo.py +++ b/module/plugins/hooks/RehostTo.py @@ -6,8 +6,8 @@ from module.plugins.internal.MultiHoster import MultiHoster class RehostTo(MultiHoster): __name__ = "RehostTo" - __version__ = "0.43" __type__ = "hook" + __version__ = "0.43" __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), diff --git a/module/plugins/hooks/RestartFailed.py b/module/plugins/hooks/RestartFailed.py index 2bd0e28db..3aef6f8cd 100644 --- a/module/plugins/hooks/RestartFailed.py +++ b/module/plugins/hooks/RestartFailed.py @@ -1,26 +1,12 @@ # -*- coding: utf-8 -*- -############################################################################### -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -############################################################################### from module.plugins.Hook import Hook class RestartFailed(Hook): __name__ = "RestartFailed" - __version__ = "1.55" __type__ = "hook" + __version__ = "1.55" __config__ = [("activated", "bool", "Activated", False), ("interval", "int", "Check interval in minutes", 90)] diff --git a/module/plugins/hooks/SimplyPremiumCom.py b/module/plugins/hooks/SimplyPremiumCom.py index 41268e231..a946d391e 100644 --- a/module/plugins/hooks/SimplyPremiumCom.py +++ b/module/plugins/hooks/SimplyPremiumCom.py @@ -1,18 +1,4 @@ # -*- coding: utf-8 -*- -############################################################################ -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero General Public License as # -# published by the Free Software Foundation, either version 3 of the # -# License, or (at your option) any later version. # -# # -# This program is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see . # -############################################################################ from module.common.json_layer import json_loads from module.network.RequestFactory import getURL @@ -21,8 +7,8 @@ from module.plugins.internal.MultiHoster import MultiHoster class SimplyPremiumCom(MultiHoster): __name__ = "SimplyPremiumCom" - __version__ = "0.02" __type__ = "hook" + __version__ = "0.02" __config__ = [("activated", "bool", "Activated", "False"), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), diff --git a/module/plugins/hooks/SimplydebridCom.py b/module/plugins/hooks/SimplydebridCom.py index 345d37e4a..ab13f312e 100644 --- a/module/plugins/hooks/SimplydebridCom.py +++ b/module/plugins/hooks/SimplydebridCom.py @@ -6,8 +6,8 @@ from module.plugins.internal.MultiHoster import MultiHoster class SimplydebridCom(MultiHoster): __name__ = "SimplydebridCom" - __version__ = "0.01" __type__ = "hook" + __version__ = "0.01" __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index d40854e99..f25c5e2b4 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -1,30 +1,16 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . -""" from os.path import basename -from module.utils import fs_encode -from module.plugins.Hook import Hook from module.PyFile import PyFile +from module.plugins.Hook import Hook +from module.utils import fs_encode class UnSkipOnFail(Hook): __name__ = "UnSkipOnFail" - __version__ = "0.01" __type__ = "hook" + __version__ = "0.01" __config__ = [("activated", "bool", "Activated", True)] diff --git a/module/plugins/hooks/UnrestrictLi.py b/module/plugins/hooks/UnrestrictLi.py index 3303c7355..ee5d79269 100644 --- a/module/plugins/hooks/UnrestrictLi.py +++ b/module/plugins/hooks/UnrestrictLi.py @@ -1,28 +1,14 @@ # -*- coding: utf-8 -*- -############################################################################ -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero General Public License as # -# published by the Free Software Foundation, either version 3 of the # -# License, or (at your option) any later version. # -# # -# This program is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see . # -############################################################################ -from module.plugins.internal.MultiHoster import MultiHoster -from module.network.RequestFactory import getURL from module.common.json_layer import json_loads +from module.network.RequestFactory import getURL +from module.plugins.internal.MultiHoster import MultiHoster class UnrestrictLi(MultiHoster): __name__ = "UnrestrictLi" - __version__ = "0.02" __type__ = "hook" + __version__ = "0.02" __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 5f71ad6fa..9e01989d9 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -5,7 +5,7 @@ import sys from operator import itemgetter from os import remove, stat -from os.path import isfile +from os.path import isfile, join from time import time from module.network.RequestFactory import getURL @@ -257,7 +257,7 @@ class UpdateManager(Hook): py_file = name + ".py" pyc_file = name + ".pyc" - for root in ("userplugins", save_join(pypath, "module", "plugins")): + for root in ("userplugins", join(pypath, "module", "plugins")): py_filename = save_join(root, type, py_file) pyc_filename = save_join(root, type, pyc_file) diff --git a/module/plugins/hooks/WindowsPhoneToastNotify.py b/module/plugins/hooks/WindowsPhoneToastNotify.py index 25fa3abe5..01570b966 100644 --- a/module/plugins/hooks/WindowsPhoneToastNotify.py +++ b/module/plugins/hooks/WindowsPhoneToastNotify.py @@ -1,28 +1,15 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . -""" -import time import httplib +import time + from module.plugins.Hook import Hook class WindowsPhoneToastNotify(Hook): __name__ = "WindowsPhoneToastNotify" - __version__ = "0.02" __type__ = "hook" + __version__ = "0.02" __config__ = [("activated", "bool", "Activated", False), ("force", "bool", "Force even if client is connected", False), diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 37a464b33..eb0376921 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -7,8 +7,8 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" - __version__ = "0.11" __type__ = "hook" + __version__ = "0.11" __config__ = [("activated", "bool", "Activated", True), ("loadDefault", "bool", "Include default (built-in) hoster list", True), diff --git a/module/plugins/hooks/XMPPInterface.py b/module/plugins/hooks/XMPPInterface.py index a60d31b89..c4a94a8bc 100644 --- a/module/plugins/hooks/XMPPInterface.py +++ b/module/plugins/hooks/XMPPInterface.py @@ -1,33 +1,18 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . -""" - from pyxmpp import streamtls from pyxmpp.all import JID, Message -from pyxmpp.jabber.client import JabberClient from pyxmpp.interface import implements from pyxmpp.interfaces import * +from pyxmpp.jabber.client import JabberClient from module.plugins.hooks.IRCInterface import IRCInterface class XMPPInterface(IRCInterface, JabberClient): __name__ = "XMPPInterface" - __version__ = "0.11" __type__ = "hook" + __version__ = "0.11" __config__ = [("activated", "bool", "Activated", False), ("jid", "str", "Jabber ID", "user@exmaple-jabber-server.org"), diff --git a/module/plugins/hooks/ZeveraCom.py b/module/plugins/hooks/ZeveraCom.py index 49fc68b30..0d5e23118 100644 --- a/module/plugins/hooks/ZeveraCom.py +++ b/module/plugins/hooks/ZeveraCom.py @@ -6,8 +6,8 @@ from module.plugins.internal.MultiHoster import MultiHoster class ZeveraCom(MultiHoster): __name__ = "ZeveraCom" - __version__ = "0.02" __type__ = "hook" + __version__ = "0.02" __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), -- cgit v1.2.3 From cb4f7ffd4d638d42a931349a171ba28aab17be97 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 30 Aug 2014 00:41:23 +0200 Subject: UpdateManager] Fix I/O conflict on activation + fix removePlugins + some code cosmetics --- module/plugins/hooks/UpdateManager.py | 79 +++++++++++++++++------------------ 1 file changed, 38 insertions(+), 41 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 9e01989d9..546e6e6e8 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -4,9 +4,7 @@ import re import sys from operator import itemgetter -from os import remove, stat -from os.path import isfile, join -from time import time +from os import path, remove, stat from module.network.RequestFactory import getURL from module.plugins.Hook import Expose, Hook, threaded @@ -16,7 +14,7 @@ from module.utils import save_join class UpdateManager(Hook): __name__ = "UpdateManager" __type__ = "hook" - __version__ = "0.34" + __version__ = "0.35" __config__ = [("activated", "bool", "Activated", True), ("mode", "pyLoad + plugins;plugins only", "Check updates for", "pyLoad + plugins"), @@ -24,10 +22,11 @@ class UpdateManager(Hook): ("reloadplugins", "bool", "Monitor plugins for code changes (debug mode only)", True), ("nodebugupdate", "bool", "Don't check for updates in debug mode", True)] - __description__ = """Check for updates""" + __description__ = """ Check for updates """ __author_name__ = "Walter Purcaro" __author_mail__ = "vuolter@gmail.com" + event_list = ["pluginConfigChanged"] SERVER_URL = "http://updatemanager.pyload.org" @@ -38,36 +37,36 @@ class UpdateManager(Hook): if name == "interval": interval = value * 60 * 60 if self.MIN_INTERVAL <= interval != self.interval: - self.scheduler.removeJob(self.cb) + self.core.scheduler.removeJob(self.cb) self.interval = interval self.initPeriodical() else: self.logDebug("Invalid interval value, kept current") elif name == "reloadplugins": if self.cb2: - self.scheduler.removeJob(self.cb2) + self.core.scheduler.removeJob(self.cb2) if value is True and self.core.debug: self.periodical2() def coreReady(self): self.pluginConfigChanged(self.__name__, "interval", self.getConfig("interval")) - self.pluginConfigChanged(self.__name__, "reloadplugins", self.getConfig("reloadplugins")) + x = lambda: self.pluginConfigChanged(self.__name__, "reloadplugins", self.getConfig("reloadplugins")) + self.core.scheduler.addJob(10, x, threaded=False) def unload(self): self.pluginConfigChanged(self.__name__, "reloadplugins", False) def setup(self): - self.scheduler = self.core.scheduler self.cb2 = None self.interval = self.MIN_INTERVAL self.updating = False - self.info = {"pyload": False, "version": None, "plugins": False} + self.info = {'pyload': False, 'version': None, 'plugins': False} self.mtimes = {} #: store modification time for each plugin def periodical2(self): if not self.updating: self.autoreloadPlugins() - self.cb2 = self.scheduler.addJob(10, self.periodical2, threaded=False) + self.cb2 = self.core.scheduler.addJob(4, self.periodical2, threaded=False) @Expose def autoreloadPlugins(self): @@ -85,7 +84,7 @@ class UpdateManager(Hook): id = (type, name) if type in self.core.pluginManager.plugins: f = m.__file__.replace(".pyc", ".py") - if not isfile(f): + if not path.isfile(f): continue mtime = stat(f).st_mtime @@ -111,7 +110,7 @@ class UpdateManager(Hook): @threaded def updateThread(self): self.updating = True - status = self.update(onlyplugin=True if self.getConfig("mode") == "plugins only" else False) + status = self.update(onlyplugin=self.getConfig("mode") == "plugins only") if status == 2: self.core.api.restart() else: @@ -172,7 +171,7 @@ class UpdateManager(Hook): else: name = filename.replace(".py", "") - #TODO: obsolete in 0.5.0 + #@TODO: obsolete after 0.4.10 if prefix.endswith("s"): type = prefix[:-1] else: @@ -191,10 +190,10 @@ class UpdateManager(Hook): continue self.logInfo(_(msg) % { - "type": type, - "name": name, - "oldver": oldver, - "newver": newver + 'type': type, + 'name': name, + 'oldver': oldver, + 'newver': newver, }) try: @@ -206,7 +205,7 @@ class UpdateManager(Hook): f.close() updated.append((prefix, name)) else: - raise Exception(_("Version mismatch")) + raise Exception, _("Version mismatch") except Exception, e: self.logError(_("Error updating plugin %s") % filename, str(e)) @@ -222,8 +221,8 @@ class UpdateManager(Hook): removed = self.removePlugins(blacklisted) for t, n in removed: self.logInfo(_("Removed blacklisted plugin [%(type)s] %(name)s") % { - "type": t, - "name": n + 'type': t, + 'name': n, }) if updated: @@ -243,41 +242,39 @@ class UpdateManager(Hook): @Expose def removePlugins(self, type_plugins): - """ delete plugins from disk""" + """ delete plugins from disk """ if not type_plugins: - return None + return self.logDebug("Request deletion of plugins: %s" % type_plugins) removed = [] for type, name in type_plugins: - rflag = False - py_file = name + ".py" - pyc_file = name + ".pyc" + err = False + file = name + ".py" - for root in ("userplugins", join(pypath, "module", "plugins")): - py_filename = save_join(root, type, py_file) - pyc_filename = save_join(root, type, pyc_file) + for root in ("userplugins", path.join(pypath, "module", "plugins")): - if isfile(py_filename): - try: - remove(py_filename) - except Exception, e: - self.logError("Error deleting file %s" % py_filename, str(e)) - rflag = False - else: - rflag = True + filename = save_join(root, type, file) + try: + remove(filename) + except Exception, e: + self.logDebug("Error deleting \"%s\"" % path.basename(filename), str(e)) + err = True - if isfile(pyc_filename): + filename += "c" + if path.isfile(filename): try: if type == "hook": self.manager.deactivateHook(name) - remove(pyc_filename) + remove(filename) except Exception, e: - self.logError("Error deleting file %s" % pyc_filename, str(e)) - if rflag: + self.logDebug("Error deleting \"%s\"" % path.basename(filename), str(e)) + err = True + + if not err: id = (type, name) removed.append(id) -- cgit v1.2.3 From 98d4c07b6983c98fca26f99dd7a853ab36a1d696 Mon Sep 17 00:00:00 2001 From: stickell Date: Sun, 31 Aug 2014 17:55:36 +0200 Subject: [Checksum] Moved the checksum validation toggle to the plugin because the general configuration has been removed in 0.4.10 --- module/plugins/hooks/Checksum.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index 0fe2ae88c..013172899 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -40,17 +40,18 @@ def computeChecksum(local_file, algorithm): class Checksum(Hook): __name__ = "Checksum" __type__ = "hook" - __version__ = "0.12" + __version__ = "0.13" __config__ = [("activated", "bool", "Activated", False), + ("check_checksum", "bool", "Check checksum? (If False only size will be verified)", True), ("check_action", "fail;retry;nothing", "What to do if check fails?", "retry"), ("max_tries", "int", "Number of retries", 2), ("retry_action", "fail;nothing", "What to do if all retries fail?", "fail"), ("wait_time", "int", "Time to wait before each retry (seconds)", 1)] __description__ = """Verify downloaded file size and checksum""" - __author_name__ = ("zoidberg", "Walter Purcaro") - __author_mail__ = ("zoidberg@mujmail.cz", "vuolter@gmail.com") + __author_name__ = ("zoidberg", "Walter Purcaro", "stickell") + __author_mail__ = ("zoidberg@mujmail.cz", "vuolter@gmail.com", "l.stickell@yahoo.it") methods = {'sfv': 'crc32', 'crc': 'crc32', 'hash': 'md5'} regexps = {'sfv': r'^(?P[^;].+)\s+(?P[0-9A-Fa-f]{8})$', @@ -60,8 +61,8 @@ class Checksum(Hook): def coreReady(self): - if not self.config['general']['checksum']: - self.logInfo("Checksum validation is disabled in general configuration") + if not self.getConfig("check_checksum"): + self.logInfo("Checksum validation is disabled in plugin configuration") def setup(self): self.algorithms = sorted( @@ -105,7 +106,7 @@ class Checksum(Hook): del data['size'] # validate checksum - if data and self.config['general']['checksum']: + if data and self.getConfig("check_checksum"): if "checksum" in data: data['md5'] = data['checksum'] -- cgit v1.2.3 From 22334b664ff2be7bbbe0627e4d65cf222bd29919 Mon Sep 17 00:00:00 2001 From: stickell Date: Thu, 11 Sep 2014 12:16:03 +0200 Subject: [MultiDebrid] renamed to Myfastline --- module/plugins/hooks/MultiDebridCom.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/MultiDebridCom.py b/module/plugins/hooks/MultiDebridCom.py index c5d1464f8..e27ec8040 100644 --- a/module/plugins/hooks/MultiDebridCom.py +++ b/module/plugins/hooks/MultiDebridCom.py @@ -8,21 +8,18 @@ from module.plugins.internal.MultiHoster import MultiHoster class MultiDebridCom(MultiHoster): __name__ = "MultiDebridCom" __type__ = "hook" - __version__ = "0.01" - + __version__ = "0.02" __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("hosterList", "str", "Hoster list (comma separated)", ""), ("unloadFailing", "bool", "Revert to standard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 24)] - - __description__ = """Multi-debrid.com hook plugin""" + __description__ = """Myfastfile.com hook plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" - def getHoster(self): - json_data = getURL('http://multi-debrid.com/api.php?hosts', decode=True) + json_data = getURL('http://myfastfile.com/api.php?hosts', decode=True) self.logDebug('JSON data: ' + json_data) json_data = json_loads(json_data) -- cgit v1.2.3 From 6f87a713970d6a18c0a3e622286488ec9e3b5494 Mon Sep 17 00:00:00 2001 From: stickell Date: Thu, 11 Sep 2014 15:52:16 +0200 Subject: [MultiDebrid] renaming files to MyfastlineCom --- module/plugins/hooks/MultiDebridCom.py | 26 -------------------------- module/plugins/hooks/MyfastfileCom.py | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 26 deletions(-) delete mode 100644 module/plugins/hooks/MultiDebridCom.py create mode 100644 module/plugins/hooks/MyfastfileCom.py (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/MultiDebridCom.py b/module/plugins/hooks/MultiDebridCom.py deleted file mode 100644 index e27ec8040..000000000 --- a/module/plugins/hooks/MultiDebridCom.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.common.json_layer import json_loads -from module.network.RequestFactory import getURL -from module.plugins.internal.MultiHoster import MultiHoster - - -class MultiDebridCom(MultiHoster): - __name__ = "MultiDebridCom" - __type__ = "hook" - __version__ = "0.02" - __config__ = [("activated", "bool", "Activated", False), - ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), - ("hosterList", "str", "Hoster list (comma separated)", ""), - ("unloadFailing", "bool", "Revert to standard download if download fails", False), - ("interval", "int", "Reload interval in hours (0 to disable)", 24)] - __description__ = """Myfastfile.com hook plugin""" - __author_name__ = "stickell" - __author_mail__ = "l.stickell@yahoo.it" - - def getHoster(self): - json_data = getURL('http://myfastfile.com/api.php?hosts', decode=True) - self.logDebug('JSON data: ' + json_data) - json_data = json_loads(json_data) - - return json_data['hosts'] diff --git a/module/plugins/hooks/MyfastfileCom.py b/module/plugins/hooks/MyfastfileCom.py new file mode 100644 index 000000000..bbf665b08 --- /dev/null +++ b/module/plugins/hooks/MyfastfileCom.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- + +from module.common.json_layer import json_loads +from module.network.RequestFactory import getURL +from module.plugins.internal.MultiHoster import MultiHoster + + +class MyfastfileCom(MultiHoster): + __name__ = "MyfastfileCom" + __type__ = "hook" + __version__ = "0.02" + __config__ = [("activated", "bool", "Activated", False), + ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), + ("hosterList", "str", "Hoster list (comma separated)", ""), + ("unloadFailing", "bool", "Revert to standard download if download fails", False), + ("interval", "int", "Reload interval in hours (0 to disable)", 24)] + __description__ = """Myfastfile.com hook plugin""" + __author_name__ = "stickell" + __author_mail__ = "l.stickell@yahoo.it" + + def getHoster(self): + json_data = getURL('http://myfastfile.com/api.php?hosts', decode=True) + self.logDebug('JSON data: ' + json_data) + json_data = json_loads(json_data) + + return json_data['hosts'] -- cgit v1.2.3 From a64c0d41a27da58dc004f97bc934c8b3018a1de9 Mon Sep 17 00:00:00 2001 From: stickell Date: Fri, 12 Sep 2014 17:54:39 +0200 Subject: [Premium4Me] Renamed to PremiumTo + partial rewrite + special traffic support --- module/plugins/hooks/Premium4Me.py | 34 ---------------------------------- module/plugins/hooks/PremiumTo.py | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 34 deletions(-) delete mode 100644 module/plugins/hooks/Premium4Me.py create mode 100644 module/plugins/hooks/PremiumTo.py (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/Premium4Me.py b/module/plugins/hooks/Premium4Me.py deleted file mode 100644 index 9c6701b06..000000000 --- a/module/plugins/hooks/Premium4Me.py +++ /dev/null @@ -1,34 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.network.RequestFactory import getURL -from module.plugins.internal.MultiHoster import MultiHoster - - -class Premium4Me(MultiHoster): - __name__ = "Premium4Me" - __type__ = "hook" - __version__ = "0.03" - - __config__ = [("activated", "bool", "Activated", False), - ("hosterListMode", "all;listed;unlisted", "Use for downloads from supported hosters:", "all"), - ("hosterList", "str", "Hoster list (comma separated)", "")] - - __description__ = """Premium.to hook plugin""" - __author_name__ = ("RaNaN", "zoidberg", "stickell") - __author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz", "l.stickell@yahoo.it") - - - def getHoster(self): - page = getURL("http://premium.to/api/hosters.php?authcode=%s" % self.account.authcode) - return [x.strip() for x in page.replace("\"", "").split(";")] - - def coreReady(self): - self.account = self.core.accountManager.getAccountPlugin("Premium4Me") - - user = self.account.selectAccount()[0] - - if not user: - self.logError(_("Please add your premium.to account first and restart pyLoad")) - return - - return MultiHoster.coreReady(self) diff --git a/module/plugins/hooks/PremiumTo.py b/module/plugins/hooks/PremiumTo.py new file mode 100644 index 000000000..0572dab34 --- /dev/null +++ b/module/plugins/hooks/PremiumTo.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- + +from module.network.RequestFactory import getURL +from module.plugins.internal.MultiHoster import MultiHoster + + +class PremiumTo(MultiHoster): + __name__ = "PremiumTo" + __type__ = "hook" + __version__ = "0.04" + __config__ = [("activated", "bool", "Activated", False), + ("hosterListMode", "all;listed;unlisted", "Use for downloads from supported hosters:", "all"), + ("hosterList", "str", "Hoster list (comma separated)", "")] + __description__ = """Premium.to hook plugin""" + __author_name__ = ("RaNaN", "zoidberg", "stickell") + __author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz", "l.stickell@yahoo.it") + + def getHoster(self): + page = getURL("http://premium.to/api/hosters.php", + get={'username': self.account.username, 'password': self.account.password}) + return [x.strip() for x in page.replace("\"", "").split(";")] + + def coreReady(self): + self.account = self.core.accountManager.getAccountPlugin("PremiumTo") + + user = self.account.selectAccount()[0] + + if not user: + self.logError(_("Please add your premium.to account first and restart pyLoad")) + return + + return MultiHoster.coreReady(self) -- cgit v1.2.3 From df2dcf1ccdbcc5197a224df9946595df907dc749 Mon Sep 17 00:00:00 2001 From: igel-kun Date: Mon, 15 Sep 2014 23:10:37 +0200 Subject: [XFilesharingPro] Embedded urls support --- module/plugins/hooks/XFileSharingPro.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index eb0376921..e19b40e22 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.11" + __version__ = "0.12" __config__ = [("activated", "bool", "Activated", True), ("loadDefault", "bool", "Include default (built-in) hoster list", True), @@ -23,6 +23,7 @@ class XFileSharingPro(Hook): def coreReady(self): self.loadPattern() + def loadPattern(self): hosterList = self.getConfigSet('includeList') excludeList = self.getConfigSet('excludeList') @@ -60,7 +61,7 @@ class XFileSharingPro(Hook): self.unload() return - regexp = r"http://(?:[^/]*\.)?(%s)/\w{12}" % ("|".join(sorted(hosterList)).replace('.', '\.')) + regexp = r"http://(?:[^/]*\.)?(%s)/(?:embed-)?\w{12}" % ("|".join(sorted(hosterList)).replace('.', '\.')) #self.logDebug(regexp) dict = self.core.pluginManager.hosterPlugins['XFileSharingPro'] @@ -68,10 +69,12 @@ class XFileSharingPro(Hook): dict['re'] = re.compile(regexp) self.logDebug("Pattern loaded - handling %d hosters" % len(hosterList)) + def getConfigSet(self, option): s = self.getConfig(option).lower().replace('|', ',').replace(';', ',') return set([x.strip() for x in s.split(',')]) + def unload(self): dict = self.core.pluginManager.hosterPlugins['XFileSharingPro'] dict['pattern'] = r'^unmatchable$' -- cgit v1.2.3 From 31ea85f97571cc191fe205f6b4d85b3777818240 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 25 Sep 2014 20:59:30 +0200 Subject: Extend ExtractArchive events + code optimizations https://github.com/pyload/pyload/pull/622 https://github.com/pyload/pyload/pull/726 --- module/plugins/hooks/ExternalScripts.py | 69 +++++++++++++----- module/plugins/hooks/ExtractArchive.py | 124 ++++++++++++++++++++------------ 2 files changed, 128 insertions(+), 65 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index 8d03d27d4..bdde9cd62 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -2,6 +2,7 @@ import subprocess +from itertools import chain from os import listdir, access, X_OK, makedirs from os.path import join, exists, basename, abspath @@ -12,23 +13,27 @@ from module.utils import save_join class ExternalScripts(Hook): __name__ = "ExternalScripts" __type__ = "hook" - __version__ = "0.23" + __version__ = "0.24" __config__ = [("activated", "bool", "Activated", True)] __description__ = """Run external scripts""" - __author_name__ = ("mkaay", "RaNaN", "spoob") - __author_mail__ = ("mkaay@mkaay.de", "ranan@pyload.org", "spoob@pyload.org") + __author_name__ = ("mkaay", "RaNaN", "spoob", "Walter Purcaro") + __author_mail__ = ("mkaay@mkaay.de", "ranan@pyload.org", "spoob@pyload.org", "vuolter@gmail.com") - event_list = ["unrarFinished", "allDownloadsFinished", "allDownloadsProcessed"] + event_list = ["archive_extracted", "package_extracted", "all_archives_extracted", "all_archives_processed", + "allDownloadsFinished", "allDownloadsProcessed"] def setup(self): self.scripts = {} - folders = ["download_preparing", "download_finished", "package_finished", - "before_reconnect", "after_reconnect", "unrar_finished", - "all_dls_finished", "all_dls_processed"] + folders = ["download_preparing", "download_finished", "all_downloads_finished", "all_downloads_processed", + "before_reconnect", "after_reconnect", + "package_finished", "package_extracted", + "archive_extracted", "all_archives_extracted", "all_archives_processed", + # deprecated folders + "unrar_finished", "all_dls_finished", "all_dls_processed"] for folder in folders: self.scripts[folder] = [] @@ -40,6 +45,7 @@ class ExternalScripts(Hook): if names: self.logInfo((_("Installed scripts for %s: ") % script_type) + ", ".join([basename(x) for x in names])) + def initPluginType(self, folder, path): if not exists(path): try: @@ -57,6 +63,7 @@ class ExternalScripts(Hook): self.scripts[folder].append(join(path, f)) + def callScript(self, script, *args): try: cmd = [script] + [str(x) if not isinstance(x, basestring) else x for x in args] @@ -66,39 +73,65 @@ class ExternalScripts(Hook): except Exception, e: self.logError(_("Error in %(script)s: %(error)s") % {"script": basename(script), "error": str(e)}) + def downloadPreparing(self, pyfile): for script in self.scripts['download_preparing']: self.callScript(script, pyfile.pluginname, pyfile.url, pyfile.id) + def downloadFinished(self, pyfile): + download_folder = self.config['general']['download_folder'] for script in self.scripts['download_finished']: - self.callScript(script, pyfile.pluginname, pyfile.url, pyfile.name, - save_join(self.config['general']['download_folder'], - pyfile.package().folder, pyfile.name), pyfile.id) + filename = save_join(download_folder, pyfile.package().folder, pyfile.name) + self.callScript(script, pyfile.pluginname, pyfile.url, pyfile.name, filename, pyfile.id) + def packageFinished(self, pypack): + download_folder = self.config['general']['download_folder'] for script in self.scripts['package_finished']: - folder = self.config['general']['download_folder'] - folder = save_join(folder, pypack.folder) - + folder = save_join(download_folder, pypack.folder) self.callScript(script, pypack.name, folder, pypack.password, pypack.id) + def beforeReconnecting(self, ip): for script in self.scripts['before_reconnect']: self.callScript(script, ip) + def afterReconnecting(self, ip): for script in self.scripts['after_reconnect']: self.callScript(script, ip) - def unrarFinished(self, folder, fname): - for script in self.scripts['unrar_finished']: - self.callScript(script, folder, fname) + + def archive_extracted(self, pyfile, folder, filename, files): + for script in self.scripts['archive_extracted']: + self.callScript(script, folder, filename, files) + for script in self.scripts['unrar_finished']: #: deprecated + self.callScript(script, folder, filename) + + + def package_extracted(self, pypack): + download_folder = self.config['general']['download_folder'] + for script in self.scripts['package_extracted']: + folder = save_join(download_folder, pypack.folder) + self.callScript(script, pypack.name, folder, pypack.password, pypack.id) + + + def all_archives_extracted(self): + for script in self.scripts['all_archives_extracted']: + self.callScript(script) + + + def all_archives_processed(self): + for script in self.scripts['all_archives_processed']: + self.callScript(script) + def allDownloadsFinished(self): - for script in self.scripts['all_dls_finished']: + for script in chain(self.scripts['all_downloads_finished'], self.scripts['all_dls_finished']): self.callScript(script) + def allDownloadsProcessed(self): - for script in self.scripts['all_dls_processed']: + for script in chain(self.scripts['all_downloads_processed'], self.scripts['all_dls_processed']): self.callScript(script) diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 144829459..84f6eab25 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -53,17 +53,14 @@ from module.utils import save_join, fs_encode class ExtractArchive(Hook): - """ - Provides: unrarFinished (folder, filename) - """ __name__ = "ExtractArchive" __type__ = "hook" - __version__ = "0.16" + __version__ = "0.17" __config__ = [("activated", "bool", "Activated", True), ("fullpath", "bool", "Extract full path", True), ("overwrite", "bool", "Overwrite files", True), - ("passwordfile", "file", "password file", "unrar_passwords.txt"), + ("passwordfile", "file", "password file", "archive_password.txt"), ("deletearchive", "bool", "Delete archives when done", False), ("subfolder", "bool", "Create subfolder for each package", False), ("destination", "folder", "Extract files to", ""), @@ -73,8 +70,8 @@ class ExtractArchive(Hook): ("renice", "int", "CPU Priority", 0)] __description__ = """Extract different kind of archives""" - __author_name__ = ("pyLoad Team", "AndroKev") - __author_mail__ = ("admin@pyload.org", "@pyloadforum") + __author_name__ = ("RaNaN", "AndroKev", "Walter Purcaro") + __author_mail__ = ("ranan@pyload.org", "@pyloadforum", "vuolter@gmail.com") event_list = ["allDownloadsProcessed"] @@ -113,33 +110,50 @@ class ExtractArchive(Hook): # queue with package ids self.queue = [] + @Expose def extractPackage(self, id): """ Extract package with given id""" self.manager.startThread(self.extract, [id]) + def packageFinished(self, pypack): + pid = pypack.id if self.getConfig("queue"): self.logInfo(_("Package %s queued for later extracting") % pypack.name) - self.queue.append(pypack.id) + self.queue.append(pid) else: - self.manager.startThread(self.extract, [pypack.id]) + self.manager.startThread(self.extract, [pid]) + @threaded def allDownloadsProcessed(self, thread): local = copy(self.queue) del self.queue[:] - self.extract(local, thread) + if self.extract(local, thread): #: check only if all gone fine, no failed reporting for now + self.manager.dispatchEvent("all_archives_extracted") + self.manager.dispatchEvent("all_archives_processed") + def extract(self, ids, thread=None): + processed = [] + extracted = [] + failed = [] + + destination = self.getConfig("destination") + subfolder = self.getConfig("subfolder") + fullpath = self.getConfig("fullpath") + overwrite = self.getConfig("overwrite") + excludefiles = self.getConfig("excludefiles") + renice = self.getConfig("renice") + recursive = self.getConfig("recursive") + # reload from txt file self.reloadPasswords() # dl folder dl = self.config['general']['download_folder'] - extracted = [] - #iterate packages -> plugins -> targets for pid in ids: p = self.core.files.getPackage(pid) @@ -148,22 +162,17 @@ class ExtractArchive(Hook): continue # determine output folder - out = save_join(dl, p.folder, "") - # force trailing slash - - if self.getConfig("destination") and self.getConfig("destination").lower() != "none": - - out = save_join(dl, p.folder, self.getConfig("destination"), "") - #relative to package folder if destination is relative, otherwise absolute path overwrites them + out = save_join(dl, p.folder, destination, "") #: force trailing slash - if self.getConfig("subfolder"): - out = save_join(out, fs_encode(p.folder)) + if subfolder: + out = save_join(out, fs_encode(p.folder)) - if not exists(out): - makedirs(out) + if not exists(out): + makedirs(out) files_ids = [(save_join(dl, p.folder, x['name']), x['id']) for x in p.getChildren().itervalues()] matched = False + success = True # check as long there are unseen files while files_ids: @@ -175,17 +184,23 @@ class ExtractArchive(Hook): self.logDebug("Targets for %s: %s" % (plugin.__name__, targets)) matched = True for target, fid in targets: - if target in extracted: + if target in processed: self.logDebug(basename(target), "skipped") continue - extracted.append(target) # prevent extracting same file twice - klass = plugin(self, target, out, self.getConfig("fullpath"), self.getConfig("overwrite"), self.getConfig("excludefiles"), - self.getConfig("renice")) - klass.init() + processed.append(target) # prevent extracting same file twice self.logInfo(basename(target), _("Extract to %s") % out) - new_files = self.startExtracting(klass, fid, p.password.strip().splitlines(), thread) + try: + klass = plugin(self, target, out, fullpath, overwrite, excludefiles, renice) + klass.init() + password = p.password.strip().splitlines() + new_files = self._extract(klass, fid, password, thread) + except Exception, e: + self.logError(basename(target), str(e)) + success = False + continue + self.logDebug("Extracted: %s" % new_files) self.setPermissions(new_files) @@ -193,18 +208,27 @@ class ExtractArchive(Hook): if not exists(file): self.logDebug("new file %s does not exists" % file) continue - if self.getConfig("recursive") and isfile(file): + if recursive and isfile(file): new_files_ids.append((file, fid)) # append as new target files_ids = new_files_ids # also check extracted files - if not matched: + if matched: + if success: + extracted.append(pid) + self.manager.dispatchEvent("package_extracted", p) + else: + failed.append(pid) + self.manager.dispatchEvent("package_extract_failed", p) + else: self.logInfo(_("No files found to extract")) - def startExtracting(self, plugin, fid, passwords, thread): + return True if not failed else False + + + def _extract(self, plugin, fid, passwords, thread): pyfile = self.core.files.getFile(fid) - if not pyfile: - return [] + deletearchive = self.getConfig("deletearchive") pyfile.setCustomStatus(_("extracting")) thread.addActive(pyfile) # keep this file until everything is done @@ -221,7 +245,7 @@ class ExtractArchive(Hook): self.logDebug("Passwords: %s" % str(passwords)) pwlist = copy(self.getPasswords()) - #remove already supplied pws from list (only local) + # remove already supplied pws from list (only local) for pw in passwords: if pw in pwlist: pwlist.remove(pw) @@ -238,13 +262,12 @@ class ExtractArchive(Hook): self.logDebug("Password was wrong") if not success: - self.logError(basename(plugin.file), _("Wrong password")) - return [] + raise Exception(_("Wrong password")) if self.core.debug: self.logDebug("Would delete: %s" % ", ".join(plugin.getDeleteFiles())) - if self.getConfig("deletearchive"): + if deletearchive: files = plugin.getDeleteFiles() self.logInfo(_("Deleting %s files") % len(files)) for f in files: @@ -254,9 +277,11 @@ class ExtractArchive(Hook): self.logDebug("%s does not exists" % f) self.logInfo(basename(plugin.file), _("Extracting finished")) - self.manager.dispatchEvent("unrarFinished", plugin.out, plugin.file) - return plugin.getExtractedFiles() + extracted_files = plugin.getExtractedFiles() + self.manager.dispatchEvent("archive_extracted", pyfile, plugin.out, plugin.file, extracted_files) + + return extracted_files except ArchiveError, e: self.logError(basename(plugin.file), _("Archive Error"), str(e)) @@ -267,40 +292,45 @@ class ExtractArchive(Hook): print_exc() self.logError(basename(plugin.file), _("Unknown Error"), str(e)) - return [] + self.manager.dispatchEvent("archive_extract_failed", pyfile) + raise Exception(_("Extract failed")) + @Expose def getPasswords(self): """ List of saved passwords """ return self.passwords + def reloadPasswords(self): - pwfile = self.getConfig("passwordfile") - if not exists(pwfile): - open(pwfile, "wb").close() + passwordfile = self.getConfig("passwordfile") + if not exists(passwordfile): + open(passwordfile, "wb").close() passwords = [] - f = open(pwfile, "rb") + f = open(passwordfile, "rb") for pw in f.read().splitlines(): passwords.append(pw) f.close() self.passwords = passwords + @Expose def addPassword(self, pw): """ Adds a password to saved list""" - pwfile = self.getConfig("passwordfile") + passwordfile = self.getConfig("passwordfile") if pw in self.passwords: self.passwords.remove(pw) self.passwords.insert(0, pw) - f = open(pwfile, "wb") + f = open(passwordfile, "wb") for pw in self.passwords: f.write(pw + "\n") f.close() + def setPermissions(self, files): for f in files: if not exists(f): -- cgit v1.2.3 From 0d220d634e512d89bda540f91c643b361c82ea8a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 27 Sep 2014 01:38:32 +0200 Subject: Logging string cosmetics --- module/plugins/hooks/BypassCaptcha.py | 6 +++--- module/plugins/hooks/Captcha9kw.py | 18 +++++++++--------- module/plugins/hooks/CaptchaBrotherhood.py | 2 +- module/plugins/hooks/Checksum.py | 19 +++++++++---------- module/plugins/hooks/ClickAndLoad.py | 2 +- module/plugins/hooks/DeathByCaptcha.py | 7 ++++--- module/plugins/hooks/DeleteFinished.py | 6 +++--- module/plugins/hooks/DownloadScheduler.py | 8 ++++---- module/plugins/hooks/EasybytezCom.py | 2 +- module/plugins/hooks/Ev0InFetcher.py | 5 ++--- module/plugins/hooks/ExpertDecoders.py | 7 +++---- module/plugins/hooks/ExternalScripts.py | 6 +++--- module/plugins/hooks/ExtractArchive.py | 20 ++++++++++---------- module/plugins/hooks/FreeWayMe.py | 2 +- module/plugins/hooks/IRCInterface.py | 6 +++--- module/plugins/hooks/ImageTyperz.py | 8 ++++---- module/plugins/hooks/LinkdecrypterCom.py | 2 +- module/plugins/hooks/MegaDebridEu.py | 2 +- module/plugins/hooks/MergeFiles.py | 8 ++++---- module/plugins/hooks/MultiHome.py | 2 +- module/plugins/hooks/MyfastfileCom.py | 2 +- module/plugins/hooks/OverLoadMe.py | 2 +- module/plugins/hooks/RehostTo.py | 2 +- module/plugins/hooks/RestartFailed.py | 2 +- module/plugins/hooks/UnSkipOnFail.py | 4 ++-- module/plugins/hooks/UpdateManager.py | 8 ++++---- module/plugins/hooks/XFileSharingPro.py | 1 - module/plugins/hooks/XMPPInterface.py | 18 +++++++++--------- 28 files changed, 87 insertions(+), 90 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index d62de24a7..93723681a 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -74,7 +74,7 @@ class BypassCaptcha(Hook): result = data['Value'] ticket = data['TaskId'] - self.logDebug("result %s : %s" % (ticket, result)) + self.logDebug("Result %s : %s" % (ticket, result)) return ticket, result @@ -83,7 +83,7 @@ class BypassCaptcha(Hook): response = getURL(self.RESPOND_URL, post={"task_id": ticket, "key": self.getConfig("passkey"), "cv": 1 if success else 0}) except BadHeader, e: - self.logError("Could not send response.", str(e)) + self.logError(_("Could not send response."), e def newCaptchaTask(self, task): if "service" in task.data: @@ -105,7 +105,7 @@ class BypassCaptcha(Hook): start_new_thread(self.processCaptcha, (task,)) else: - self.logInfo("Your %s account has not enough credits" % self.__name__) + self.logInfo(_("Your %s account has not enough credits") % self.__name__) def captchaCorrect(self, task): if task.data['service'] == self.__name__ and "ticket" in task.data: diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index 1b7406edd..7a54bb784 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -58,7 +58,7 @@ class Captcha9kw(Hook): with open(task.captchaFile, 'rb') as f: data = f.read() data = b64encode(data) - self.logDebug("%s : %s" % (task.captchaFile, data)) + self.logDebug(task.captchaFile, data) if task.isPositional(): mouse = 1 else: @@ -93,10 +93,10 @@ class Captcha9kw(Hook): result = response2 task.data['ticket'] = response - self.logInfo("result %s : %s" % (response, result)) + self.logInfo(_("Result %s : %s") % (response, result)) task.setResult(result) else: - self.logError("Bad upload: %s" % response) + self.logError(_("Bad upload"), response) return False def newCaptchaTask(self, task): @@ -129,12 +129,12 @@ class Captcha9kw(Hook): "pyload": "1", "source": "pyload", "id": task.data['ticket']}) - self.logInfo("Request correct: %s" % response) + self.logInfo(_("Request correct", response) except BadHeader, e: - self.logError("Could not send correct request.", str(e)) + self.logError(_("Could not send correct request."), e) else: - self.logError("No CaptchaID for correct request (task %s) found." % task) + self.logError(_("No CaptchaID for correct request (task %s) found.") % task) def captchaInvalid(self, task): if "ticket" in task.data: @@ -148,9 +148,9 @@ class Captcha9kw(Hook): "pyload": "1", "source": "pyload", "id": task.data['ticket']}) - self.logInfo("Request refund: %s" % response) + self.logInfo(_("Request refund", response) except BadHeader, e: - self.logError("Could not send refund request.", str(e)) + self.logError(_("Could not send refund request."), e) else: - self.logError("No CaptchaID for not correct request (task %s) found." % task) + self.logError(_("No CaptchaID for not correct request (task %s) found.") % task) diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py index e240cbbc0..e4d24c366 100644 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ b/module/plugins/hooks/CaptchaBrotherhood.py @@ -139,7 +139,7 @@ class CaptchaBrotherhood(Hook): task.setWaiting(100) start_new_thread(self.processCaptcha, (task,)) else: - self.logInfo("Your CaptchaBrotherhood Account has not enough credits") + self.logInfo(_("Your CaptchaBrotherhood Account has not enough credits")) def captchaInvalid(self, task): if task.data['service'] == self.__name__ and "ticket" in task.data: diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index 013172899..525eb8150 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -62,7 +62,7 @@ class Checksum(Hook): def coreReady(self): if not self.getConfig("check_checksum"): - self.logInfo("Checksum validation is disabled in plugin configuration") + self.logInfo(_("Checksum validation is disabled in plugin configuration")) def setup(self): self.algorithms = sorted( @@ -101,7 +101,7 @@ class Checksum(Hook): api_size = int(data['size']) file_size = getsize(local_file) if api_size != file_size: - self.logWarning("File %s has incorrect size: %d B (%d expected)" % (pyfile.name, file_size, api_size)) + self.logWarning(_("File %s has incorrect size: %d B (%d expected)") % (pyfile.name, file_size, api_size)) self.checkFailed(pyfile, local_file, "Incorrect file size") del data['size'] @@ -115,17 +115,17 @@ class Checksum(Hook): checksum = computeChecksum(local_file, key.replace("-", "").lower()) if checksum: if checksum == data[key].lower(): - self.logInfo('File integrity of "%s" verified by %s checksum (%s).' % + self.logInfo(_('File integrity of "%s" verified by %s checksum (%s).') % (pyfile.name, key.upper(), checksum)) break else: - self.logWarning("%s checksum for file %s does not match (%s != %s)" % + self.logWarning(_("%s checksum for file %s does not match (%s != %s)") % (key.upper(), pyfile.name, checksum, data[key])) self.checkFailed(pyfile, local_file, "Checksums do not match") else: - self.logWarning("Unsupported hashing algorithm: %s" % key.upper()) + self.logWarning(_("Unsupported hashing algorithm"), key.upper()) else: - self.logWarning("Unable to validate checksum for file %s" % pyfile.name) + self.logWarning(_("Unable to validate checksum for file"), pyfile.name) def checkFailed(self, pyfile, local_file, msg): check_action = self.getConfig("check_action") @@ -147,14 +147,13 @@ class Checksum(Hook): for link in pypack.getChildren().itervalues(): file_type = splitext(link['name'])[1][1:].lower() - #self.logDebug(link, file_type) if file_type not in self.formats: continue hash_file = fs_encode(save_join(download_folder, link['name'])) if not isfile(hash_file): - self.logWarning("File not found: %s" % link['name']) + self.logWarning(_("File not found"), link['name']) continue with open(hash_file) as f: @@ -168,8 +167,8 @@ class Checksum(Hook): algorithm = self.methods.get(file_type, file_type) checksum = computeChecksum(local_file, algorithm) if checksum == data['hash']: - self.logInfo('File integrity of "%s" verified by %s checksum (%s).' % + self.logInfo(_('File integrity of "%s" verified by %s checksum (%s).') % (data['name'], algorithm, checksum)) else: - self.logWarning("%s checksum for file %s does not match (%s != %s)" % + self.logWarning(_("%s checksum for file %s does not match (%s != %s)") % (algorithm, data['name'], checksum, data['hash'])) diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py index 5c523caf7..2bff53d7e 100644 --- a/module/plugins/hooks/ClickAndLoad.py +++ b/module/plugins/hooks/ClickAndLoad.py @@ -30,7 +30,7 @@ class ClickAndLoad(Hook): thread.start_new_thread(proxy, (self, ip, self.port, 9666)) except: - self.logError("ClickAndLoad port already in use.") + self.logError(_("ClickAndLoad port already in use")) def proxy(self, *settings): diff --git a/module/plugins/hooks/DeathByCaptcha.py b/module/plugins/hooks/DeathByCaptcha.py index 530395d32..0340aefce 100644 --- a/module/plugins/hooks/DeathByCaptcha.py +++ b/module/plugins/hooks/DeathByCaptcha.py @@ -146,7 +146,7 @@ class DeathByCaptcha(Hook): raise DeathByCaptchaException('timed-out') result = response['text'] - self.logDebug("result %s : %s" % (ticket, result)) + self.logDebug("Result %s : %s" % (ticket, result)) return ticket, result @@ -171,8 +171,9 @@ class DeathByCaptcha(Hook): return False balance, rate = self.info['balance'], self.info['rate'] - self.logInfo("Account balance: US$%.3f (%d captchas left at %.2f cents each)" % (balance / 100, - balance // rate, rate)) + self.logInfo(_("Account balance"), + _("US$%.3f (%d captchas left at %.2f cents each)") % (balance / 100, + balance // rate, rate)) if balance > rate: task.handler.append(self) diff --git a/module/plugins/hooks/DeleteFinished.py b/module/plugins/hooks/DeleteFinished.py index bc926906f..3db0400a1 100644 --- a/module/plugins/hooks/DeleteFinished.py +++ b/module/plugins/hooks/DeleteFinished.py @@ -23,8 +23,8 @@ class DeleteFinished(Hook): if not self.info['sleep']: deloffline = self.getConfig('deloffline') mode = '0,1,4' if deloffline else '0,4' - msg = 'delete all finished packages in queue list (%s packages with offline links)' - self.logInfo(msg % ('including' if deloffline else 'excluding')) + msg = _('delete all finished packages in queue list (%s packages with offline links)') + self.logInfo(msg % (_('including') if deloffline else _('excluding'))) self.deleteFinished(mode) self.info['sleep'] = True self.addEvent('packageFinished', self.wakeup) @@ -58,7 +58,7 @@ class DeleteFinished(Hook): """Adds an event listener for event name""" if event in self.m.events: if func in self.m.events[event]: - self.logDebug('Function already registered %s' % func) + self.logDebug("Function already registered", func) else: self.m.events[event].append(func) else: diff --git a/module/plugins/hooks/DownloadScheduler.py b/module/plugins/hooks/DownloadScheduler.py index a3d70b3ab..4652f9a1f 100644 --- a/module/plugins/hooks/DownloadScheduler.py +++ b/module/plugins/hooks/DownloadScheduler.py @@ -35,7 +35,7 @@ class DownloadScheduler(Hook): schedule = re.findall("(\d{1,2}):(\d{2})[\s]*(-?\d+)", schedule.lower().replace("full", "-1").replace("none", "0")) if not schedule: - self.logError("Invalid schedule") + self.logError(_("Invalid schedule")) return t0 = localtime() @@ -58,7 +58,7 @@ class DownloadScheduler(Hook): def setDownloadSpeed(self, speed): if speed == 0: abort = self.getConfig("abort") - self.logInfo("Stopping download server. (Running downloads will %sbe aborted.)" % ('' if abort else 'not ')) + self.logInfo(_("Stopping download server. (Running downloads will %sbe aborted.)") % '' if abort else _('not ')) self.core.api.pauseServer() if abort: self.core.api.stopAllDownloads() @@ -66,10 +66,10 @@ class DownloadScheduler(Hook): self.core.api.unpauseServer() if speed > 0: - self.logInfo("Setting download speed to %d kB/s" % speed) + self.logInfo(_("Setting download speed to %d kB/s") % speed) self.core.api.setConfigValue("download", "limit_speed", 1) self.core.api.setConfigValue("download", "max_speed", speed) else: - self.logInfo("Setting download speed to FULL") + self.logInfo(_("Setting download speed to FULL")) self.core.api.setConfigValue("download", "limit_speed", 0) self.core.api.setConfigValue("download", "max_speed", -1) diff --git a/module/plugins/hooks/EasybytezCom.py b/module/plugins/hooks/EasybytezCom.py index da37297d9..a84dc5279 100644 --- a/module/plugins/hooks/EasybytezCom.py +++ b/module/plugins/hooks/EasybytezCom.py @@ -31,7 +31,7 @@ class EasybytezCom(MultiHoster): return m.group(1).split(',') except Exception, e: self.logDebug(e) - self.logWarning("Unable to load supported hoster list, using last known") + self.logWarning(_("Unable to load supported hoster list, using last known")) return ["bitshare.com", "crocko.com", "ddlstorage.com", "depositfiles.com", "extabit.com", "hotfile.com", "mediafire.com", "netload.in", "rapidgator.net", "rapidshare.com", "uploading.com", "uload.to", "uploaded.to"] diff --git a/module/plugins/hooks/Ev0InFetcher.py b/module/plugins/hooks/Ev0InFetcher.py index c54c38bc6..881cb36ef 100644 --- a/module/plugins/hooks/Ev0InFetcher.py +++ b/module/plugins/hooks/Ev0InFetcher.py @@ -67,15 +67,14 @@ class Ev0InFetcher(Hook): if show.lower() in normalizefiletitle(item['title']) and lastfound < int(mktime(item.date_parsed)): links = self.filterLinks(item['description'].split("
")) packagename = item['title'].encode("utf-8") - self.logInfo("Ev0InFetcher: new episode '%s' (matched '%s')" % (packagename, show)) + self.logInfo(_("New episode '%s' (matched '%s')") % (packagename, show)) self.core.api.addPackage(packagename, links, 1 if self.getConfig("queue") else 0) self.setStorage("show_%s_lastfound" % show, int(mktime(item.date_parsed))) found = True if not found: - #self.logDebug("Ev0InFetcher: no new episodes found") pass for show, lastfound in self.getStorage().iteritems(): if int(lastfound) > 0 and int(lastfound) + (3600 * 24 * 30) < int(time()): self.delStorage("show_%s_lastfound" % show) - self.logDebug("Ev0InFetcher: cleaned '%s' record" % show) + self.logDebug("Cleaned '%s' record" % show) diff --git a/module/plugins/hooks/ExpertDecoders.py b/module/plugins/hooks/ExpertDecoders.py index c7ab80da0..06f1e9982 100644 --- a/module/plugins/hooks/ExpertDecoders.py +++ b/module/plugins/hooks/ExpertDecoders.py @@ -49,7 +49,6 @@ class ExpertDecoders(Hook): with open(task.captchaFile, 'rb') as f: data = f.read() data = b64encode(data) - #self.logDebug("%s: %s : %s" % (ticket, task.captchaFile, data)) req = getRequest() #raise timeout threshold @@ -61,7 +60,7 @@ class ExpertDecoders(Hook): finally: req.close() - self.logDebug("result %s : %s" % (ticket, result)) + self.logDebug("Result %s : %s" % (ticket, result)) task.setResult(result) def newCaptchaTask(self, task): @@ -88,7 +87,7 @@ class ExpertDecoders(Hook): try: response = getURL(self.API_URL, post={"action": "refund", "key": self.getConfig("passkey"), "gen_task_id": task.data['ticket']}) - self.logInfo("Request refund: %s" % response) + self.logInfo(_("Request refund"), response) except BadHeader, e: - self.logError("Could not send refund request.", str(e)) + self.logError(_("Could not send refund request."), e) diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index bdde9cd62..7576149b9 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -43,7 +43,7 @@ class ExternalScripts(Hook): for script_type, names in self.scripts.iteritems(): if names: - self.logInfo((_("Installed scripts for %s: ") % script_type) + ", ".join([basename(x) for x in names])) + self.logInfo(_("Installed scripts for"), script_type, ", ".join([basename(x) for x in names])) def initPluginType(self, folder, path): @@ -67,11 +67,11 @@ class ExternalScripts(Hook): def callScript(self, script, *args): try: cmd = [script] + [str(x) if not isinstance(x, basestring) else x for x in args] - self.logDebug("Executing %(script)s: %(cmd)s" % {"script": abspath(script), "cmd": " ".join(cmd)}) + self.logDebug("Executing", abspath(script), " ".join(cmd)) #output goes to pyload subprocess.Popen(cmd, bufsize=-1) except Exception, e: - self.logError(_("Error in %(script)s: %(error)s") % {"script": basename(script), "error": str(e)}) + self.logError(_("Error in %(script)s: %(error)s") % {"script": basename(script), "error": e}) def downloadPreparing(self, pyfile): diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 84f6eab25..34daf8f4f 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -93,12 +93,12 @@ class ExtractArchive(Hook): if e.errno == 2: self.logInfo(_("No %s installed") % p) else: - self.logWarning(_("Could not activate %s") % p, str(e)) + self.logWarning(_("Could not activate %s") % p, e) if self.core.debug: print_exc() except Exception, e: - self.logWarning(_("Could not activate %s") % p, str(e)) + self.logWarning(_("Could not activate %s") % p, e) if self.core.debug: print_exc() @@ -197,16 +197,16 @@ class ExtractArchive(Hook): password = p.password.strip().splitlines() new_files = self._extract(klass, fid, password, thread) except Exception, e: - self.logError(basename(target), str(e)) + self.logError(basename(target), e) success = False continue - self.logDebug("Extracted: %s" % new_files) + self.logDebug("Extracted", new_files) self.setPermissions(new_files) for file in new_files: if not exists(file): - self.logDebug("new file %s does not exists" % file) + self.logDebug("New file %s does not exists" % file) continue if recursive and isfile(file): new_files_ids.append((file, fid)) # append as new target @@ -242,7 +242,7 @@ class ExtractArchive(Hook): success = True else: self.logInfo(basename(plugin.file), _("Password protected")) - self.logDebug("Passwords: %s" % str(passwords)) + self.logDebug("Passwords", passwords) pwlist = copy(self.getPasswords()) # remove already supplied pws from list (only local) @@ -252,7 +252,7 @@ class ExtractArchive(Hook): for pw in passwords + pwlist: try: - self.logDebug("Try password: %s" % pw) + self.logDebug("Try password", pw) if plugin.checkPassword(pw): plugin.extract(progress, pw) self.addPassword(pw) @@ -265,7 +265,7 @@ class ExtractArchive(Hook): raise Exception(_("Wrong password")) if self.core.debug: - self.logDebug("Would delete: %s" % ", ".join(plugin.getDeleteFiles())) + self.logDebug("Would delete", ", ".join(plugin.getDeleteFiles())) if deletearchive: files = plugin.getDeleteFiles() @@ -284,13 +284,13 @@ class ExtractArchive(Hook): return extracted_files except ArchiveError, e: - self.logError(basename(plugin.file), _("Archive Error"), str(e)) + self.logError(basename(plugin.file), _("Archive Error"), e) except CRCError: self.logError(basename(plugin.file), _("CRC Mismatch")) except Exception, e: if self.core.debug: print_exc() - self.logError(basename(plugin.file), _("Unknown Error"), str(e)) + self.logError(basename(plugin.file), _("Unknown Error"), e) self.manager.dispatchEvent("archive_extract_failed", pyfile) raise Exception(_("Extract failed")) diff --git a/module/plugins/hooks/FreeWayMe.py b/module/plugins/hooks/FreeWayMe.py index 12d58ac8a..1926188e3 100644 --- a/module/plugins/hooks/FreeWayMe.py +++ b/module/plugins/hooks/FreeWayMe.py @@ -22,5 +22,5 @@ class FreeWayMe(MultiHoster): def getHoster(self): hostis = getURL("https://www.free-way.me/ajax/jd.php", get={"id": 3}).replace("\"", "").strip() - self.logDebug("hosters: %s" % hostis) + self.logDebug("Hosters", hostis) return [x.strip() for x in hostis.split(",") if x.strip()] diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index 7ebc0275f..fe458328a 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -89,8 +89,8 @@ class IRCInterface(Thread, Hook): for t in self.getConfig("owner").split(): if t.strip().startswith("#"): self.sock.send("JOIN %s\r\n" % t.strip()) - self.logInfo("pyLoad IRC: Connected to %s!" % host) - self.logInfo("pyLoad IRC: Switching to listening mode!") + self.logInfo(_("Connected to"), host) + self.logInfo(_("Switching to listening mode!")) try: self.main_loop() @@ -177,7 +177,7 @@ class IRCInterface(Thread, Hook): for line in res: self.response(line, msg['origin']) except Exception, e: - self.logError("pyLoad IRC: " + repr(e)) + self.logError(repr(e)) def response(self, msg, origin=""): if origin == "": diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py index d9d4e547e..a3e16b522 100644 --- a/module/plugins/hooks/ImageTyperz.py +++ b/module/plugins/hooks/ImageTyperz.py @@ -61,7 +61,7 @@ class ImageTyperz(Hook): except: raise ImageTyperzException("invalid response") - self.logInfo("Account balance: $%s left" % response) + self.logInfo(_("Account balance: $%s left") % response) return balance def submit(self, captcha, captchaType="file", match=None): @@ -118,7 +118,7 @@ class ImageTyperz(Hook): start_new_thread(self.processCaptcha, (task,)) else: - self.logInfo("Your %s account has not enough credits" % self.__name__) + self.logInfo(_("Your %s account has not enough credits") % self.__name__) def captchaInvalid(self, task): if task.data['service'] == self.__name__ and "ticket" in task.data: @@ -127,9 +127,9 @@ class ImageTyperz(Hook): "imageid": task.data['ticket']}) if response == "SUCCESS": - self.logInfo("Bad captcha solution received, requested refund") + self.logInfo(_("Bad captcha solution received, requested refund")) else: - self.logError("Bad captcha solution received, refund request failed", response) + self.logError(_("Bad captcha solution received, refund request failed"), response) def processCaptcha(self, task): c = task.captchaFile diff --git a/module/plugins/hooks/LinkdecrypterCom.py b/module/plugins/hooks/LinkdecrypterCom.py index 1aa8f7ca1..fe2e85a01 100644 --- a/module/plugins/hooks/LinkdecrypterCom.py +++ b/module/plugins/hooks/LinkdecrypterCom.py @@ -52,4 +52,4 @@ class LinkdecrypterCom(Hook): dict['pattern'] = regexp dict['re'] = re.compile(regexp) - self.logDebug("REGEXP: " + regexp) + self.logDebug("REGEXP", regexp) diff --git a/module/plugins/hooks/MegaDebridEu.py b/module/plugins/hooks/MegaDebridEu.py index 605b04f21..81c3be07e 100644 --- a/module/plugins/hooks/MegaDebridEu.py +++ b/module/plugins/hooks/MegaDebridEu.py @@ -25,7 +25,7 @@ class MegaDebridEu(MultiHoster): if json_data['response_code'] == "ok": host_list = [element[0] for element in json_data['hosters']] else: - self.logError("Unable to retrieve hoster list") + self.logError(_("Unable to retrieve hoster list")) host_list = list() return host_list diff --git a/module/plugins/hooks/MergeFiles.py b/module/plugins/hooks/MergeFiles.py index a859092fb..dc8092d0a 100644 --- a/module/plugins/hooks/MergeFiles.py +++ b/module/plugins/hooks/MergeFiles.py @@ -44,11 +44,11 @@ class MergeFiles(Hook): download_folder = save_join(download_folder, pack.folder) for name, file_list in files.iteritems(): - self.logInfo("Starting merging of %s" % name) + self.logInfo(_("Starting merging of"), name) final_file = open(save_join(download_folder, name), "wb") for splitted_file in file_list: - self.logDebug("Merging part %s" % splitted_file) + self.logDebug("Merging part", splitted_file) pyfile = self.core.files.getFile(fid_dict[splitted_file]) pyfile.setStatus("processing") try: @@ -64,7 +64,7 @@ class MergeFiles(Hook): else: break s_file.close() - self.logDebug("Finished merging part %s" % splitted_file) + self.logDebug("Finished merging part", splitted_file) except Exception, e: print traceback.print_exc() finally: @@ -73,4 +73,4 @@ class MergeFiles(Hook): pyfile.release() final_file.close() - self.logInfo("Finished merging of %s" % name) + self.logInfo(_("Finished merging of"), name) diff --git a/module/plugins/hooks/MultiHome.py b/module/plugins/hooks/MultiHome.py index e2167b65e..418dfde71 100644 --- a/module/plugins/hooks/MultiHome.py +++ b/module/plugins/hooks/MultiHome.py @@ -44,7 +44,7 @@ class MultiHome(Hook): if iface: iface.useFor(pluginName, account) requestFactory.iface = lambda: iface.adress - self.logDebug("Multihome: using address: " + iface.adress) + self.logDebug("Using address", iface.adress) return oldGetRequest(pluginName, account) requestFactory.getRequest = getRequest diff --git a/module/plugins/hooks/MyfastfileCom.py b/module/plugins/hooks/MyfastfileCom.py index bbf665b08..9b9654402 100644 --- a/module/plugins/hooks/MyfastfileCom.py +++ b/module/plugins/hooks/MyfastfileCom.py @@ -20,7 +20,7 @@ class MyfastfileCom(MultiHoster): def getHoster(self): json_data = getURL('http://myfastfile.com/api.php?hosts', decode=True) - self.logDebug('JSON data: ' + json_data) + self.logDebug("JSON data", json_data) json_data = json_loads(json_data) return json_data['hosts'] diff --git a/module/plugins/hooks/OverLoadMe.py b/module/plugins/hooks/OverLoadMe.py index 5be0b8482..fc026a187 100644 --- a/module/plugins/hooks/OverLoadMe.py +++ b/module/plugins/hooks/OverLoadMe.py @@ -26,6 +26,6 @@ class OverLoadMe(MultiHoster): page = getURL(https + "://api.over-load.me/hoster.php", get={"auth": "0001-cb1f24dadb3aa487bda5afd3b76298935329be7700cd7-5329be77-00cf-1ca0135f"} ).replace("\"", "").strip() - self.logDebug("Hosterlist: %s" % page) + self.logDebug("Hosterlist", page) return [x.strip() for x in page.split(",") if x.strip()] diff --git a/module/plugins/hooks/RehostTo.py b/module/plugins/hooks/RehostTo.py index d504bb83b..6917a2ead 100644 --- a/module/plugins/hooks/RehostTo.py +++ b/module/plugins/hooks/RehostTo.py @@ -30,7 +30,7 @@ class RehostTo(MultiHoster): user = self.account.selectAccount()[0] if not user: - self.logError("Rehost.to: " + _("Please add your rehost.to account first and restart pyLoad")) + self.logError(_("Please add your rehost.to account first and restart pyLoad")) return data = self.account.getAccountInfo(user) diff --git a/module/plugins/hooks/RestartFailed.py b/module/plugins/hooks/RestartFailed.py index 3aef6f8cd..30c808b4d 100644 --- a/module/plugins/hooks/RestartFailed.py +++ b/module/plugins/hooks/RestartFailed.py @@ -31,7 +31,7 @@ class RestartFailed(Hook): self.logDebug("Invalid interval value, kept current") def periodical(self): - self.logInfo("Restart failed downloads") + self.logInfo(_("Restart failed downloads")) self.api.restartFailed() def setup(self): diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index f25c5e2b4..685c9573d 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -22,14 +22,14 @@ class UnSkipOnFail(Hook): def downloadFailed(self, pyfile): pyfile_name = basename(pyfile.name) pid = pyfile.package().id - msg = 'look for skipped duplicates for %s (pid:%s)...' + msg = _('look for skipped duplicates for %s (pid:%s)') self.logInfo(msg % (pyfile_name, pid)) dups = self.findDuplicates(pyfile) for link in dups: # check if link is "skipped"(=4) if link.status == 4: lpid = link.packageID - self.logInfo('restart "%s" (pid:%s)...' % (pyfile_name, lpid)) + self.logInfo(_('restart "%s" (pid:%s)') % (pyfile_name, lpid)) self.setLinkStatus(link, "queued") def findDuplicates(self, pyfile): diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 546e6e6e8..6de3f4935 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -207,7 +207,7 @@ class UpdateManager(Hook): else: raise Exception, _("Version mismatch") except Exception, e: - self.logError(_("Error updating plugin %s") % filename, str(e)) + self.logError(_("Error updating plugin %s") % filename, e) if blacklist: blacklisted = sorted(map(lambda x: (x.split('|')[0], x.split('|')[1].rsplit('.', 1)[0]), blacklist)) @@ -247,7 +247,7 @@ class UpdateManager(Hook): if not type_plugins: return - self.logDebug("Request deletion of plugins: %s" % type_plugins) + self.logDebug("Requested deletion of plugins", type_plugins) removed = [] @@ -261,7 +261,7 @@ class UpdateManager(Hook): try: remove(filename) except Exception, e: - self.logDebug("Error deleting \"%s\"" % path.basename(filename), str(e)) + self.logDebug("Error deleting", path.basename(filename), e) err = True filename += "c" @@ -271,7 +271,7 @@ class UpdateManager(Hook): self.manager.deactivateHook(name) remove(filename) except Exception, e: - self.logDebug("Error deleting \"%s\"" % path.basename(filename), str(e)) + self.logDebug("Error deleting", path.basename(filename), e) err = True if not err: diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index e19b40e22..1042d9498 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -62,7 +62,6 @@ class XFileSharingPro(Hook): return regexp = r"http://(?:[^/]*\.)?(%s)/(?:embed-)?\w{12}" % ("|".join(sorted(hosterList)).replace('.', '\.')) - #self.logDebug(regexp) dict = self.core.pluginManager.hosterPlugins['XFileSharingPro'] dict['pattern'] = regexp diff --git a/module/plugins/hooks/XMPPInterface.py b/module/plugins/hooks/XMPPInterface.py index c4a94a8bc..47d4d9fe4 100644 --- a/module/plugins/hooks/XMPPInterface.py +++ b/module/plugins/hooks/XMPPInterface.py @@ -84,22 +84,22 @@ class XMPPInterface(IRCInterface, JabberClient): try: self.loop() except Exception, ex: - self.logError("pyLoad XMPP: %s" % str(ex)) + self.logError(ex) def stream_state_changed(self, state, arg): """This one is called when the state of stream connecting the component to a server changes. This will usually be used to let the user know what is going on.""" - self.logDebug("pyLoad XMPP: *** State changed: %s %r ***" % (state, arg)) + self.logDebug("*** State changed: %s %r ***" % (state, arg)) def disconnected(self): - self.logDebug("pyLoad XMPP: Client was disconnected") + self.logDebug("Client was disconnected") def stream_closed(self, stream): - self.logDebug("pyLoad XMPP: Stream was closed | %s" % stream) + self.logDebug("Stream was closed", stream) def stream_error(self, err): - self.logDebug("pyLoad XMPP: Stream Error: %s" % err) + self.logDebug("Stream Error", err) def get_message_handlers(self): """Return list of (message_type, message_handler) tuples. @@ -113,8 +113,8 @@ class XMPPInterface(IRCInterface, JabberClient): subject = stanza.get_subject() body = stanza.get_body() t = stanza.get_type() - self.logDebug(u'pyLoad XMPP: Message from %s received.' % (unicode(stanza.get_from(),))) - self.logDebug(u'pyLoad XMPP: Body: %s Subject: %s Type: %s' % (body, subject, t)) + self.logDebug("Message from %s received." % unicode(stanza.get_from())) + self.logDebug("Body: %s Subject: %s Type: %s" % (body, subject, t)) if t == "headline": # 'headline' messages should never be replied to @@ -158,7 +158,7 @@ class XMPPInterface(IRCInterface, JabberClient): messages.append(m) except Exception, e: - self.logError("pyLoad XMPP: " + repr(e)) + self.logError(repr(e)) return messages @@ -171,7 +171,7 @@ class XMPPInterface(IRCInterface, JabberClient): def announce(self, message): """ send message to all owners""" for user in self.getConfig("owners").split(";"): - self.logDebug("pyLoad XMPP: Send message to %s" % user) + self.logDebug("Send message to", user) to_jid = JID(user) -- cgit v1.2.3 From a9117257f71984d553811a605150acb5d1b499ce Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 5 Oct 2014 02:27:07 +0200 Subject: Better import lib header --- module/plugins/hooks/Ev0InFetcher.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/Ev0InFetcher.py b/module/plugins/hooks/Ev0InFetcher.py index 881cb36ef..35a5c207c 100644 --- a/module/plugins/hooks/Ev0InFetcher.py +++ b/module/plugins/hooks/Ev0InFetcher.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- -from time import mktime, time +import feedparser -from module.lib import feedparser +from time import mktime, time from module.plugins.Hook import Hook -- cgit v1.2.3 From e5499906077a51df1c3b29e22234f37cec4a58ed Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 5 Oct 2014 03:35:49 +0200 Subject: Remove old Ev0InFetcher hook --- module/plugins/hooks/Ev0InFetcher.py | 80 ------------------------------------ 1 file changed, 80 deletions(-) delete mode 100644 module/plugins/hooks/Ev0InFetcher.py (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/Ev0InFetcher.py b/module/plugins/hooks/Ev0InFetcher.py deleted file mode 100644 index 35a5c207c..000000000 --- a/module/plugins/hooks/Ev0InFetcher.py +++ /dev/null @@ -1,80 +0,0 @@ -# -*- coding: utf-8 -*- - -import feedparser - -from time import mktime, time - -from module.plugins.Hook import Hook - - -class Ev0InFetcher(Hook): - __name__ = "Ev0InFetcher" - __type__ = "hook" - __version__ = "0.21" - - __config__ = [("activated", "bool", "Activated", False), - ("interval", "int", "Check interval in minutes", 10), - ("queue", "bool", "Move new shows directly to Queue", False), - ("shows", "str", "Shows to check for (comma seperated)", ""), - ("quality", "xvid;x264;rmvb", "Video Format", "xvid"), - ("hoster", "str", "Hoster to use (comma seperated)", - "NetloadIn,RapidshareCom,MegauploadCom,HotfileCom")] - - __description__ = """Checks rss feeds for Ev0.in""" - __author_name__ = "mkaay" - __author_mail__ = "mkaay@mkaay.de" - - - def setup(self): - self.interval = self.getConfig("interval") * 60 - - def filterLinks(self, links): - results = self.core.pluginManager.parseUrls(links) - sortedLinks = {} - - for url, hoster in results: - if hoster not in sortedLinks: - sortedLinks[hoster] = [] - sortedLinks[hoster].append(url) - - for h in self.getConfig("hoster").split(","): - try: - return sortedLinks[h.strip()] - except: - continue - return [] - - - def periodical(self): - - def normalizefiletitle(filename): - filename = filename.replace('.', ' ') - filename = filename.replace('_', ' ') - filename = filename.lower() - return filename - - shows = [s.strip() for s in self.getConfig("shows").split(",")] - - feed = feedparser.parse("http://feeds.feedburner.com/ev0in/%s?format=xml" % self.getConfig("quality")) - - showStorage = {} - for show in shows: - showStorage[show] = int(self.getStorage("show_%s_lastfound" % show, 0)) - - found = False - for item in feed['items']: - for show, lastfound in showStorage.iteritems(): - if show.lower() in normalizefiletitle(item['title']) and lastfound < int(mktime(item.date_parsed)): - links = self.filterLinks(item['description'].split("
")) - packagename = item['title'].encode("utf-8") - self.logInfo(_("New episode '%s' (matched '%s')") % (packagename, show)) - self.core.api.addPackage(packagename, links, 1 if self.getConfig("queue") else 0) - self.setStorage("show_%s_lastfound" % show, int(mktime(item.date_parsed))) - found = True - if not found: - pass - - for show, lastfound in self.getStorage().iteritems(): - if int(lastfound) > 0 and int(lastfound) + (3600 * 24 * 30) < int(time()): - self.delStorage("show_%s_lastfound" % show) - self.logDebug("Cleaned '%s' record" % show) -- cgit v1.2.3 From 2a5ff9ce8b025336cccdd7dde1260a7255efc683 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 5 Oct 2014 17:06:22 +0200 Subject: Fix pillow import header --- module/plugins/hooks/CaptchaBrotherhood.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py index e4d24c366..217f0b89f 100644 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ b/module/plugins/hooks/CaptchaBrotherhood.py @@ -5,7 +5,11 @@ from __future__ import with_statement import StringIO import pycurl -from PIL import Image +try: + from PIL import Image +except ImportError: + import Image + from thread import start_new_thread from time import sleep from urllib import urlencode -- cgit v1.2.3 From 675dec650ee14137d9e613dcb780776257568654 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Oct 2014 13:11:04 +0200 Subject: [XFileSharingPro] Code cosmetics --- module/plugins/hooks/XFileSharingPro.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 1042d9498..65edbc72d 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -11,9 +11,9 @@ class XFileSharingPro(Hook): __version__ = "0.12" __config__ = [("activated", "bool", "Activated", True), - ("loadDefault", "bool", "Include default (built-in) hoster list", True), - ("includeList", "str", "Include hosters (comma separated)", ""), - ("excludeList", "str", "Exclude hosters (comma separated)", "")] + ("load_default", "bool", "Include default (built-in) hoster list", True), + ("include_hosters", "str", "Include hosters (comma separated)", ""), + ("exclude_hosters", "str", "Exclude hosters (comma separated)", "")] __description__ = """XFileSharingPro hook plugin""" __author_name__ = "zoidberg" @@ -25,11 +25,11 @@ class XFileSharingPro(Hook): def loadPattern(self): - hosterList = self.getConfigSet('includeList') - excludeList = self.getConfigSet('excludeList') + hoster_list = self.getConfigSet('include_hosters') + exclude_list = self.getConfigSet('exclude_hosters') - if self.getConfig('loadDefault'): - hosterList |= set(( + if self.getConfig('load_default'): + hoster_list |= set(( #WORKING HOSTERS: "aieshare.com", "asixfiles.com", "banashare.com", "cyberlocker.ch", "eyesfile.co", "eyesfile.com", "fileband.com", "filedwon.com", "filedownloads.org", "hipfile.com", "kingsupload.com", "mlfat4arab.com", @@ -54,19 +54,19 @@ class XFileSharingPro(Hook): "ddlanime.com", "fileforth.com", "loombo.com", "goldfile.eu", "putshare.com" )) - hosterList -= (excludeList) - hosterList -= set(('', u'')) + hoster_list -= (exclude_list) + hoster_list -= set(('', u'')) - if not hosterList: + if not hoster_list: self.unload() return - regexp = r"http://(?:[^/]*\.)?(%s)/(?:embed-)?\w{12}" % ("|".join(sorted(hosterList)).replace('.', '\.')) + regexp = r"http://(?:[^/]*\.)?(%s)/(?:embed-)?\w{12}" % ("|".join(sorted(hoster_list)).replace('.', '\.')) dict = self.core.pluginManager.hosterPlugins['XFileSharingPro'] dict['pattern'] = regexp dict['re'] = re.compile(regexp) - self.logDebug("Pattern loaded - handling %d hosters" % len(hosterList)) + self.logDebug("Pattern loaded - handling %d hosters" % len(hoster_list)) def getConfigSet(self, option): -- cgit v1.2.3 From b0868ae6446078bacf1635dde5e4ab316b4a94cb Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Oct 2014 18:57:59 +0200 Subject: New __authors__ key replaces __author_name__ and __author_mail__ + Whitespaces and EOF fixup --- module/plugins/hooks/AlldebridCom.py | 3 +-- module/plugins/hooks/BypassCaptcha.py | 6 ++++-- module/plugins/hooks/Captcha9kw.py | 4 ++-- module/plugins/hooks/CaptchaBrotherhood.py | 5 +++-- module/plugins/hooks/Checksum.py | 6 ++++-- module/plugins/hooks/ClickAndLoad.py | 4 ++-- module/plugins/hooks/DeathByCaptcha.py | 5 +++-- module/plugins/hooks/DebridItaliaCom.py | 3 +-- module/plugins/hooks/DeleteFinished.py | 3 +-- module/plugins/hooks/DownloadScheduler.py | 4 ++-- module/plugins/hooks/EasybytezCom.py | 3 +-- module/plugins/hooks/ExpertDecoders.py | 7 ++++--- module/plugins/hooks/ExternalScripts.py | 7 +++++-- module/plugins/hooks/ExtractArchive.py | 6 ++++-- module/plugins/hooks/FastixRu.py | 3 +-- module/plugins/hooks/FreeWayMe.py | 3 +-- module/plugins/hooks/HotFolder.py | 3 +-- module/plugins/hooks/IRCInterface.py | 3 +-- module/plugins/hooks/ImageTyperz.py | 5 +++-- module/plugins/hooks/LinkdecrypterCom.py | 3 +-- module/plugins/hooks/LinksnappyCom.py | 3 +-- module/plugins/hooks/MegaDebridEu.py | 3 +-- module/plugins/hooks/MergeFiles.py | 4 ++-- module/plugins/hooks/MultiHome.py | 3 +-- module/plugins/hooks/MultishareCz.py | 4 ++-- module/plugins/hooks/MyfastfileCom.py | 4 ++-- module/plugins/hooks/OverLoadMe.py | 3 +-- module/plugins/hooks/PremiumTo.py | 8 ++++++-- module/plugins/hooks/PremiumizeMe.py | 3 +-- module/plugins/hooks/RPNetBiz.py | 3 +-- module/plugins/hooks/RealdebridCom.py | 3 +-- module/plugins/hooks/RehostTo.py | 3 +-- module/plugins/hooks/RestartFailed.py | 6 +++--- module/plugins/hooks/SimplyPremiumCom.py | 3 +-- module/plugins/hooks/SimplydebridCom.py | 3 +-- module/plugins/hooks/UnSkipOnFail.py | 3 +-- module/plugins/hooks/UnrestrictLi.py | 3 +-- module/plugins/hooks/UpdateManager.py | 3 +-- module/plugins/hooks/WindowsPhoneToastNotify.py | 3 +-- module/plugins/hooks/XFileSharingPro.py | 3 +-- module/plugins/hooks/XMPPInterface.py | 3 +-- module/plugins/hooks/ZeveraCom.py | 3 +-- 42 files changed, 77 insertions(+), 86 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/AlldebridCom.py b/module/plugins/hooks/AlldebridCom.py index 906875a69..9eddb6f56 100644 --- a/module/plugins/hooks/AlldebridCom.py +++ b/module/plugins/hooks/AlldebridCom.py @@ -17,8 +17,7 @@ class AlldebridCom(MultiHoster): ("interval", "int", "Reload interval in hours (0 to disable)", 24)] __description__ = """Alldebrid.com hook plugin""" - __author_name__ = "Andy Voigt" - __author_mail__ = "spamsales@online.de" + __authors__ = [("Andy Voigt", "spamsales@online.de")] def getHoster(self): diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index 93723681a..a56fcf9bc 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -33,8 +33,10 @@ class BypassCaptcha(Hook): ("passkey", "password", "Passkey", "")] __description__ = """Send captchas to BypassCaptcha.com""" - __author_name__ = ("RaNaN", "Godofdream", "zoidberg") - __author_mail__ = ("RaNaN@pyload.org", "soilfcition@gmail.com", "zoidberg@mujmail.cz") + __authors__ = [("RaNaN", "RaNaN@pyload.org"), + ("Godofdream", "soilfcition@gmail.com"), + ("zoidberg", "zoidberg@mujmail.cz")] + PYLOAD_KEY = "4f771155b640970d5607f919a615bdefc67e7d32" diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index 7a54bb784..bef5c6b01 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -30,8 +30,8 @@ class Captcha9kw(Hook): ("passkey", "password", "API key", "")] __description__ = """Send captchas to 9kw.eu""" - __author_name__ = "RaNaN" - __author_mail__ = "RaNaN@pyload.org" + __authors__ = [("RaNaN", "RaNaN@pyload.org")] + API_URL = "://www.9kw.eu/index.cgi" diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py index 217f0b89f..130ec128e 100644 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ b/module/plugins/hooks/CaptchaBrotherhood.py @@ -44,8 +44,9 @@ class CaptchaBrotherhood(Hook): ("passkey", "password", "Password", "")] __description__ = """Send captchas to CaptchaBrotherhood.com""" - __author_name__ = ("RaNaN", "zoidberg") - __author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz") + __authors__ = [("RaNaN", "RaNaN@pyload.org"), + ("zoidberg", "zoidberg@mujmail.cz")] + API_URL = "http://www.captchabrotherhood.com/" diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index 525eb8150..dddae5ed0 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -50,8 +50,10 @@ class Checksum(Hook): ("wait_time", "int", "Time to wait before each retry (seconds)", 1)] __description__ = """Verify downloaded file size and checksum""" - __author_name__ = ("zoidberg", "Walter Purcaro", "stickell") - __author_mail__ = ("zoidberg@mujmail.cz", "vuolter@gmail.com", "l.stickell@yahoo.it") + __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), + ("Walter Purcaro", "vuolter@gmail.com"), + ("stickell", "l.stickell@yahoo.it")] + methods = {'sfv': 'crc32', 'crc': 'crc32', 'hash': 'md5'} regexps = {'sfv': r'^(?P[^;].+)\s+(?P[0-9A-Fa-f]{8})$', diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py index 2bff53d7e..f40a6d999 100644 --- a/module/plugins/hooks/ClickAndLoad.py +++ b/module/plugins/hooks/ClickAndLoad.py @@ -15,8 +15,8 @@ class ClickAndLoad(Hook): ("extern", "bool", "Allow external link adding", False)] __description__ = """Gives abillity to use jd's click and load. depends on webinterface""" - __author_name__ = ("RaNaN", "mkaay") - __author_mail__ = ("RaNaN@pyload.de", "mkaay@mkaay.de") + __authors__ = [("RaNaN", "RaNaN@pyload.de"), + ("mkaay", "mkaay@mkaay.de")] def coreReady(self): diff --git a/module/plugins/hooks/DeathByCaptcha.py b/module/plugins/hooks/DeathByCaptcha.py index 0340aefce..48b3a3b44 100644 --- a/module/plugins/hooks/DeathByCaptcha.py +++ b/module/plugins/hooks/DeathByCaptcha.py @@ -55,8 +55,9 @@ class DeathByCaptcha(Hook): ("force", "bool", "Force DBC even if client is connected", False)] __description__ = """Send captchas to DeathByCaptcha.com""" - __author_name__ = ("RaNaN", "zoidberg") - __author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz") + __authors__ = [("RaNaN", "RaNaN@pyload.org"), + ("zoidberg", "zoidberg@mujmail.cz")] + API_URL = "http://api.dbcapi.me/api/" diff --git a/module/plugins/hooks/DebridItaliaCom.py b/module/plugins/hooks/DebridItaliaCom.py index 88efb6b2a..2cb7d0fe1 100644 --- a/module/plugins/hooks/DebridItaliaCom.py +++ b/module/plugins/hooks/DebridItaliaCom.py @@ -15,8 +15,7 @@ class DebridItaliaCom(MultiHoster): ("interval", "int", "Reload interval in hours (0 to disable)", 24)] __description__ = """Debriditalia.com hook plugin""" - __author_name__ = "stickell" - __author_mail__ = "l.stickell@yahoo.it" + __authors__ = [("stickell", "l.stickell@yahoo.it")] def getHoster(self): diff --git a/module/plugins/hooks/DeleteFinished.py b/module/plugins/hooks/DeleteFinished.py index 3db0400a1..c17399bf4 100644 --- a/module/plugins/hooks/DeleteFinished.py +++ b/module/plugins/hooks/DeleteFinished.py @@ -14,8 +14,7 @@ class DeleteFinished(Hook): ('deloffline', 'bool', 'Delete packages with offline links', 'False')] __description__ = """Automatically delete all finished packages from queue""" - __author_name__ = "Walter Purcaro" - __author_mail__ = "vuolter@gmail.com" + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] ## overwritten methods ## diff --git a/module/plugins/hooks/DownloadScheduler.py b/module/plugins/hooks/DownloadScheduler.py index 4652f9a1f..262019ee9 100644 --- a/module/plugins/hooks/DownloadScheduler.py +++ b/module/plugins/hooks/DownloadScheduler.py @@ -18,8 +18,8 @@ class DownloadScheduler(Hook): ("abort", "bool", "Abort active downloads when start period with speed 0", False)] __description__ = """Download Scheduler""" - __author_name__ = ("zoidberg", "stickell") - __author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it") + __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), + ("stickell", "l.stickell@yahoo.it")] def setup(self): diff --git a/module/plugins/hooks/EasybytezCom.py b/module/plugins/hooks/EasybytezCom.py index a84dc5279..6dfda3d2e 100644 --- a/module/plugins/hooks/EasybytezCom.py +++ b/module/plugins/hooks/EasybytezCom.py @@ -15,8 +15,7 @@ class EasybytezCom(MultiHoster): ("hosterList", "str", "Hoster list (comma separated)", "")] __description__ = """EasyBytez.com hook plugin""" - __author_name__ = "zoidberg" - __author_mail__ = "zoidberg@mujmail.cz" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] def getHoster(self): diff --git a/module/plugins/hooks/ExpertDecoders.py b/module/plugins/hooks/ExpertDecoders.py index 06f1e9982..1941cecba 100644 --- a/module/plugins/hooks/ExpertDecoders.py +++ b/module/plugins/hooks/ExpertDecoders.py @@ -22,8 +22,9 @@ class ExpertDecoders(Hook): ("passkey", "password", "Access key", "")] __description__ = """Send captchas to expertdecoders.com""" - __author_name__ = ("RaNaN", "zoidberg") - __author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz") + __authors__ = [("RaNaN", "RaNaN@pyload.org"), + ("zoidberg", "zoidberg@mujmail.cz")] + API_URL = "http://www.fasttypers.org/imagepost.ashx" @@ -55,7 +56,7 @@ class ExpertDecoders(Hook): req.c.setopt(LOW_SPEED_TIME, 80) try: - result = req.load(self.API_URL, post={"action": "upload", "key": self.getConfig("passkey"), + result = req.load(self.API_URL, post={"action": "upload", "key": self.getConfig("passkey"), "file": data, "gen_task_id": ticket}) finally: req.close() diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index 7576149b9..1f1b4e21e 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -18,8 +18,11 @@ class ExternalScripts(Hook): __config__ = [("activated", "bool", "Activated", True)] __description__ = """Run external scripts""" - __author_name__ = ("mkaay", "RaNaN", "spoob", "Walter Purcaro") - __author_mail__ = ("mkaay@mkaay.de", "ranan@pyload.org", "spoob@pyload.org", "vuolter@gmail.com") + __authors__ = [("mkaay", "mkaay@mkaay.de"), + ("RaNaN", "ranan@pyload.org"), + ("spoob", "spoob@pyload.org"), + ("Walter Purcaro", "vuolter@gmail.com")] + event_list = ["archive_extracted", "package_extracted", "all_archives_extracted", "all_archives_processed", "allDownloadsFinished", "allDownloadsProcessed"] diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 34daf8f4f..191b3f1e8 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -70,8 +70,10 @@ class ExtractArchive(Hook): ("renice", "int", "CPU Priority", 0)] __description__ = """Extract different kind of archives""" - __author_name__ = ("RaNaN", "AndroKev", "Walter Purcaro") - __author_mail__ = ("ranan@pyload.org", "@pyloadforum", "vuolter@gmail.com") + __authors__ = [("RaNaN", "ranan@pyload.org"), + ("AndroKev", None), + ("Walter Purcaro", "vuolter@gmail.com")] + event_list = ["allDownloadsProcessed"] diff --git a/module/plugins/hooks/FastixRu.py b/module/plugins/hooks/FastixRu.py index 879dba277..8cb6bbabf 100644 --- a/module/plugins/hooks/FastixRu.py +++ b/module/plugins/hooks/FastixRu.py @@ -16,8 +16,7 @@ class FastixRu(MultiHoster): ("interval", "int", "Reload interval in hours (0 to disable)", 24)] __description__ = """Fastix.ru hook plugin""" - __author_name__ = "Massimo Rosamilia" - __author_mail__ = "max@spiritix.eu" + __authors__ = [("Massimo Rosamilia", "max@spiritix.eu")] def getHoster(self): diff --git a/module/plugins/hooks/FreeWayMe.py b/module/plugins/hooks/FreeWayMe.py index 1926188e3..58a9de18e 100644 --- a/module/plugins/hooks/FreeWayMe.py +++ b/module/plugins/hooks/FreeWayMe.py @@ -16,8 +16,7 @@ class FreeWayMe(MultiHoster): ("interval", "int", "Reload interval in hours (0 to disable)", 24)] __description__ = """FreeWay.me hook plugin""" - __author_name__ = "Nicolas Giese" - __author_mail__ = "james@free-way.me" + __authors__ = [("Nicolas Giese", "james@free-way.me")] def getHoster(self): diff --git a/module/plugins/hooks/HotFolder.py b/module/plugins/hooks/HotFolder.py index 4c81292e3..d38e240ca 100644 --- a/module/plugins/hooks/HotFolder.py +++ b/module/plugins/hooks/HotFolder.py @@ -21,8 +21,7 @@ class HotFolder(Hook): ("file", "str", "Link file", "links.txt")] __description__ = """Observe folder and file for changes and add container and links""" - __author_name__ = "RaNaN" - __author_mail__ = "RaNaN@pyload.de" + __authors__ = [("RaNaN", "RaNaN@pyload.de")] def setup(self): diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index fe458328a..ec76fbf68 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -33,8 +33,7 @@ class IRCInterface(Thread, Hook): ("captcha", "bool", "Send captcha requests", True)] __description__ = """Connect to irc and let owner perform different tasks""" - __author_name__ = "Jeix" - __author_mail__ = "Jeix@hasnomail.com" + __authors__ = [("Jeix", "Jeix@hasnomail.com")] def __init__(self, core, manager): diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py index a3e16b522..6e63b8a0d 100644 --- a/module/plugins/hooks/ImageTyperz.py +++ b/module/plugins/hooks/ImageTyperz.py @@ -38,8 +38,9 @@ class ImageTyperz(Hook): ("force", "bool", "Force IT even if client is connected", False)] __description__ = """Send captchas to ImageTyperz.com""" - __author_name__ = ("RaNaN", "zoidberg") - __author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz") + __authors__ = [("RaNaN", "RaNaN@pyload.org"), + ("zoidberg", "zoidberg@mujmail.cz")] + SUBMIT_URL = "http://captchatypers.com/Forms/UploadFileAndGetTextNEW.ashx" RESPOND_URL = "http://captchatypers.com/Forms/SetBadImage.ashx" diff --git a/module/plugins/hooks/LinkdecrypterCom.py b/module/plugins/hooks/LinkdecrypterCom.py index fe2e85a01..0117938b1 100644 --- a/module/plugins/hooks/LinkdecrypterCom.py +++ b/module/plugins/hooks/LinkdecrypterCom.py @@ -15,8 +15,7 @@ class LinkdecrypterCom(Hook): __config__ = [("activated", "bool", "Activated", False)] __description__ = """Linkdecrypter.com hook plugin""" - __author_name__ = "zoidberg" - __author_mail__ = "zoidberg@mujmail.cz" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] def coreReady(self): diff --git a/module/plugins/hooks/LinksnappyCom.py b/module/plugins/hooks/LinksnappyCom.py index 20da68632..1cf4afaa0 100644 --- a/module/plugins/hooks/LinksnappyCom.py +++ b/module/plugins/hooks/LinksnappyCom.py @@ -17,8 +17,7 @@ class LinksnappyCom(MultiHoster): ("interval", "int", "Reload interval in hours (0 to disable)", 24)] __description__ = """Linksnappy.com hook plugin""" - __author_name__ = "stickell" - __author_mail__ = "l.stickell@yahoo.it" + __authors__ = [("stickell", "l.stickell@yahoo.it")] def getHoster(self): diff --git a/module/plugins/hooks/MegaDebridEu.py b/module/plugins/hooks/MegaDebridEu.py index 81c3be07e..bfdea202f 100644 --- a/module/plugins/hooks/MegaDebridEu.py +++ b/module/plugins/hooks/MegaDebridEu.py @@ -14,8 +14,7 @@ class MegaDebridEu(MultiHoster): ("unloadFailing", "bool", "Revert to standard download if download fails", False)] __description__ = """mega-debrid.eu hook plugin""" - __author_name__ = "D.Ducatel" - __author_mail__ = "dducatel@je-geek.fr" + __authors__ = [("D.Ducatel", "dducatel@je-geek.fr")] def getHoster(self): diff --git a/module/plugins/hooks/MergeFiles.py b/module/plugins/hooks/MergeFiles.py index dc8092d0a..61cef415e 100644 --- a/module/plugins/hooks/MergeFiles.py +++ b/module/plugins/hooks/MergeFiles.py @@ -16,8 +16,8 @@ class MergeFiles(Hook): __config__ = [("activated", "bool", "Activated", False)] __description__ = """Merges parts splitted with hjsplit""" - __author_name__ = "and9000" - __author_mail__ = "me@has-no-mail.com" + __authors__ = [("and9000", "me@has-no-mail.com")] + BUFFER_SIZE = 4096 diff --git a/module/plugins/hooks/MultiHome.py b/module/plugins/hooks/MultiHome.py index 418dfde71..7f223d2b0 100644 --- a/module/plugins/hooks/MultiHome.py +++ b/module/plugins/hooks/MultiHome.py @@ -14,8 +14,7 @@ class MultiHome(Hook): ("interfaces", "str", "Interfaces", "None")] __description__ = """Ip address changer""" - __author_name__ = "mkaay" - __author_mail__ = "mkaay@mkaay.de" + __authors__ = [("mkaay", "mkaay@mkaay.de")] def setup(self): diff --git a/module/plugins/hooks/MultishareCz.py b/module/plugins/hooks/MultishareCz.py index 9249106d6..446b6bc5f 100644 --- a/module/plugins/hooks/MultishareCz.py +++ b/module/plugins/hooks/MultishareCz.py @@ -16,8 +16,8 @@ class MultishareCz(MultiHoster): ("hosterList", "str", "Hoster list (comma separated)", "uloz.to")] __description__ = """MultiShare.cz hook plugin""" - __author_name__ = "zoidberg" - __author_mail__ = "zoidberg@mujmail.cz" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] + HOSTER_PATTERN = r']*?alt="([^"]+)">\s*[^>]*?alt="OK"' diff --git a/module/plugins/hooks/MyfastfileCom.py b/module/plugins/hooks/MyfastfileCom.py index 9b9654402..b7d2ca1bb 100644 --- a/module/plugins/hooks/MyfastfileCom.py +++ b/module/plugins/hooks/MyfastfileCom.py @@ -15,8 +15,8 @@ class MyfastfileCom(MultiHoster): ("unloadFailing", "bool", "Revert to standard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 24)] __description__ = """Myfastfile.com hook plugin""" - __author_name__ = "stickell" - __author_mail__ = "l.stickell@yahoo.it" + __authors__ = [("stickell", "l.stickell@yahoo.it")] + def getHoster(self): json_data = getURL('http://myfastfile.com/api.php?hosts', decode=True) diff --git a/module/plugins/hooks/OverLoadMe.py b/module/plugins/hooks/OverLoadMe.py index fc026a187..8e4c8f4c6 100644 --- a/module/plugins/hooks/OverLoadMe.py +++ b/module/plugins/hooks/OverLoadMe.py @@ -17,8 +17,7 @@ class OverLoadMe(MultiHoster): ("interval", "int", "Reload interval in hours (0 to disable)", 12)] __description__ = """Over-Load.me hook plugin""" - __author_name__ = "marley" - __author_mail__ = "marley@over-load.me" + __authors__ = [("marley", "marley@over-load.me")] def getHoster(self): diff --git a/module/plugins/hooks/PremiumTo.py b/module/plugins/hooks/PremiumTo.py index 0572dab34..700ef0fac 100644 --- a/module/plugins/hooks/PremiumTo.py +++ b/module/plugins/hooks/PremiumTo.py @@ -8,12 +8,16 @@ class PremiumTo(MultiHoster): __name__ = "PremiumTo" __type__ = "hook" __version__ = "0.04" + __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for downloads from supported hosters:", "all"), ("hosterList", "str", "Hoster list (comma separated)", "")] + __description__ = """Premium.to hook plugin""" - __author_name__ = ("RaNaN", "zoidberg", "stickell") - __author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz", "l.stickell@yahoo.it") + __authors__ = [("RaNaN", "RaNaN@pyload.org"), + ("zoidberg", "zoidberg@mujmail.cz"), + ("stickell", "l.stickell@yahoo.it")] + def getHoster(self): page = getURL("http://premium.to/api/hosters.php", diff --git a/module/plugins/hooks/PremiumizeMe.py b/module/plugins/hooks/PremiumizeMe.py index e7291ece9..c11bd3ced 100644 --- a/module/plugins/hooks/PremiumizeMe.py +++ b/module/plugins/hooks/PremiumizeMe.py @@ -17,8 +17,7 @@ class PremiumizeMe(MultiHoster): ("interval", "int", "Reload interval in hours (0 to disable)", 24)] __description__ = """Premiumize.me hook plugin""" - __author_name__ = "Florian Franzen" - __author_mail__ = "FlorianFranzen@gmail.com" + __authors__ = [("Florian Franzen", "FlorianFranzen@gmail.com")] def getHoster(self): diff --git a/module/plugins/hooks/RPNetBiz.py b/module/plugins/hooks/RPNetBiz.py index 9b9b7cda9..6d60b1b98 100644 --- a/module/plugins/hooks/RPNetBiz.py +++ b/module/plugins/hooks/RPNetBiz.py @@ -17,8 +17,7 @@ class RPNetBiz(MultiHoster): ("interval", "int", "Reload interval in hours (0 to disable)", 24)] __description__ = """RPNet.biz hook plugin""" - __author_name__ = "Dman" - __author_mail__ = "dmanugm@gmail.com" + __authors__ = [("Dman", "dmanugm@gmail.com")] def getHoster(self): diff --git a/module/plugins/hooks/RealdebridCom.py b/module/plugins/hooks/RealdebridCom.py index 87902ac7f..9833de7d0 100644 --- a/module/plugins/hooks/RealdebridCom.py +++ b/module/plugins/hooks/RealdebridCom.py @@ -17,8 +17,7 @@ class RealdebridCom(MultiHoster): ("interval", "int", "Reload interval in hours (0 to disable)", 24)] __description__ = """Real-Debrid.com hook plugin""" - __author_name__ = "Devirex Hazzard" - __author_mail__ = "naibaf_11@yahoo.de" + __authors__ = [("Devirex Hazzard", "naibaf_11@yahoo.de")] def getHoster(self): diff --git a/module/plugins/hooks/RehostTo.py b/module/plugins/hooks/RehostTo.py index 6917a2ead..423f465a8 100644 --- a/module/plugins/hooks/RehostTo.py +++ b/module/plugins/hooks/RehostTo.py @@ -16,8 +16,7 @@ class RehostTo(MultiHoster): ("interval", "int", "Reload interval in hours (0 to disable)", 24)] __description__ = """Rehost.to hook plugin""" - __author_name__ = "RaNaN" - __author_mail__ = "RaNaN@pyload.org" + __authors__ = [("RaNaN", "RaNaN@pyload.org")] def getHoster(self): diff --git a/module/plugins/hooks/RestartFailed.py b/module/plugins/hooks/RestartFailed.py index 30c808b4d..8e01ee0f1 100644 --- a/module/plugins/hooks/RestartFailed.py +++ b/module/plugins/hooks/RestartFailed.py @@ -12,13 +12,13 @@ class RestartFailed(Hook): ("interval", "int", "Check interval in minutes", 90)] __description__ = """Periodically restart all failed downloads in queue""" - __author_name__ = "Walter Purcaro" - __author_mail__ = "vuolter@gmail.com" + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - MIN_INTERVAL = 15 * 60 #: 15m minimum check interval (value is in seconds) event_list = ["pluginConfigChanged"] + MIN_INTERVAL = 15 * 60 #: 15m minimum check interval (value is in seconds) + def pluginConfigChanged(self, plugin, name, value): if name == "interval": diff --git a/module/plugins/hooks/SimplyPremiumCom.py b/module/plugins/hooks/SimplyPremiumCom.py index a946d391e..0bdd40f51 100644 --- a/module/plugins/hooks/SimplyPremiumCom.py +++ b/module/plugins/hooks/SimplyPremiumCom.py @@ -17,8 +17,7 @@ class SimplyPremiumCom(MultiHoster): ("interval", "int", "Reload interval in hours (0 to disable)", "24")] __description__ = """Simply-Premium.com hook plugin""" - __author_name__ = "EvolutionClip" - __author_mail__ = "evolutionclip@live.de" + __authors__ = [("EvolutionClip", "evolutionclip@live.de")] def getHoster(self): diff --git a/module/plugins/hooks/SimplydebridCom.py b/module/plugins/hooks/SimplydebridCom.py index ab13f312e..0d8105356 100644 --- a/module/plugins/hooks/SimplydebridCom.py +++ b/module/plugins/hooks/SimplydebridCom.py @@ -14,8 +14,7 @@ class SimplydebridCom(MultiHoster): ("hosterList", "str", "Hoster list (comma separated)", "")] __description__ = """Simply-Debrid.com hook plugin""" - __author_name__ = "Kagenoshin" - __author_mail__ = "kagenoshin@gmx.ch" + __authors__ = [("Kagenoshin", "kagenoshin@gmx.ch")] def getHoster(self): diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index 685c9573d..983eb21fa 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -15,8 +15,7 @@ class UnSkipOnFail(Hook): __config__ = [("activated", "bool", "Activated", True)] __description__ = """When a download fails, restart skipped duplicates""" - __author_name__ = "hagg" - __author_mail__ = None + __authors__ = [("hagg", None)] def downloadFailed(self, pyfile): diff --git a/module/plugins/hooks/UnrestrictLi.py b/module/plugins/hooks/UnrestrictLi.py index ee5d79269..9dc417bf9 100644 --- a/module/plugins/hooks/UnrestrictLi.py +++ b/module/plugins/hooks/UnrestrictLi.py @@ -18,8 +18,7 @@ class UnrestrictLi(MultiHoster): ("history", "bool", "Delete History", False)] __description__ = """Unrestrict.li hook plugin""" - __author_name__ = "stickell" - __author_mail__ = "l.stickell@yahoo.it" + __authors__ = [("stickell", "l.stickell@yahoo.it")] def getHoster(self): diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 6de3f4935..65a7f92e2 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -23,8 +23,7 @@ class UpdateManager(Hook): ("nodebugupdate", "bool", "Don't check for updates in debug mode", True)] __description__ = """ Check for updates """ - __author_name__ = "Walter Purcaro" - __author_mail__ = "vuolter@gmail.com" + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] event_list = ["pluginConfigChanged"] diff --git a/module/plugins/hooks/WindowsPhoneToastNotify.py b/module/plugins/hooks/WindowsPhoneToastNotify.py index 01570b966..bf18d01c0 100644 --- a/module/plugins/hooks/WindowsPhoneToastNotify.py +++ b/module/plugins/hooks/WindowsPhoneToastNotify.py @@ -18,8 +18,7 @@ class WindowsPhoneToastNotify(Hook): ("pushTimeout", "int", "Timeout between notifications in seconds", 0)] __description__ = """Send push notifications to Windows Phone""" - __author_name__ = "Andy Voigt" - __author_mail__ = "phone-support@hotmail.de" + __authors__ = [("Andy Voigt", "phone-support@hotmail.de")] def setup(self): diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 65edbc72d..4b431f813 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -16,8 +16,7 @@ class XFileSharingPro(Hook): ("exclude_hosters", "str", "Exclude hosters (comma separated)", "")] __description__ = """XFileSharingPro hook plugin""" - __author_name__ = "zoidberg" - __author_mail__ = "zoidberg@mujmail.cz" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] def coreReady(self): diff --git a/module/plugins/hooks/XMPPInterface.py b/module/plugins/hooks/XMPPInterface.py index 47d4d9fe4..d6334d8d0 100644 --- a/module/plugins/hooks/XMPPInterface.py +++ b/module/plugins/hooks/XMPPInterface.py @@ -24,8 +24,7 @@ class XMPPInterface(IRCInterface, JabberClient): ("captcha", "bool", "Send captcha requests", True)] __description__ = """Connect to jabber and let owner perform different tasks""" - __author_name__ = "RaNaN" - __author_mail__ = "RaNaN@pyload.org" + __authors__ = [("RaNaN", "RaNaN@pyload.org")] implements(IMessageHandlersProvider) diff --git a/module/plugins/hooks/ZeveraCom.py b/module/plugins/hooks/ZeveraCom.py index 0d5e23118..2c4d9d049 100644 --- a/module/plugins/hooks/ZeveraCom.py +++ b/module/plugins/hooks/ZeveraCom.py @@ -14,8 +14,7 @@ class ZeveraCom(MultiHoster): ("hosterList", "str", "Hoster list (comma separated)", "")] __description__ = """Real-Debrid.com hook plugin""" - __author_name__ = "zoidberg" - __author_mail__ = "zoidberg@mujmail.cz" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] def getHoster(self): -- cgit v1.2.3 From ae7a7e66981456e5bbe2b54006d79b6f907be7a4 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 8 Oct 2014 20:18:13 +0200 Subject: Add __license__ key attribute to plugins --- module/plugins/hooks/AlldebridCom.py | 1 + module/plugins/hooks/BypassCaptcha.py | 1 + module/plugins/hooks/Captcha9kw.py | 1 + module/plugins/hooks/CaptchaBrotherhood.py | 1 + module/plugins/hooks/Checksum.py | 1 + module/plugins/hooks/ClickAndLoad.py | 1 + module/plugins/hooks/DeathByCaptcha.py | 1 + module/plugins/hooks/DebridItaliaCom.py | 1 + module/plugins/hooks/DeleteFinished.py | 1 + module/plugins/hooks/DownloadScheduler.py | 1 + module/plugins/hooks/EasybytezCom.py | 1 + module/plugins/hooks/ExpertDecoders.py | 1 + module/plugins/hooks/ExternalScripts.py | 1 + module/plugins/hooks/ExtractArchive.py | 1 + module/plugins/hooks/FastixRu.py | 1 + module/plugins/hooks/FreeWayMe.py | 1 + module/plugins/hooks/HotFolder.py | 1 + module/plugins/hooks/IRCInterface.py | 1 + module/plugins/hooks/ImageTyperz.py | 1 + module/plugins/hooks/LinkdecrypterCom.py | 1 + module/plugins/hooks/LinksnappyCom.py | 1 + module/plugins/hooks/MegaDebridEu.py | 1 + module/plugins/hooks/MergeFiles.py | 1 + module/plugins/hooks/MultiHome.py | 1 + module/plugins/hooks/MultishareCz.py | 1 + module/plugins/hooks/MyfastfileCom.py | 1 + module/plugins/hooks/OverLoadMe.py | 1 + module/plugins/hooks/PremiumTo.py | 1 + module/plugins/hooks/PremiumizeMe.py | 1 + module/plugins/hooks/RPNetBiz.py | 1 + module/plugins/hooks/RealdebridCom.py | 1 + module/plugins/hooks/RehostTo.py | 1 + module/plugins/hooks/RestartFailed.py | 1 + module/plugins/hooks/SimplyPremiumCom.py | 1 + module/plugins/hooks/SimplydebridCom.py | 1 + module/plugins/hooks/UnSkipOnFail.py | 1 + module/plugins/hooks/UnrestrictLi.py | 1 + module/plugins/hooks/UpdateManager.py | 1 + module/plugins/hooks/WindowsPhoneToastNotify.py | 1 + module/plugins/hooks/XFileSharingPro.py | 1 + module/plugins/hooks/XMPPInterface.py | 1 + module/plugins/hooks/ZeveraCom.py | 1 + 42 files changed, 42 insertions(+) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/AlldebridCom.py b/module/plugins/hooks/AlldebridCom.py index 9eddb6f56..e2e044526 100644 --- a/module/plugins/hooks/AlldebridCom.py +++ b/module/plugins/hooks/AlldebridCom.py @@ -17,6 +17,7 @@ class AlldebridCom(MultiHoster): ("interval", "int", "Reload interval in hours (0 to disable)", 24)] __description__ = """Alldebrid.com hook plugin""" + __license__ = "GPLv3" __authors__ = [("Andy Voigt", "spamsales@online.de")] diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index a56fcf9bc..984aac919 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -33,6 +33,7 @@ class BypassCaptcha(Hook): ("passkey", "password", "Passkey", "")] __description__ = """Send captchas to BypassCaptcha.com""" + __license__ = "GPLv3" __authors__ = [("RaNaN", "RaNaN@pyload.org"), ("Godofdream", "soilfcition@gmail.com"), ("zoidberg", "zoidberg@mujmail.cz")] diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index bef5c6b01..7c1fa40fd 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -30,6 +30,7 @@ class Captcha9kw(Hook): ("passkey", "password", "API key", "")] __description__ = """Send captchas to 9kw.eu""" + __license__ = "GPLv3" __authors__ = [("RaNaN", "RaNaN@pyload.org")] diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py index 130ec128e..3157fead8 100644 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ b/module/plugins/hooks/CaptchaBrotherhood.py @@ -44,6 +44,7 @@ class CaptchaBrotherhood(Hook): ("passkey", "password", "Password", "")] __description__ = """Send captchas to CaptchaBrotherhood.com""" + __license__ = "GPLv3" __authors__ = [("RaNaN", "RaNaN@pyload.org"), ("zoidberg", "zoidberg@mujmail.cz")] diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index dddae5ed0..32597beeb 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -50,6 +50,7 @@ class Checksum(Hook): ("wait_time", "int", "Time to wait before each retry (seconds)", 1)] __description__ = """Verify downloaded file size and checksum""" + __license__ = "GPLv3" __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), ("Walter Purcaro", "vuolter@gmail.com"), ("stickell", "l.stickell@yahoo.it")] diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py index f40a6d999..304cb9233 100644 --- a/module/plugins/hooks/ClickAndLoad.py +++ b/module/plugins/hooks/ClickAndLoad.py @@ -15,6 +15,7 @@ class ClickAndLoad(Hook): ("extern", "bool", "Allow external link adding", False)] __description__ = """Gives abillity to use jd's click and load. depends on webinterface""" + __license__ = "GPLv3" __authors__ = [("RaNaN", "RaNaN@pyload.de"), ("mkaay", "mkaay@mkaay.de")] diff --git a/module/plugins/hooks/DeathByCaptcha.py b/module/plugins/hooks/DeathByCaptcha.py index 48b3a3b44..d58da9a88 100644 --- a/module/plugins/hooks/DeathByCaptcha.py +++ b/module/plugins/hooks/DeathByCaptcha.py @@ -55,6 +55,7 @@ class DeathByCaptcha(Hook): ("force", "bool", "Force DBC even if client is connected", False)] __description__ = """Send captchas to DeathByCaptcha.com""" + __license__ = "GPLv3" __authors__ = [("RaNaN", "RaNaN@pyload.org"), ("zoidberg", "zoidberg@mujmail.cz")] diff --git a/module/plugins/hooks/DebridItaliaCom.py b/module/plugins/hooks/DebridItaliaCom.py index 2cb7d0fe1..667e78b97 100644 --- a/module/plugins/hooks/DebridItaliaCom.py +++ b/module/plugins/hooks/DebridItaliaCom.py @@ -15,6 +15,7 @@ class DebridItaliaCom(MultiHoster): ("interval", "int", "Reload interval in hours (0 to disable)", 24)] __description__ = """Debriditalia.com hook plugin""" + __license__ = "GPLv3" __authors__ = [("stickell", "l.stickell@yahoo.it")] diff --git a/module/plugins/hooks/DeleteFinished.py b/module/plugins/hooks/DeleteFinished.py index c17399bf4..2ca5bfb4a 100644 --- a/module/plugins/hooks/DeleteFinished.py +++ b/module/plugins/hooks/DeleteFinished.py @@ -14,6 +14,7 @@ class DeleteFinished(Hook): ('deloffline', 'bool', 'Delete packages with offline links', 'False')] __description__ = """Automatically delete all finished packages from queue""" + __license__ = "GPLv3" __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] diff --git a/module/plugins/hooks/DownloadScheduler.py b/module/plugins/hooks/DownloadScheduler.py index 262019ee9..c7a0155dd 100644 --- a/module/plugins/hooks/DownloadScheduler.py +++ b/module/plugins/hooks/DownloadScheduler.py @@ -18,6 +18,7 @@ class DownloadScheduler(Hook): ("abort", "bool", "Abort active downloads when start period with speed 0", False)] __description__ = """Download Scheduler""" + __license__ = "GPLv3" __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), ("stickell", "l.stickell@yahoo.it")] diff --git a/module/plugins/hooks/EasybytezCom.py b/module/plugins/hooks/EasybytezCom.py index 6dfda3d2e..5489dd6ac 100644 --- a/module/plugins/hooks/EasybytezCom.py +++ b/module/plugins/hooks/EasybytezCom.py @@ -15,6 +15,7 @@ class EasybytezCom(MultiHoster): ("hosterList", "str", "Hoster list (comma separated)", "")] __description__ = """EasyBytez.com hook plugin""" + __license__ = "GPLv3" __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] diff --git a/module/plugins/hooks/ExpertDecoders.py b/module/plugins/hooks/ExpertDecoders.py index 1941cecba..712b19677 100644 --- a/module/plugins/hooks/ExpertDecoders.py +++ b/module/plugins/hooks/ExpertDecoders.py @@ -22,6 +22,7 @@ class ExpertDecoders(Hook): ("passkey", "password", "Access key", "")] __description__ = """Send captchas to expertdecoders.com""" + __license__ = "GPLv3" __authors__ = [("RaNaN", "RaNaN@pyload.org"), ("zoidberg", "zoidberg@mujmail.cz")] diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index 1f1b4e21e..55182cf84 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -18,6 +18,7 @@ class ExternalScripts(Hook): __config__ = [("activated", "bool", "Activated", True)] __description__ = """Run external scripts""" + __license__ = "GPLv3" __authors__ = [("mkaay", "mkaay@mkaay.de"), ("RaNaN", "ranan@pyload.org"), ("spoob", "spoob@pyload.org"), diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 191b3f1e8..f6958941e 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -70,6 +70,7 @@ class ExtractArchive(Hook): ("renice", "int", "CPU Priority", 0)] __description__ = """Extract different kind of archives""" + __license__ = "GPLv3" __authors__ = [("RaNaN", "ranan@pyload.org"), ("AndroKev", None), ("Walter Purcaro", "vuolter@gmail.com")] diff --git a/module/plugins/hooks/FastixRu.py b/module/plugins/hooks/FastixRu.py index 8cb6bbabf..a6c94a66a 100644 --- a/module/plugins/hooks/FastixRu.py +++ b/module/plugins/hooks/FastixRu.py @@ -16,6 +16,7 @@ class FastixRu(MultiHoster): ("interval", "int", "Reload interval in hours (0 to disable)", 24)] __description__ = """Fastix.ru hook plugin""" + __license__ = "GPLv3" __authors__ = [("Massimo Rosamilia", "max@spiritix.eu")] diff --git a/module/plugins/hooks/FreeWayMe.py b/module/plugins/hooks/FreeWayMe.py index 58a9de18e..110f371c2 100644 --- a/module/plugins/hooks/FreeWayMe.py +++ b/module/plugins/hooks/FreeWayMe.py @@ -16,6 +16,7 @@ class FreeWayMe(MultiHoster): ("interval", "int", "Reload interval in hours (0 to disable)", 24)] __description__ = """FreeWay.me hook plugin""" + __license__ = "GPLv3" __authors__ = [("Nicolas Giese", "james@free-way.me")] diff --git a/module/plugins/hooks/HotFolder.py b/module/plugins/hooks/HotFolder.py index d38e240ca..34a9ff49b 100644 --- a/module/plugins/hooks/HotFolder.py +++ b/module/plugins/hooks/HotFolder.py @@ -21,6 +21,7 @@ class HotFolder(Hook): ("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")] diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index ec76fbf68..d648db7cf 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -33,6 +33,7 @@ class IRCInterface(Thread, Hook): ("captcha", "bool", "Send captcha requests", True)] __description__ = """Connect to irc and let owner perform different tasks""" + __license__ = "GPLv3" __authors__ = [("Jeix", "Jeix@hasnomail.com")] diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py index 6e63b8a0d..aaa3c7bbd 100644 --- a/module/plugins/hooks/ImageTyperz.py +++ b/module/plugins/hooks/ImageTyperz.py @@ -38,6 +38,7 @@ class ImageTyperz(Hook): ("force", "bool", "Force IT even if client is connected", False)] __description__ = """Send captchas to ImageTyperz.com""" + __license__ = "GPLv3" __authors__ = [("RaNaN", "RaNaN@pyload.org"), ("zoidberg", "zoidberg@mujmail.cz")] diff --git a/module/plugins/hooks/LinkdecrypterCom.py b/module/plugins/hooks/LinkdecrypterCom.py index 0117938b1..df1fbee9a 100644 --- a/module/plugins/hooks/LinkdecrypterCom.py +++ b/module/plugins/hooks/LinkdecrypterCom.py @@ -15,6 +15,7 @@ class LinkdecrypterCom(Hook): __config__ = [("activated", "bool", "Activated", False)] __description__ = """Linkdecrypter.com hook plugin""" + __license__ = "GPLv3" __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] diff --git a/module/plugins/hooks/LinksnappyCom.py b/module/plugins/hooks/LinksnappyCom.py index 1cf4afaa0..bfd85f6b5 100644 --- a/module/plugins/hooks/LinksnappyCom.py +++ b/module/plugins/hooks/LinksnappyCom.py @@ -17,6 +17,7 @@ class LinksnappyCom(MultiHoster): ("interval", "int", "Reload interval in hours (0 to disable)", 24)] __description__ = """Linksnappy.com hook plugin""" + __license__ = "GPLv3" __authors__ = [("stickell", "l.stickell@yahoo.it")] diff --git a/module/plugins/hooks/MegaDebridEu.py b/module/plugins/hooks/MegaDebridEu.py index bfdea202f..0d16e04d2 100644 --- a/module/plugins/hooks/MegaDebridEu.py +++ b/module/plugins/hooks/MegaDebridEu.py @@ -14,6 +14,7 @@ class MegaDebridEu(MultiHoster): ("unloadFailing", "bool", "Revert to standard download if download fails", False)] __description__ = """mega-debrid.eu hook plugin""" + __license__ = "GPLv3" __authors__ = [("D.Ducatel", "dducatel@je-geek.fr")] diff --git a/module/plugins/hooks/MergeFiles.py b/module/plugins/hooks/MergeFiles.py index 61cef415e..627a9ec3c 100644 --- a/module/plugins/hooks/MergeFiles.py +++ b/module/plugins/hooks/MergeFiles.py @@ -16,6 +16,7 @@ class MergeFiles(Hook): __config__ = [("activated", "bool", "Activated", False)] __description__ = """Merges parts splitted with hjsplit""" + __license__ = "GPLv3" __authors__ = [("and9000", "me@has-no-mail.com")] diff --git a/module/plugins/hooks/MultiHome.py b/module/plugins/hooks/MultiHome.py index 7f223d2b0..5cda53bd7 100644 --- a/module/plugins/hooks/MultiHome.py +++ b/module/plugins/hooks/MultiHome.py @@ -14,6 +14,7 @@ class MultiHome(Hook): ("interfaces", "str", "Interfaces", "None")] __description__ = """Ip address changer""" + __license__ = "GPLv3" __authors__ = [("mkaay", "mkaay@mkaay.de")] diff --git a/module/plugins/hooks/MultishareCz.py b/module/plugins/hooks/MultishareCz.py index 446b6bc5f..b7c69b3dc 100644 --- a/module/plugins/hooks/MultishareCz.py +++ b/module/plugins/hooks/MultishareCz.py @@ -16,6 +16,7 @@ class MultishareCz(MultiHoster): ("hosterList", "str", "Hoster list (comma separated)", "uloz.to")] __description__ = """MultiShare.cz hook plugin""" + __license__ = "GPLv3" __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] diff --git a/module/plugins/hooks/MyfastfileCom.py b/module/plugins/hooks/MyfastfileCom.py index b7d2ca1bb..80751c6b4 100644 --- a/module/plugins/hooks/MyfastfileCom.py +++ b/module/plugins/hooks/MyfastfileCom.py @@ -15,6 +15,7 @@ class MyfastfileCom(MultiHoster): ("unloadFailing", "bool", "Revert to standard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 24)] __description__ = """Myfastfile.com hook plugin""" + __license__ = "GPLv3" __authors__ = [("stickell", "l.stickell@yahoo.it")] diff --git a/module/plugins/hooks/OverLoadMe.py b/module/plugins/hooks/OverLoadMe.py index 8e4c8f4c6..fcb9a647a 100644 --- a/module/plugins/hooks/OverLoadMe.py +++ b/module/plugins/hooks/OverLoadMe.py @@ -17,6 +17,7 @@ class OverLoadMe(MultiHoster): ("interval", "int", "Reload interval in hours (0 to disable)", 12)] __description__ = """Over-Load.me hook plugin""" + __license__ = "GPLv3" __authors__ = [("marley", "marley@over-load.me")] diff --git a/module/plugins/hooks/PremiumTo.py b/module/plugins/hooks/PremiumTo.py index 700ef0fac..e783bac8f 100644 --- a/module/plugins/hooks/PremiumTo.py +++ b/module/plugins/hooks/PremiumTo.py @@ -14,6 +14,7 @@ class PremiumTo(MultiHoster): ("hosterList", "str", "Hoster list (comma separated)", "")] __description__ = """Premium.to hook plugin""" + __license__ = "GPLv3" __authors__ = [("RaNaN", "RaNaN@pyload.org"), ("zoidberg", "zoidberg@mujmail.cz"), ("stickell", "l.stickell@yahoo.it")] diff --git a/module/plugins/hooks/PremiumizeMe.py b/module/plugins/hooks/PremiumizeMe.py index c11bd3ced..c1a7866c4 100644 --- a/module/plugins/hooks/PremiumizeMe.py +++ b/module/plugins/hooks/PremiumizeMe.py @@ -17,6 +17,7 @@ class PremiumizeMe(MultiHoster): ("interval", "int", "Reload interval in hours (0 to disable)", 24)] __description__ = """Premiumize.me hook plugin""" + __license__ = "GPLv3" __authors__ = [("Florian Franzen", "FlorianFranzen@gmail.com")] diff --git a/module/plugins/hooks/RPNetBiz.py b/module/plugins/hooks/RPNetBiz.py index 6d60b1b98..f0231d0e7 100644 --- a/module/plugins/hooks/RPNetBiz.py +++ b/module/plugins/hooks/RPNetBiz.py @@ -17,6 +17,7 @@ class RPNetBiz(MultiHoster): ("interval", "int", "Reload interval in hours (0 to disable)", 24)] __description__ = """RPNet.biz hook plugin""" + __license__ = "GPLv3" __authors__ = [("Dman", "dmanugm@gmail.com")] diff --git a/module/plugins/hooks/RealdebridCom.py b/module/plugins/hooks/RealdebridCom.py index 9833de7d0..f206c9319 100644 --- a/module/plugins/hooks/RealdebridCom.py +++ b/module/plugins/hooks/RealdebridCom.py @@ -17,6 +17,7 @@ class RealdebridCom(MultiHoster): ("interval", "int", "Reload interval in hours (0 to disable)", 24)] __description__ = """Real-Debrid.com hook plugin""" + __license__ = "GPLv3" __authors__ = [("Devirex Hazzard", "naibaf_11@yahoo.de")] diff --git a/module/plugins/hooks/RehostTo.py b/module/plugins/hooks/RehostTo.py index 423f465a8..f3e1465ee 100644 --- a/module/plugins/hooks/RehostTo.py +++ b/module/plugins/hooks/RehostTo.py @@ -16,6 +16,7 @@ class RehostTo(MultiHoster): ("interval", "int", "Reload interval in hours (0 to disable)", 24)] __description__ = """Rehost.to hook plugin""" + __license__ = "GPLv3" __authors__ = [("RaNaN", "RaNaN@pyload.org")] diff --git a/module/plugins/hooks/RestartFailed.py b/module/plugins/hooks/RestartFailed.py index 8e01ee0f1..6724ceaa8 100644 --- a/module/plugins/hooks/RestartFailed.py +++ b/module/plugins/hooks/RestartFailed.py @@ -12,6 +12,7 @@ class RestartFailed(Hook): ("interval", "int", "Check interval in minutes", 90)] __description__ = """Periodically restart all failed downloads in queue""" + __license__ = "GPLv3" __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] diff --git a/module/plugins/hooks/SimplyPremiumCom.py b/module/plugins/hooks/SimplyPremiumCom.py index 0bdd40f51..3a2586b94 100644 --- a/module/plugins/hooks/SimplyPremiumCom.py +++ b/module/plugins/hooks/SimplyPremiumCom.py @@ -17,6 +17,7 @@ class SimplyPremiumCom(MultiHoster): ("interval", "int", "Reload interval in hours (0 to disable)", "24")] __description__ = """Simply-Premium.com hook plugin""" + __license__ = "GPLv3" __authors__ = [("EvolutionClip", "evolutionclip@live.de")] diff --git a/module/plugins/hooks/SimplydebridCom.py b/module/plugins/hooks/SimplydebridCom.py index 0d8105356..14be2a032 100644 --- a/module/plugins/hooks/SimplydebridCom.py +++ b/module/plugins/hooks/SimplydebridCom.py @@ -14,6 +14,7 @@ class SimplydebridCom(MultiHoster): ("hosterList", "str", "Hoster list (comma separated)", "")] __description__ = """Simply-Debrid.com hook plugin""" + __license__ = "GPLv3" __authors__ = [("Kagenoshin", "kagenoshin@gmx.ch")] diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index 983eb21fa..f29383b32 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -15,6 +15,7 @@ class UnSkipOnFail(Hook): __config__ = [("activated", "bool", "Activated", True)] __description__ = """When a download fails, restart skipped duplicates""" + __license__ = "GPLv3" __authors__ = [("hagg", None)] diff --git a/module/plugins/hooks/UnrestrictLi.py b/module/plugins/hooks/UnrestrictLi.py index 9dc417bf9..28f0289c7 100644 --- a/module/plugins/hooks/UnrestrictLi.py +++ b/module/plugins/hooks/UnrestrictLi.py @@ -18,6 +18,7 @@ class UnrestrictLi(MultiHoster): ("history", "bool", "Delete History", False)] __description__ = """Unrestrict.li hook plugin""" + __license__ = "GPLv3" __authors__ = [("stickell", "l.stickell@yahoo.it")] diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 65a7f92e2..fe5808789 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -23,6 +23,7 @@ class UpdateManager(Hook): ("nodebugupdate", "bool", "Don't check for updates in debug mode", True)] __description__ = """ Check for updates """ + __license__ = "GPLv3" __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] diff --git a/module/plugins/hooks/WindowsPhoneToastNotify.py b/module/plugins/hooks/WindowsPhoneToastNotify.py index bf18d01c0..eed61adbd 100644 --- a/module/plugins/hooks/WindowsPhoneToastNotify.py +++ b/module/plugins/hooks/WindowsPhoneToastNotify.py @@ -18,6 +18,7 @@ class WindowsPhoneToastNotify(Hook): ("pushTimeout", "int", "Timeout between notifications in seconds", 0)] __description__ = """Send push notifications to Windows Phone""" + __license__ = "GPLv3" __authors__ = [("Andy Voigt", "phone-support@hotmail.de")] diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 4b431f813..46c693cf6 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -16,6 +16,7 @@ class XFileSharingPro(Hook): ("exclude_hosters", "str", "Exclude hosters (comma separated)", "")] __description__ = """XFileSharingPro hook plugin""" + __license__ = "GPLv3" __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] diff --git a/module/plugins/hooks/XMPPInterface.py b/module/plugins/hooks/XMPPInterface.py index d6334d8d0..b32eeb40b 100644 --- a/module/plugins/hooks/XMPPInterface.py +++ b/module/plugins/hooks/XMPPInterface.py @@ -24,6 +24,7 @@ class XMPPInterface(IRCInterface, JabberClient): ("captcha", "bool", "Send captcha requests", True)] __description__ = """Connect to jabber and let owner perform different tasks""" + __license__ = "GPLv3" __authors__ = [("RaNaN", "RaNaN@pyload.org")] diff --git a/module/plugins/hooks/ZeveraCom.py b/module/plugins/hooks/ZeveraCom.py index 2c4d9d049..c474756a7 100644 --- a/module/plugins/hooks/ZeveraCom.py +++ b/module/plugins/hooks/ZeveraCom.py @@ -14,6 +14,7 @@ class ZeveraCom(MultiHoster): ("hosterList", "str", "Hoster list (comma separated)", "")] __description__ = """Real-Debrid.com hook plugin""" + __license__ = "GPLv3" __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] -- cgit v1.2.3 From 332c248d0860c8c09d804055b6491dfbb654c8d3 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 8 Oct 2014 20:25:22 +0200 Subject: Newline cosmetics --- module/plugins/hooks/MyfastfileCom.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/MyfastfileCom.py b/module/plugins/hooks/MyfastfileCom.py index 80751c6b4..5c22f7910 100644 --- a/module/plugins/hooks/MyfastfileCom.py +++ b/module/plugins/hooks/MyfastfileCom.py @@ -9,11 +9,13 @@ class MyfastfileCom(MultiHoster): __name__ = "MyfastfileCom" __type__ = "hook" __version__ = "0.02" + __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("hosterList", "str", "Hoster list (comma separated)", ""), ("unloadFailing", "bool", "Revert to standard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 24)] + __description__ = """Myfastfile.com hook plugin""" __license__ = "GPLv3" __authors__ = [("stickell", "l.stickell@yahoo.it")] -- cgit v1.2.3 From f76e5c2336718dca9da8033ba22cd83c72c7b3b3 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 11 Oct 2014 15:14:28 +0200 Subject: Pattern update 1 --- module/plugins/hooks/DeathByCaptcha.py | 2 +- module/plugins/hooks/ImageTyperz.py | 2 +- module/plugins/hooks/MergeFiles.py | 2 +- module/plugins/hooks/UpdateManager.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/DeathByCaptcha.py b/module/plugins/hooks/DeathByCaptcha.py index d58da9a88..2548506cb 100644 --- a/module/plugins/hooks/DeathByCaptcha.py +++ b/module/plugins/hooks/DeathByCaptcha.py @@ -124,7 +124,7 @@ class DeathByCaptcha(Hook): def submit(self, captcha, captchaType="file", match=None): #workaround multipart-post bug in HTTPRequest.py - if re.match("^[A-Za-z0-9]*$", self.getConfig("passkey")): + if re.match("^\w*$", self.getConfig("passkey")): multipart = True data = (FORM_FILE, captcha) else: diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py index aaa3c7bbd..b7ee6b105 100644 --- a/module/plugins/hooks/ImageTyperz.py +++ b/module/plugins/hooks/ImageTyperz.py @@ -73,7 +73,7 @@ class ImageTyperz(Hook): try: #workaround multipart-post bug in HTTPRequest.py - if re.match("^[A-Za-z0-9]*$", self.getConfig("passkey")): + if re.match("^\w*$", self.getConfig("passkey")): multipart = True data = (FORM_FILE, captcha) else: diff --git a/module/plugins/hooks/MergeFiles.py b/module/plugins/hooks/MergeFiles.py index 627a9ec3c..5a23ff862 100644 --- a/module/plugins/hooks/MergeFiles.py +++ b/module/plugins/hooks/MergeFiles.py @@ -32,7 +32,7 @@ class MergeFiles(Hook): files = {} fid_dict = {} for fid, data in pack.getChildren().iteritems(): - if re.search("\.[0-9]{3}$", data['name']): + if re.search("\.\d{3}$", data['name']): if data['name'][:-4] not in files: files[data['name'][:-4]] = [] files[data['name'][:-4]].append(data['name']) diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index fe5808789..b0fe36c9f 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -150,7 +150,7 @@ class UpdateManager(Hook): updated = [] - vre = re.compile(r'__version__.*=.*("|\')([0-9.]+)') + vre = re.compile(r'__version__.*=.*("|\')([\d.]+)') url = updates[0] schema = updates[1].split('|') if "BLACKLIST" in updates: -- cgit v1.2.3 From 8939f015a688a07ec7d0bd14b6a3704f6a2cb4a0 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 11 Oct 2014 15:12:40 +0200 Subject: Pattern update 3 --- module/plugins/hooks/LinkdecrypterCom.py | 2 +- module/plugins/hooks/XFileSharingPro.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/LinkdecrypterCom.py b/module/plugins/hooks/LinkdecrypterCom.py index df1fbee9a..de08e406a 100644 --- a/module/plugins/hooks/LinkdecrypterCom.py +++ b/module/plugins/hooks/LinkdecrypterCom.py @@ -46,7 +46,7 @@ class LinkdecrypterCom(Hook): self.logError(_("Crypter list is empty")) return - regexp = r"https?://([^.]+\.)*?(%s)/.*" % "|".join(online) + regexp = r'https?://([^.]+\.)*?(%s)/.*' % '|'.join(online) dict = self.core.pluginManager.crypterPlugins[self.__name__] dict['pattern'] = regexp diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 46c693cf6..741912457 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -61,7 +61,7 @@ class XFileSharingPro(Hook): self.unload() return - regexp = r"http://(?:[^/]*\.)?(%s)/(?:embed-)?\w{12}" % ("|".join(sorted(hoster_list)).replace('.', '\.')) + regexp = r'http://(?:[^/]*\.)?(%s)/(?:embed-)?\w{12}' % ('|'.join(sorted(hoster_list)).replace('.', '\.')) dict = self.core.pluginManager.hosterPlugins['XFileSharingPro'] dict['pattern'] = regexp -- cgit v1.2.3 From 6cef0be257a01183aa6855d928f2ef7063174d89 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 11 Oct 2014 23:00:31 +0200 Subject: [XFileSharingPro] Hoster list cleanup + linestorage.com --- module/plugins/hooks/XFileSharingPro.py | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 741912457..44f2f544a 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.12" + __version__ = "0.13" __config__ = [("activated", "bool", "Activated", True), ("load_default", "bool", "Include default (built-in) hoster list", True), @@ -31,27 +31,14 @@ class XFileSharingPro(Hook): if self.getConfig('load_default'): hoster_list |= set(( #WORKING HOSTERS: - "aieshare.com", "asixfiles.com", "banashare.com", "cyberlocker.ch", "eyesfile.co", "eyesfile.com", - "fileband.com", "filedwon.com", "filedownloads.org", "hipfile.com", "kingsupload.com", "mlfat4arab.com", - "netuploaded.com", "odsiebie.pl", "q4share.com", "ravishare.com", "uptobox.com", "verzend.be", - "xvidstage.com", "thefile.me", "sharesix.com", "hostingbulk.com", + "eyesfile.co", "eyesfile.com", "fileband.com", "filedwon.com", "hostingbulk.com", "linestorage.com", + "ravishare.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", #NOT TESTED: - "bebasupload.com", "boosterking.com", "divxme.com", "filevelocity.com", "glumbouploads.com", - "grupload.com", "heftyfile.com", "host4desi.com", "laoupload.com", "linkzhost.com", "movreel.com", - "rockdizfile.com", "limfile.com", "share76.com", "sharebeast.com", "sharehut.com", "sharerun.com", - "shareswift.com", "sharingonline.com", "6ybh-upload.com", "skipfile.com", "spaadyshare.com", - "space4file.com", "uploadbaz.com", "uploadc.com", "uploaddot.com", "uploadfloor.com", "uploadic.com", - "uploadville.com", "vidbull.com", "zalaa.com", "zomgupload.com", "kupload.org", "movbay.org", - "multishare.org", "omegave.org", "toucansharing.org", "uflinq.org", "banicrazy.info", "flowhot.info", - "upbrasil.info", "shareyourfilez.biz", "bzlink.us", "cloudcache.cc", "fileserver.cc", "farshare.to", - "filemaze.ws", "filehost.ws", "filestock.ru", "moidisk.ru", "4up.im", "100shared.com", "sharesix.com", - "thefile.me", "filenuke.com", "sharerepo.com", "mightyupload.com", - #WRONG FILE NAME: - "sendmyway.com", "upchi.co.il", + "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: - "amonshare.com", "imageporter.com", "file4safe.com", - #DOWN OR BROKEN: - "ddlanime.com", "fileforth.com", "loombo.com", "goldfile.eu", "putshare.com" + "amonshare.com", "banicrazy.info", "boosterking.com", "host4desi.com", "laoupload.com", "rd-fs.com" )) hoster_list -= (exclude_list) -- cgit v1.2.3 From 818ae3ce2c5ee6f47da2f508c786c3e2ab20ad45 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 12 Oct 2014 23:30:34 +0200 Subject: [XFileSharingPro] Match option --- module/plugins/hooks/XFileSharingPro.py | 79 +++++++++++++++++++++------------ 1 file changed, 51 insertions(+), 28 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 44f2f544a..7b1b12549 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,52 +8,74 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.13" + __version__ = "0.14" __config__ = [("activated", "bool", "Activated", True), - ("load_default", "bool", "Include default (built-in) hoster list", True), + ("match", "Always;Always except excluded;Listed only", "Match", "Always except excluded"), + ("load_default", "bool", "Include built-in hoster list", True), ("include_hosters", "str", "Include hosters (comma separated)", ""), ("exclude_hosters", "str", "Exclude hosters (comma separated)", "")] __description__ = """XFileSharingPro hook plugin""" __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] + __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), + ("Walter Purcaro", "vuolter@gmail.com")] + + + event_list = ["pluginConfigChanged"] + + + def pluginConfigChanged(self, plugin, name, value): + if name != "activated": + self.loadPattern() def coreReady(self): - self.loadPattern() + self.pluginConfigChanged(self.__name__, "coreReady", None) def loadPattern(self): hoster_list = self.getConfigSet('include_hosters') exclude_list = self.getConfigSet('exclude_hosters') - if self.getConfig('load_default'): - hoster_list |= set(( - #WORKING HOSTERS: - "eyesfile.co", "eyesfile.com", "fileband.com", "filedwon.com", "hostingbulk.com", "linestorage.com", - "ravishare.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", - #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: - "amonshare.com", "banicrazy.info", "boosterking.com", "host4desi.com", "laoupload.com", "rd-fs.com" - )) - - hoster_list -= (exclude_list) - hoster_list -= set(('', u'')) - - if not hoster_list: - self.unload() - return - - regexp = r'http://(?:[^/]*\.)?(%s)/(?:embed-)?\w{12}' % ('|'.join(sorted(hoster_list)).replace('.', '\.')) + if self.getConfig("match") != "Listed only": + if self.getConfig("match") == "Always": + match_list = "" + else: + match_list = '|'.join(sorted(exclude_list)) + self.logDebug("Excluding %d hosters" % len(exclude_list), match_list.replace('|', ', ')) + + regexp = r'https?://(?!(?:www\.)?(?:%s))(?:www\.)?([\w^_]+(?:\.[a-zA-Z])+(?:\:\d+)?)/(?:embed-)?\w{12}' % match_list.replace('.', '\.') + + else: + if self.getConfig('load_default'): + hoster_list |= set(( + #WORKING HOSTERS: + "eyesfile.co", "eyesfile.com", "fileband.com", "filedwon.com", "hostingbulk.com", "linestorage.com", + "ravishare.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", + #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: + "amonshare.com", "banicrazy.info", "boosterking.com", "host4desi.com", "laoupload.com", "rd-fs.com" + )) + + hoster_list -= (exclude_list) + hoster_list -= set(('', u'')) + + if not hoster_list: + self.unload() + return + + match_list = '|'.join(sorted(hoster_list)) + regexp = r'https?://(?:[^/]*\.)?(%s)/(?:embed-)?\w{12}' % match_list.replace('.', '\.') + self.logDebug("Handling %d hosters" % len(hoster_list), match_list.replace('|', ', ')) dict = self.core.pluginManager.hosterPlugins['XFileSharingPro'] dict['pattern'] = regexp dict['re'] = re.compile(regexp) - self.logDebug("Pattern loaded - handling %d hosters" % len(hoster_list)) + self.logDebug("Pattern loaded") def getConfigSet(self, option): @@ -62,6 +84,7 @@ class XFileSharingPro(Hook): def unload(self): + regexp = r'^unmatchable$' dict = self.core.pluginManager.hosterPlugins['XFileSharingPro'] - dict['pattern'] = r'^unmatchable$' - dict['re'] = re.compile(r'^unmatchable$') + dict['pattern'] = regexp + dict['re'] = re.compile(regexp) -- cgit v1.2.3 From f98477c1d4a1d4c78e4371c19ff49c3e96fee8c6 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 12 Oct 2014 23:31:42 +0200 Subject: [DeleteFinished] Fix pluginConfigChanged --- module/plugins/hooks/DeleteFinished.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/DeleteFinished.py b/module/plugins/hooks/DeleteFinished.py index 2ca5bfb4a..fe808e3af 100644 --- a/module/plugins/hooks/DeleteFinished.py +++ b/module/plugins/hooks/DeleteFinished.py @@ -7,7 +7,7 @@ from module.plugins.Hook import Hook class DeleteFinished(Hook): __name__ = "DeleteFinished" __type__ = "hook" - __version__ = "1.09" + __version__ = "1.10" __config__ = [('activated', 'bool', 'Activated', 'False'), ('interval', 'int', 'Delete every (hours)', '72'), @@ -18,6 +18,9 @@ class DeleteFinished(Hook): __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + event_list = ["pluginConfigChanged"] + + ## overwritten methods ## def periodical(self): if not self.info['sleep']: @@ -29,30 +32,36 @@ class DeleteFinished(Hook): self.info['sleep'] = True self.addEvent('packageFinished', self.wakeup) + def pluginConfigChanged(self, plugin, name, value): - if name == 'interval' and value != self.interval: + if name == "interval" and value != self.interval: self.interval = value * 3600 self.initPeriodical() + def unload(self): self.removeEvent('packageFinished', self.wakeup) + def coreReady(self): self.info = {'sleep': True} interval = self.getConfig('interval') self.pluginConfigChanged('DeleteFinished', 'interval', interval) self.addEvent('packageFinished', self.wakeup) + ## own methods ## @style.queue def deleteFinished(self, mode): self.c.execute('DELETE FROM packages WHERE NOT EXISTS(SELECT 1 FROM links WHERE package=packages.id AND status NOT IN (%s))' % mode) self.c.execute('DELETE FROM links WHERE NOT EXISTS(SELECT 1 FROM packages WHERE id=links.package)') + def wakeup(self, pypack): self.removeEvent('packageFinished', self.wakeup) self.info['sleep'] = False + ## event managing ## def addEvent(self, event, func): """Adds an event listener for event name""" @@ -64,6 +73,7 @@ class DeleteFinished(Hook): else: self.m.events[event] = [func] + def setup(self): self.m = self.manager self.removeEvent = self.m.removeEvent -- cgit v1.2.3 From 7a491109ba2f784ae7a41b89090dae14e2fbe4b5 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 12 Oct 2014 23:33:27 +0200 Subject: [XFileSharingPro] Code cosmetics --- module/plugins/hooks/XFileSharingPro.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 7b1b12549..13d11155c 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -31,7 +31,7 @@ class XFileSharingPro(Hook): def coreReady(self): - self.pluginConfigChanged(self.__name__, "coreReady", None) + self.loadPattern() def loadPattern(self): -- cgit v1.2.3 From 7598810800c20b928265c63b207daa7c7caa04c6 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 12 Oct 2014 23:40:26 +0200 Subject: [XFileSharingPro] Code cosmetics 2 --- module/plugins/hooks/XFileSharingPro.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 13d11155c..1d7864390 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -24,6 +24,16 @@ class XFileSharingPro(Hook): event_list = ["pluginConfigChanged"] + HOSTER_LIST = [#WORKING HOSTERS: + "eyesfile.co", "eyesfile.com", "fileband.com", "filedwon.com", "hostingbulk.com", "linestorage.com", + "ravishare.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", + #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: + "amonshare.com", "banicrazy.info", "boosterking.com", "host4desi.com", "laoupload.com", "rd-fs.com"] + def pluginConfigChanged(self, plugin, name, value): if name != "activated": @@ -49,17 +59,7 @@ class XFileSharingPro(Hook): else: if self.getConfig('load_default'): - hoster_list |= set(( - #WORKING HOSTERS: - "eyesfile.co", "eyesfile.com", "fileband.com", "filedwon.com", "hostingbulk.com", "linestorage.com", - "ravishare.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", - #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: - "amonshare.com", "banicrazy.info", "boosterking.com", "host4desi.com", "laoupload.com", "rd-fs.com" - )) + hoster_list |= set(self.HOSTER_LIST) hoster_list -= (exclude_list) hoster_list -= set(('', u'')) -- cgit v1.2.3 From 70017d6c628d5a53bc61c4a3ed648dcb22354977 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 13 Oct 2014 00:20:16 +0200 Subject: [XFileSharingPro] Fix regexp --- module/plugins/hooks/XFileSharingPro.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 1d7864390..232c893cc 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.14" + __version__ = "0.15" __config__ = [("activated", "bool", "Activated", True), ("match", "Always;Always except excluded;Listed only", "Match", "Always except excluded"), @@ -45,23 +45,26 @@ class XFileSharingPro(Hook): def loadPattern(self): - hoster_list = self.getConfigSet('include_hosters') - exclude_list = self.getConfigSet('exclude_hosters') + include_hosters = self.getConfigSet('include_hosters') + exclude_hosters = self.getConfigSet('exclude_hosters') if self.getConfig("match") != "Listed only": if self.getConfig("match") == "Always": match_list = "" else: - match_list = '|'.join(sorted(exclude_list)) - self.logDebug("Excluding %d hosters" % len(exclude_list), match_list.replace('|', ', ')) + hoster_list = exclude_hosters - set(('', u'')) + match_list = '|'.join(sorted(hoster_list)) + self.logDebug("Excluding %d hosters" % len(hoster_list), match_list.replace('|', ', ')) - regexp = r'https?://(?!(?:www\.)?(?:%s))(?:www\.)?([\w^_]+(?:\.[a-zA-Z])+(?:\:\d+)?)/(?:embed-)?\w{12}' % match_list.replace('.', '\.') + regexp = r'https?://(?!(?:www\.)?(?:%s))(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:embed-)?\w{12}' % match_list.replace('.', '\.') else: + hoster_list = include_hosters + if self.getConfig('load_default'): hoster_list |= set(self.HOSTER_LIST) - hoster_list -= (exclude_list) + hoster_list -= exclude_hosters hoster_list -= set(('', u'')) if not hoster_list: @@ -69,9 +72,10 @@ class XFileSharingPro(Hook): return match_list = '|'.join(sorted(hoster_list)) - regexp = r'https?://(?:[^/]*\.)?(%s)/(?:embed-)?\w{12}' % match_list.replace('.', '\.') self.logDebug("Handling %d hosters" % len(hoster_list), match_list.replace('|', ', ')) + regexp = r'https?://(?:[^/]*\.)?(%s)/(?:embed-)?\w{12}' % match_list.replace('.', '\.') + dict = self.core.pluginManager.hosterPlugins['XFileSharingPro'] dict['pattern'] = regexp dict['re'] = re.compile(regexp) -- cgit v1.2.3 From 77ef3e137d2d9222d0f8965adf374e6712123a99 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 14 Oct 2014 13:07:19 +0200 Subject: [XFSPHoster] TEXT_ENCODING support --- module/plugins/hooks/XFileSharingPro.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 232c893cc..f5d40dd62 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -11,12 +11,12 @@ class XFileSharingPro(Hook): __version__ = "0.15" __config__ = [("activated", "bool", "Activated", True), - ("match", "Always;Always except excluded;Listed only", "Match", "Always except excluded"), + ("match", "Always;Always except excluded;Listed only", "Hoster match", "Always except excluded"), ("load_default", "bool", "Include built-in hoster list", True), ("include_hosters", "str", "Include hosters (comma separated)", ""), ("exclude_hosters", "str", "Exclude hosters (comma separated)", "")] - __description__ = """XFileSharingPro hook plugin""" + __description__ = """Load XFileSharingPro based hosters which don't need a own plugin to work fine""" __license__ = "GPLv3" __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), ("Walter Purcaro", "vuolter@gmail.com")] -- cgit v1.2.3 From 450109d53cedf5f6cda68fb617d79fa0c6ebb97a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 14 Oct 2014 13:11:26 +0200 Subject: [ClickAndLoad] Code cosmetics --- module/plugins/hooks/ClickAndLoad.py | 56 ++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 28 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py index 304cb9233..253f05ac5 100644 --- a/module/plugins/hooks/ClickAndLoad.py +++ b/module/plugins/hooks/ClickAndLoad.py @@ -6,34 +6,6 @@ import thread from module.plugins.Hook import Hook -class ClickAndLoad(Hook): - __name__ = "ClickAndLoad" - __type__ = "hook" - __version__ = "0.22" - - __config__ = [("activated", "bool", "Activated", True), - ("extern", "bool", "Allow external link adding", False)] - - __description__ = """Gives abillity to use jd's click and load. depends on webinterface""" - __license__ = "GPLv3" - __authors__ = [("RaNaN", "RaNaN@pyload.de"), - ("mkaay", "mkaay@mkaay.de")] - - - def coreReady(self): - self.port = int(self.config['webinterface']['port']) - if self.config['webinterface']['activated']: - try: - if self.getConfig("extern"): - ip = "0.0.0.0" - else: - ip = "127.0.0.1" - - thread.start_new_thread(proxy, (self, ip, self.port, 9666)) - except: - self.logError(_("ClickAndLoad port already in use")) - - def proxy(self, *settings): thread.start_new_thread(server, (self,) + settings) lock = thread.allocate_lock() @@ -75,3 +47,31 @@ def forward(source, destination): else: #source.shutdown(socket.SHUT_RD) destination.shutdown(socket.SHUT_WR) + + +class ClickAndLoad(Hook): + __name__ = "ClickAndLoad" + __type__ = "hook" + __version__ = "0.22" + + __config__ = [("activated", "bool", "Activated", True), + ("extern", "bool", "Allow external link adding", False)] + + __description__ = """Click'N'Load hook plugin""" + __license__ = "GPLv3" + __authors__ = [("RaNaN", "RaNaN@pyload.de"), + ("mkaay", "mkaay@mkaay.de")] + + + def coreReady(self): + self.port = int(self.config['webinterface']['port']) + if self.config['webinterface']['activated']: + try: + if self.getConfig("extern"): + ip = "0.0.0.0" + else: + ip = "127.0.0.1" + + thread.start_new_thread(proxy, (self, ip, self.port, 9666)) + except: + self.logError(_("ClickAndLoad port already in use")) -- cgit v1.2.3 From fe490d4542b78cb52b0db3c037ac71bc07aedfce Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 17 Oct 2014 20:54:17 +0200 Subject: [XFileSharingPro] Updated to support XFileSharingProFolder --- module/plugins/hooks/XFileSharingPro.py | 82 +++++++++++++++++++-------------- 1 file changed, 47 insertions(+), 35 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index f5d40dd62..62a5791b7 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,15 +8,18 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.15" + __version__ = "0.16" __config__ = [("activated", "bool", "Activated", True), - ("match", "Always;Always except excluded;Listed only", "Hoster match", "Always except excluded"), - ("load_default", "bool", "Include built-in hoster list", True), + ("match_hoster", "Always;Always except excluded;Listed only", "Hoster match", "Always except excluded"), + ("match_crypter", "Always;Always except excluded;Listed only", "Crypter match", "Always except excluded"), + ("load_default", "bool", "Include built-in lists", True), ("include_hosters", "str", "Include hosters (comma separated)", ""), - ("exclude_hosters", "str", "Exclude hosters (comma separated)", "")] + ("exclude_hosters", "str", "Exclude hosters (comma separated)", ""), + ("include_crypters", "str", "Include crypters (comma separated)", ""), + ("exclude_crypters", "str", "Exclude crypters (comma separated)", "")] - __description__ = """Load XFileSharingPro based hosters which don't need a own plugin to work fine""" + __description__ = """Load hosters and crypter, based upon XFileSharingPro, which don't need a own plugin to work fine""" __license__ = "GPLv3" __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), ("Walter Purcaro", "vuolter@gmail.com")] @@ -33,6 +36,7 @@ class XFileSharingPro(Hook): "vidbull.com", "zalaa.com", "zomgupload.com", #NOT WORKING: "amonshare.com", "banicrazy.info", "boosterking.com", "host4desi.com", "laoupload.com", "rd-fs.com"] + CRYPTER_LIST = [] def pluginConfigChanged(self, plugin, name, value): @@ -45,41 +49,48 @@ class XFileSharingPro(Hook): def loadPattern(self): - include_hosters = self.getConfigSet('include_hosters') - exclude_hosters = self.getConfigSet('exclude_hosters') + regex = {'hoster' = (r'https?://(?!(?:www\.)?(?:%s))(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:embed-)?\w{12}', + r'https?://(?:[^/]+\.)?(%s)/(?:embed-)?\w{12}'), + 'crypter' = (r'https?://(?!(?:www\.)?(?:%s))(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:user|folder)s?/\w+', + r'https?://(?:[^/]+\.)?(%s)/(?:user|folder)s?/\w+')} + + for type, plugin in (("hoster", "XFileSharingPro"), ("crypter", "XFileSharingProFolder")): + match = self.getConfig('match_%ss' % type) + include_set = self.getConfigSet('include_%ss' % type) + exclude_set = self.getConfigSet('exclude_%ss' % type) + + if match != "Listed only": + if match == "Always": + match_list = "" + else: + hoster_list = exclude_set - set(('', u'')) + match_list = '|'.join(sorted(hoster_list)) + self.logDebug("Excluding %d %ss" % (len(hoster_list), type), match_list.replace('|', ', ')) + + regexp = regex[type][0] % match_list.replace('.', '\.') - if self.getConfig("match") != "Listed only": - if self.getConfig("match") == "Always": - match_list = "" else: - hoster_list = exclude_hosters - set(('', u'')) - match_list = '|'.join(sorted(hoster_list)) - self.logDebug("Excluding %d hosters" % len(hoster_list), match_list.replace('|', ', ')) - - regexp = r'https?://(?!(?:www\.)?(?:%s))(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:embed-)?\w{12}' % match_list.replace('.', '\.') + hoster_list = include_set - else: - hoster_list = include_hosters + if self.getConfig('load_default'): + hoster_list |= set(getattr(self, "%s_LIST" % type.upper())) - if self.getConfig('load_default'): - hoster_list |= set(self.HOSTER_LIST) + hoster_list -= exclude_set + hoster_list -= set(('', u'')) - hoster_list -= exclude_hosters - hoster_list -= set(('', u'')) + if not hoster_list: + self.unload() + return - if not hoster_list: - self.unload() - return - - match_list = '|'.join(sorted(hoster_list)) - self.logDebug("Handling %d hosters" % len(hoster_list), match_list.replace('|', ', ')) + match_list = '|'.join(sorted(hoster_list)) + self.logDebug("Handling %d %ss" % (len(hoster_list), type), match_list.replace('|', ', ')) - regexp = r'https?://(?:[^/]*\.)?(%s)/(?:embed-)?\w{12}' % match_list.replace('.', '\.') + regexp = regex[type][1] % match_list.replace('.', '\.') - dict = self.core.pluginManager.hosterPlugins['XFileSharingPro'] - dict['pattern'] = regexp - dict['re'] = re.compile(regexp) - self.logDebug("Pattern loaded") + dict = self.core.pluginManager.plugins[type][plugin] + dict['pattern'] = regexp + dict['re'] = re.compile(regexp) + self.logDebug("Pattern loaded for %ss" % type) def getConfigSet(self, option): @@ -89,6 +100,7 @@ class XFileSharingPro(Hook): def unload(self): regexp = r'^unmatchable$' - dict = self.core.pluginManager.hosterPlugins['XFileSharingPro'] - dict['pattern'] = regexp - dict['re'] = re.compile(regexp) + for type, plugin in (("hoster", "XFileSharingPro"), ("crypter", "XFileSharingProFolder")): + dict = self.core.pluginManager.plugins[type][plugin] + dict['pattern'] = regexp + dict['re'] = re.compile(regexp) -- cgit v1.2.3 From 6a6373e9b63ce7943f1a6592a641e3d8b3f31e09 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 17 Oct 2014 21:10:40 +0200 Subject: Fix TRAFFIC_LEFT_PATTERN in RapidfileshareNet and TusfilesNet accounts --- module/plugins/hooks/XFileSharingPro.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 62a5791b7..44d376905 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -28,7 +28,7 @@ class XFileSharingPro(Hook): event_list = ["pluginConfigChanged"] HOSTER_LIST = [#WORKING HOSTERS: - "eyesfile.co", "eyesfile.com", "fileband.com", "filedwon.com", "hostingbulk.com", "linestorage.com", + "eyesfile.ca", "fileband.com", "filedwon.com", "hostingbulk.com", "linestorage.com", "ravishare.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", #NOT TESTED: "101shared.com", "4upfiles.com", "filemaze.ws", "filenuke.com", "linkzhost.com", "mightyupload.com", -- cgit v1.2.3 From ca835310c633fd19e3954ea9b6a0388d8529b368 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 18 Oct 2014 17:47:29 +0200 Subject: [XFileSharingPro] Improve hook regex --- module/plugins/hooks/XFileSharingPro.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 44d376905..1782456e1 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.16" + __version__ = "0.17" __config__ = [("activated", "bool", "Activated", True), ("match_hoster", "Always;Always except excluded;Listed only", "Hoster match", "Always except excluded"), @@ -50,7 +50,7 @@ class XFileSharingPro(Hook): def loadPattern(self): regex = {'hoster' = (r'https?://(?!(?:www\.)?(?:%s))(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:embed-)?\w{12}', - r'https?://(?:[^/]+\.)?(%s)/(?:embed-)?\w{12}'), + r'https?://(?:[^/]+\.)?(%s)/(?:embed-)?\w{12}\W?'), 'crypter' = (r'https?://(?!(?:www\.)?(?:%s))(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:user|folder)s?/\w+', r'https?://(?:[^/]+\.)?(%s)/(?:user|folder)s?/\w+')} -- cgit v1.2.3 From 39b304c6495e6a77562e9ce2c9cdf921851c668a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Oct 2014 16:28:10 +0200 Subject: Fixes --- module/plugins/hooks/XFileSharingPro.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 1782456e1..54d97de53 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.17" + __version__ = "0.18" __config__ = [("activated", "bool", "Activated", True), ("match_hoster", "Always;Always except excluded;Listed only", "Hoster match", "Always except excluded"), @@ -49,13 +49,13 @@ class XFileSharingPro(Hook): def loadPattern(self): - regex = {'hoster' = (r'https?://(?!(?:www\.)?(?:%s))(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:embed-)?\w{12}', - r'https?://(?:[^/]+\.)?(%s)/(?:embed-)?\w{12}\W?'), - 'crypter' = (r'https?://(?!(?:www\.)?(?:%s))(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:user|folder)s?/\w+', - r'https?://(?:[^/]+\.)?(%s)/(?:user|folder)s?/\w+')} + regex = {'hoster' : (r'https?://(?!(?:www\.)?(?:%s))(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:embed-)?\w{12}', + r'https?://(?:[^/]+\.)?(%s)/(?:embed-)?\w{12}\W?'), + 'crypter': (r'https?://(?!(?:www\.)?(?:%s))(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:user|folder)s?/\w+', + r'https?://(?:[^/]+\.)?(%s)/(?:user|folder)s?/\w+')} for type, plugin in (("hoster", "XFileSharingPro"), ("crypter", "XFileSharingProFolder")): - match = self.getConfig('match_%ss' % type) + match = self.getConfig('match_%s' % type) include_set = self.getConfigSet('include_%ss' % type) exclude_set = self.getConfigSet('exclude_%ss' % type) -- cgit v1.2.3 From ffc6db40f7b45ead4941e9943e7ec85bcd1c942d Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 20 Oct 2014 13:06:23 +0200 Subject: [UpdateManager] MIN_INTERVAL is 6h now --- module/plugins/hooks/UpdateManager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index b0fe36c9f..cc086af5c 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -14,7 +14,7 @@ from module.utils import save_join class UpdateManager(Hook): __name__ = "UpdateManager" __type__ = "hook" - __version__ = "0.35" + __version__ = "0.36" __config__ = [("activated", "bool", "Activated", True), ("mode", "pyLoad + plugins;plugins only", "Check updates for", "pyLoad + plugins"), @@ -30,7 +30,7 @@ class UpdateManager(Hook): event_list = ["pluginConfigChanged"] SERVER_URL = "http://updatemanager.pyload.org" - MIN_INTERVAL = 3 * 60 * 60 #: 3h minimum check interval (value is in seconds) + MIN_INTERVAL = 6 * 60 * 60 #: 6h minimum check interval (value is in seconds) def pluginConfigChanged(self, plugin, name, value): -- cgit v1.2.3 From e24a10387d38c706839a4d86e1b23780c52e9a5b Mon Sep 17 00:00:00 2001 From: eerozeteen Date: Wed, 22 Oct 2014 08:22:31 +0200 Subject: Update Captcha9kw.py syntax error, added missing parentheses --- module/plugins/hooks/Captcha9kw.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index 7c1fa40fd..4eb7e0ffc 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -130,7 +130,7 @@ class Captcha9kw(Hook): "pyload": "1", "source": "pyload", "id": task.data['ticket']}) - self.logInfo(_("Request correct", response) + self.logInfo(_("Request correct"), response) except BadHeader, e: self.logError(_("Could not send correct request."), e) @@ -149,7 +149,7 @@ class Captcha9kw(Hook): "pyload": "1", "source": "pyload", "id": task.data['ticket']}) - self.logInfo(_("Request refund", response) + self.logInfo(_("Request refund"), response) except BadHeader, e: self.logError(_("Could not send refund request."), e) -- cgit v1.2.3 From f00dbe52cee93a0aad9b6747419ff7271adb6e84 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 22 Oct 2014 10:12:21 +0200 Subject: Code cosmetics --- module/plugins/hooks/Captcha9kw.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index 4eb7e0ffc..6485db22b 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -15,7 +15,7 @@ from module.plugins.Hook import Hook class Captcha9kw(Hook): __name__ = "Captcha9kw" __type__ = "hook" - __version__ = "0.09" + __version__ = "0.10" __config__ = [("activated", "bool", "Activated", False), ("force", "bool", "Force CT even if client is connected", True), -- cgit v1.2.3 From 0eb6e7ec4a1144dcca824d8add049787d3da1762 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 22 Oct 2014 19:44:59 +0200 Subject: Two space before function declaration --- module/plugins/hooks/BypassCaptcha.py | 10 ++++++++++ module/plugins/hooks/Captcha9kw.py | 5 +++++ module/plugins/hooks/CaptchaBrotherhood.py | 9 +++++++++ module/plugins/hooks/Checksum.py | 4 ++++ module/plugins/hooks/DeathByCaptcha.py | 12 ++++++++++++ module/plugins/hooks/DownloadScheduler.py | 3 +++ module/plugins/hooks/ExpertDecoders.py | 4 ++++ module/plugins/hooks/ExtractArchive.py | 2 ++ module/plugins/hooks/HotFolder.py | 1 + module/plugins/hooks/IRCInterface.py | 24 ++++++++++++++++++++++++ module/plugins/hooks/ImageTyperz.py | 8 ++++++++ module/plugins/hooks/LinkdecrypterCom.py | 1 + module/plugins/hooks/MergeFiles.py | 1 + module/plugins/hooks/MultiHome.py | 8 ++++++++ module/plugins/hooks/PremiumTo.py | 1 + module/plugins/hooks/PremiumizeMe.py | 1 + module/plugins/hooks/RPNetBiz.py | 1 + module/plugins/hooks/RehostTo.py | 1 + module/plugins/hooks/RestartFailed.py | 3 +++ module/plugins/hooks/UnSkipOnFail.py | 2 ++ module/plugins/hooks/UpdateManager.py | 12 ++++++++++++ module/plugins/hooks/WindowsPhoneToastNotify.py | 3 +++ module/plugins/hooks/XMPPInterface.py | 20 ++++++++++++++++++++ 23 files changed, 136 insertions(+) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index 984aac919..a07b2fc66 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -13,12 +13,15 @@ class BypassCaptchaException(Exception): def __init__(self, err): self.err = err + def getCode(self): return self.err + def __str__(self): return "" % self.err + def __repr__(self): return "" % self.err @@ -49,12 +52,14 @@ class BypassCaptcha(Hook): def setup(self): self.info = {} + def getCredits(self): response = getURL(self.GETCREDITS_URL, post={"key": self.getConfig("passkey")}) data = dict([x.split(' ', 1) for x in response.splitlines()]) return int(data['Left']) + def submit(self, captcha, captchaType="file", match=None): req = getRequest() @@ -81,6 +86,7 @@ class BypassCaptcha(Hook): return ticket, result + def respond(self, ticket, success): try: response = getURL(self.RESPOND_URL, post={"task_id": ticket, "key": self.getConfig("passkey"), @@ -88,6 +94,7 @@ class BypassCaptcha(Hook): except BadHeader, e: self.logError(_("Could not send response."), e + def newCaptchaTask(self, task): if "service" in task.data: return False @@ -110,14 +117,17 @@ class BypassCaptcha(Hook): else: self.logInfo(_("Your %s account has not enough credits") % self.__name__) + def captchaCorrect(self, task): if task.data['service'] == self.__name__ and "ticket" in task.data: self.respond(task.data['ticket'], True) + def captchaInvalid(self, task): if task.data['service'] == self.__name__ and "ticket" in task.data: self.respond(task.data['ticket'], False) + def processCaptcha(self, task): c = task.captchaFile try: diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index 6485db22b..947aff121 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -41,6 +41,7 @@ class Captcha9kw(Hook): self.API_URL = "https" + self.API_URL if self.getConfig("https") else "http" + self.API_URL self.info = {} + def getCredits(self): response = getURL(self.API_URL, get={"apikey": self.getConfig("passkey"), "pyload": "1", "source": "pyload", "action": "usercaptchaguthaben"}) @@ -53,6 +54,7 @@ class Captcha9kw(Hook): self.logError(response) return 0 + def processCaptcha(self, task): result = None @@ -100,6 +102,7 @@ class Captcha9kw(Hook): self.logError(_("Bad upload"), response) return False + def newCaptchaTask(self, task): if not task.isTextual() and not task.isPositional(): return False @@ -118,6 +121,7 @@ class Captcha9kw(Hook): else: self.logError(_("Your Captcha 9kw.eu Account has not enough credits")) + def captchaCorrect(self, task): if "ticket" in task.data: @@ -137,6 +141,7 @@ class Captcha9kw(Hook): else: self.logError(_("No CaptchaID for correct request (task %s) found.") % task) + def captchaInvalid(self, task): if "ticket" in task.data: diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py index 3157fead8..da8fcbafe 100644 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ b/module/plugins/hooks/CaptchaBrotherhood.py @@ -23,12 +23,15 @@ class CaptchaBrotherhoodException(Exception): def __init__(self, err): self.err = err + def getCode(self): return self.err + def __str__(self): return "" % self.err + def __repr__(self): return "" % self.err @@ -55,6 +58,7 @@ class CaptchaBrotherhood(Hook): def setup(self): self.info = {} + def getCredits(self): response = getURL(self.API_URL + "askCredits.aspx", get={"username": self.getConfig("username"), "password": self.getConfig("passkey")}) @@ -66,6 +70,7 @@ class CaptchaBrotherhood(Hook): self.info['credits'] = credits return credits + def submit(self, captcha, captchaType="file", match=None): try: img = Image.open(captcha) @@ -116,6 +121,7 @@ class CaptchaBrotherhood(Hook): raise CaptchaBrotherhoodException("No solution received in time") + def get_api(self, api, ticket): response = getURL("%s%s.aspx" % (self.API_URL, api), get={"username": self.getConfig("username"), @@ -126,6 +132,7 @@ class CaptchaBrotherhood(Hook): return response + def newCaptchaTask(self, task): if "service" in task.data: return False @@ -147,10 +154,12 @@ class CaptchaBrotherhood(Hook): else: self.logInfo(_("Your CaptchaBrotherhood Account has not enough credits")) + def captchaInvalid(self, task): if task.data['service'] == self.__name__ and "ticket" in task.data: response = self.get_api("complainCaptcha", task.data['ticket']) + def processCaptcha(self, task): c = task.captchaFile try: diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index 32597beeb..4a7cfd661 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -67,12 +67,14 @@ class Checksum(Hook): if not self.getConfig("check_checksum"): self.logInfo(_("Checksum validation is disabled in plugin configuration")) + def setup(self): self.algorithms = sorted( getattr(hashlib, "algorithms", ("md5", "sha1", "sha224", "sha256", "sha384", "sha512")), reverse=True) self.algorithms.extend(["crc32", "adler32"]) self.formats = self.algorithms + ["sfv", "crc", "hash"] + def downloadFinished(self, pyfile): """ Compute checksum for the downloaded file and compare it with the hash provided by the hoster. @@ -130,6 +132,7 @@ class Checksum(Hook): else: self.logWarning(_("Unable to validate checksum for file"), pyfile.name) + def checkFailed(self, pyfile, local_file, msg): check_action = self.getConfig("check_action") if check_action == "retry": @@ -145,6 +148,7 @@ class Checksum(Hook): return pyfile.plugin.fail(reason=msg) + def packageFinished(self, pypack): download_folder = save_join(self.config['general']['download_folder'], pypack.folder, "") diff --git a/module/plugins/hooks/DeathByCaptcha.py b/module/plugins/hooks/DeathByCaptcha.py index 2548506cb..99d7f7401 100644 --- a/module/plugins/hooks/DeathByCaptcha.py +++ b/module/plugins/hooks/DeathByCaptcha.py @@ -25,21 +25,26 @@ class DeathByCaptchaException(Exception): 'invalid-request': 'Invalid request', 'timed-out': 'No CAPTCHA solution received in time'} + def __init__(self, err): self.err = err + def getCode(self): return self.err + def getDesc(self): if self.err in self.DBC_ERRORS.keys(): return self.DBC_ERRORS[self.err] else: return self.err + def __str__(self): return "" % self.err + def __repr__(self): return "" % self.err @@ -66,6 +71,7 @@ class DeathByCaptcha(Hook): def setup(self): self.info = {} + def call_api(self, api="captcha", post=False, multipart=False): req = getRequest() req.c.setopt(HTTPHEADER, ["Accept: application/json", "User-Agent: pyLoad %s" % self.core.version]) @@ -106,6 +112,7 @@ class DeathByCaptcha(Hook): return response + def getCredits(self): response = self.call_api("user", True) @@ -116,12 +123,14 @@ class DeathByCaptcha(Hook): else: raise DeathByCaptchaException(response) + def getStatus(self): response = self.call_api("status", False) if 'is_service_overloaded' in response and response['is_service_overloaded']: raise DeathByCaptchaException('service-overload') + def submit(self, captcha, captchaType="file", match=None): #workaround multipart-post bug in HTTPRequest.py if re.match("^\w*$", self.getConfig("passkey")): @@ -152,6 +161,7 @@ class DeathByCaptcha(Hook): return ticket, result + def newCaptchaTask(self, task): if "service" in task.data: return False @@ -183,6 +193,7 @@ class DeathByCaptcha(Hook): task.setWaiting(180) start_new_thread(self.processCaptcha, (task,)) + def captchaInvalid(self, task): if task.data['service'] == self.__name__ and "ticket" in task.data: try: @@ -192,6 +203,7 @@ class DeathByCaptcha(Hook): except Exception, e: self.logError(e) + def processCaptcha(self, task): c = task.captchaFile try: diff --git a/module/plugins/hooks/DownloadScheduler.py b/module/plugins/hooks/DownloadScheduler.py index c7a0155dd..70930ab67 100644 --- a/module/plugins/hooks/DownloadScheduler.py +++ b/module/plugins/hooks/DownloadScheduler.py @@ -26,9 +26,11 @@ class DownloadScheduler(Hook): def setup(self): self.cb = None # callback to scheduler job; will be by removed hookmanager when hook unloaded + def coreReady(self): self.updateSchedule() + def updateSchedule(self, schedule=None): if schedule is None: schedule = self.getConfig("timetable") @@ -56,6 +58,7 @@ class DownloadScheduler(Hook): self.core.scheduler.removeJob(self.cb) self.cb = self.core.scheduler.addJob(next_time, self.updateSchedule, threaded=False) + def setDownloadSpeed(self, speed): if speed == 0: abort = self.getConfig("abort") diff --git a/module/plugins/hooks/ExpertDecoders.py b/module/plugins/hooks/ExpertDecoders.py index 712b19677..e786cc35a 100644 --- a/module/plugins/hooks/ExpertDecoders.py +++ b/module/plugins/hooks/ExpertDecoders.py @@ -33,6 +33,7 @@ class ExpertDecoders(Hook): def setup(self): self.info = {} + def getCredits(self): response = getURL(self.API_URL, post={"key": self.getConfig("passkey"), "action": "balance"}) @@ -44,6 +45,7 @@ class ExpertDecoders(Hook): self.logError(response) return 0 + def processCaptcha(self, task): task.data['ticket'] = ticket = uuid4() result = None @@ -65,6 +67,7 @@ class ExpertDecoders(Hook): self.logDebug("Result %s : %s" % (ticket, result)) task.setResult(result) + def newCaptchaTask(self, task): if not task.isTextual(): return False @@ -83,6 +86,7 @@ class ExpertDecoders(Hook): else: self.logInfo(_("Your ExpertDecoders Account has not enough credits")) + def captchaInvalid(self, task): if "ticket" in task.data: diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index f6958941e..649689f6e 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -14,6 +14,7 @@ if sys.version_info < (2, 7) and os.name != "nt": import errno from subprocess import Popen + def _eintr_retry_call(func, *args): while True: try: @@ -23,6 +24,7 @@ if sys.version_info < (2, 7) and os.name != "nt": continue raise + # unsued timeout option for older python version def wait(self, timeout=0): """Wait for child process to terminate. Returns returncode diff --git a/module/plugins/hooks/HotFolder.py b/module/plugins/hooks/HotFolder.py index 34a9ff49b..688dcbf48 100644 --- a/module/plugins/hooks/HotFolder.py +++ b/module/plugins/hooks/HotFolder.py @@ -28,6 +28,7 @@ class HotFolder(Hook): def setup(self): self.interval = 10 + def periodical(self): if not exists(join(self.getConfig("folder"), "finished")): makedirs(join(self.getConfig("folder"), "finished")) diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index d648db7cf..59977b8af 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -44,6 +44,7 @@ class IRCInterface(Thread, Hook): # self.sm = core.server_methods self.api = core.api # todo, only use api + def coreReady(self): self.abort = False self.more = [] @@ -51,6 +52,7 @@ class IRCInterface(Thread, Hook): self.start() + def packageFinished(self, pypack): try: if self.getConfig("info_pack"): @@ -58,6 +60,7 @@ class IRCInterface(Thread, Hook): except: pass + def downloadFinished(self, pyfile): try: if self.getConfig("info_file"): @@ -66,6 +69,7 @@ class IRCInterface(Thread, Hook): except: pass + def newCaptchaTask(self, task): if self.getConfig("captcha") and task.isTextual(): task.handler.append(self) @@ -78,6 +82,7 @@ class IRCInterface(Thread, Hook): self.response(_("New Captcha Request: %s") % url) self.response(_("Answer with 'c %s text on the captcha'") % task.id) + def run(self): # connect to IRC etc. self.sock = socket.socket() @@ -99,6 +104,7 @@ class IRCInterface(Thread, Hook): print_exc() self.sock.close() + def main_loop(self): readbuffer = "" while True: @@ -137,6 +143,7 @@ class IRCInterface(Thread, Hook): self.handle_events(msg) + def handle_events(self, msg): if not msg['origin'].split("!", 1)[0] in self.getConfig("owner").split(): return @@ -179,6 +186,7 @@ class IRCInterface(Thread, Hook): except Exception, e: self.logError(repr(e)) + def response(self, msg, origin=""): if origin == "": for t in self.getConfig("owner").split(): @@ -186,11 +194,13 @@ class IRCInterface(Thread, Hook): else: self.sock.send("PRIVMSG %s :%s\r\n" % (origin.split("!", 1)[0], msg)) + #### Events def event_pass(self, args): return [] + def event_status(self, args): downloads = self.api.statusDownloads() if not downloads: @@ -216,6 +226,7 @@ class IRCInterface(Thread, Hook): )) return lines + def event_queue(self, args): ps = self.api.getQueueData() @@ -228,6 +239,7 @@ class IRCInterface(Thread, Hook): return lines + def event_collector(self, args): ps = self.api.getCollectorData() if not ps: @@ -239,6 +251,7 @@ class IRCInterface(Thread, Hook): return lines + def event_info(self, args): if not args: return ["ERROR: Use info like this: info "] @@ -252,6 +265,7 @@ class IRCInterface(Thread, Hook): return ['LINK #%s: %s (%s) [%s][%s]' % (info.fid, info.name, info.format_size, info.statusmsg, info.plugin)] + def event_packinfo(self, args): if not args: return ["ERROR: Use packinfo like this: packinfo "] @@ -283,6 +297,7 @@ class IRCInterface(Thread, Hook): return lines + def event_more(self, args): if not self.more: return ["No more information to display."] @@ -293,14 +308,17 @@ class IRCInterface(Thread, Hook): return lines + def event_start(self, args): self.api.unpauseServer() return ["INFO: Starting downloads."] + def event_stop(self, args): self.api.pauseServer() return ["INFO: No new downloads will be started."] + def event_add(self, args): if len(args) < 2: return ['ERROR: Add links like this: "add links". ', @@ -326,6 +344,7 @@ class IRCInterface(Thread, Hook): id = self.api.addPackage(pack, links, 1) return ["INFO: Created new Package %s [#%d] with %d links." % (pack, id, len(links))] + def event_del(self, args): if len(args) < 2: return ["ERROR: Use del command like this: del -p|-l [...] (-p indicates that the ids are from packages, -l indicates that the ids are from links)"] @@ -341,6 +360,7 @@ class IRCInterface(Thread, Hook): else: return ["ERROR: Use del command like this: del <-p|-l> [...] (-p indicates that the ids are from packages, -l indicates that the ids are from links)"] + def event_push(self, args): if not args: return ["ERROR: Push package to queue like this: push "] @@ -354,6 +374,7 @@ class IRCInterface(Thread, Hook): self.api.pushToQueue(id) return ["INFO: Pushed package #%d to queue." % id] + def event_pull(self, args): if not args: return ["ERROR: Pull package from queue like this: pull ."] @@ -365,6 +386,7 @@ class IRCInterface(Thread, Hook): self.api.pullFromQueue(id) return ["INFO: Pulled package #%d from queue to collector." % id] + def event_c(self, args): """ captcha answer """ if not args: @@ -377,6 +399,7 @@ class IRCInterface(Thread, Hook): task.setResult(" ".join(args[1:])) return ["INFO: Result %s saved." % " ".join(args[1:])] + def event_help(self, args): lines = ["The following commands are available:", "add [...] Adds link to package. (creates new package if it does not exist)", @@ -400,5 +423,6 @@ class IRCError(Exception): def __init__(self, value): self.value = value + def __str__(self): return repr(self.value) diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py index b7ee6b105..3eb0acd64 100644 --- a/module/plugins/hooks/ImageTyperz.py +++ b/module/plugins/hooks/ImageTyperz.py @@ -17,12 +17,15 @@ class ImageTyperzException(Exception): def __init__(self, err): self.err = err + def getCode(self): return self.err + def __str__(self): return "" % self.err + def __repr__(self): return "" % self.err @@ -51,6 +54,7 @@ class ImageTyperz(Hook): def setup(self): self.info = {} + def getCredits(self): response = getURL(self.GETCREDITS_URL, post={"action": "REQUESTBALANCE", "username": self.getConfig("username"), "password": self.getConfig("passkey")}) @@ -66,6 +70,7 @@ class ImageTyperz(Hook): self.logInfo(_("Account balance: $%s left") % response) return balance + def submit(self, captcha, captchaType="file", match=None): req = getRequest() #raise timeout threshold @@ -100,6 +105,7 @@ class ImageTyperz(Hook): return ticket, result + def newCaptchaTask(self, task): if "service" in task.data: return False @@ -122,6 +128,7 @@ class ImageTyperz(Hook): else: self.logInfo(_("Your %s account has not enough credits") % self.__name__) + def captchaInvalid(self, task): if task.data['service'] == self.__name__ and "ticket" in task.data: response = getURL(self.RESPOND_URL, post={"action": "SETBADIMAGE", "username": self.getConfig("username"), @@ -133,6 +140,7 @@ class ImageTyperz(Hook): else: self.logError(_("Bad captcha solution received, refund request failed"), response) + def processCaptcha(self, task): c = task.captchaFile try: diff --git a/module/plugins/hooks/LinkdecrypterCom.py b/module/plugins/hooks/LinkdecrypterCom.py index de08e406a..463a5af96 100644 --- a/module/plugins/hooks/LinkdecrypterCom.py +++ b/module/plugins/hooks/LinkdecrypterCom.py @@ -25,6 +25,7 @@ class LinkdecrypterCom(Hook): except Exception, e: self.logError(e) + def loadPatterns(self): page = getURL("http://linkdecrypter.com/") m = re.search(r'Supported\(\d+\): ([^+<]*)', page) diff --git a/module/plugins/hooks/MergeFiles.py b/module/plugins/hooks/MergeFiles.py index 5a23ff862..0eab0037c 100644 --- a/module/plugins/hooks/MergeFiles.py +++ b/module/plugins/hooks/MergeFiles.py @@ -27,6 +27,7 @@ class MergeFiles(Hook): # nothing to do pass + @threaded def packageFinished(self, pack): files = {} diff --git a/module/plugins/hooks/MultiHome.py b/module/plugins/hooks/MultiHome.py index 5cda53bd7..378c493e9 100644 --- a/module/plugins/hooks/MultiHome.py +++ b/module/plugins/hooks/MultiHome.py @@ -26,19 +26,23 @@ class MultiHome(Hook): self.parseInterfaces([self.config['download']['interface']]) self.setConfig("interfaces", self.toConfig()) + def toConfig(self): return ";".join([i.adress for i in self.interfaces]) + def parseInterfaces(self, interfaces): for interface in interfaces: if not interface or str(interface).lower() == "none": continue self.interfaces.append(Interface(interface)) + def coreReady(self): requestFactory = self.core.requestFactory oldGetRequest = requestFactory.getRequest + def getRequest(pluginName, account=None): iface = self.bestInterface(pluginName, account) if iface: @@ -49,6 +53,7 @@ class MultiHome(Hook): requestFactory.getRequest = getRequest + def bestInterface(self, pluginName, account): best = None for interface in self.interfaces: @@ -63,13 +68,16 @@ class Interface(object): self.adress = adress self.history = {} + def lastPluginAccess(self, pluginName, account): if (pluginName, account) in self.history: return self.history[(pluginName, account)] return 0 + def useFor(self, pluginName, account): self.history[(pluginName, account)] = time() + def __repr__(self): return "" % self.adress diff --git a/module/plugins/hooks/PremiumTo.py b/module/plugins/hooks/PremiumTo.py index e783bac8f..15a357ce3 100644 --- a/module/plugins/hooks/PremiumTo.py +++ b/module/plugins/hooks/PremiumTo.py @@ -25,6 +25,7 @@ class PremiumTo(MultiHoster): get={'username': self.account.username, 'password': self.account.password}) return [x.strip() for x in page.replace("\"", "").split(";")] + def coreReady(self): self.account = self.core.accountManager.getAccountPlugin("PremiumTo") diff --git a/module/plugins/hooks/PremiumizeMe.py b/module/plugins/hooks/PremiumizeMe.py index c1a7866c4..1ef82612e 100644 --- a/module/plugins/hooks/PremiumizeMe.py +++ b/module/plugins/hooks/PremiumizeMe.py @@ -42,6 +42,7 @@ class PremiumizeMe(MultiHoster): # Extract hosters from json file return data['result']['hosterlist'] + def coreReady(self): # Get account plugin and check if there is a valid account available self.account = self.core.accountManager.getAccountPlugin("PremiumizeMe") diff --git a/module/plugins/hooks/RPNetBiz.py b/module/plugins/hooks/RPNetBiz.py index f0231d0e7..feba36204 100644 --- a/module/plugins/hooks/RPNetBiz.py +++ b/module/plugins/hooks/RPNetBiz.py @@ -40,6 +40,7 @@ class RPNetBiz(MultiHoster): # Extract hosters from json file return hoster_list['hosters'] + def coreReady(self): # Get account plugin and check if there is a valid account available self.account = self.core.accountManager.getAccountPlugin("RPNetBiz") diff --git a/module/plugins/hooks/RehostTo.py b/module/plugins/hooks/RehostTo.py index f3e1465ee..ea4521a28 100644 --- a/module/plugins/hooks/RehostTo.py +++ b/module/plugins/hooks/RehostTo.py @@ -24,6 +24,7 @@ class RehostTo(MultiHoster): page = getURL("http://rehost.to/api.php?cmd=get_supported_och_dl&long_ses=%s" % self.long_ses) return [x.strip() for x in page.replace("\"", "").split(",")] + def coreReady(self): self.account = self.core.accountManager.getAccountPlugin("RehostTo") diff --git a/module/plugins/hooks/RestartFailed.py b/module/plugins/hooks/RestartFailed.py index 6724ceaa8..ebce60b3f 100644 --- a/module/plugins/hooks/RestartFailed.py +++ b/module/plugins/hooks/RestartFailed.py @@ -31,13 +31,16 @@ class RestartFailed(Hook): else: self.logDebug("Invalid interval value, kept current") + def periodical(self): self.logInfo(_("Restart failed downloads")) self.api.restartFailed() + def setup(self): self.api = self.core.api self.interval = self.MIN_INTERVAL + def coreReady(self): self.pluginConfigChanged(self.__name__, "interval", self.getConfig("interval")) diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index f29383b32..e3c0f6af9 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -32,6 +32,7 @@ class UnSkipOnFail(Hook): self.logInfo(_('restart "%s" (pid:%s)') % (pyfile_name, lpid)) self.setLinkStatus(link, "queued") + def findDuplicates(self, pyfile): """ Search all packages for duplicate links to "pyfile". Duplicates are links that would overwrite "pyfile". @@ -61,6 +62,7 @@ class UnSkipOnFail(Hook): dups.append(link) return dups + def setLinkStatus(self, link, new_status): """ Change status of "link" to "new_status". "link" has to be a valid FileData object, diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index cc086af5c..be1d6e5fc 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -48,14 +48,17 @@ class UpdateManager(Hook): if value is True and self.core.debug: self.periodical2() + def coreReady(self): self.pluginConfigChanged(self.__name__, "interval", self.getConfig("interval")) x = lambda: self.pluginConfigChanged(self.__name__, "reloadplugins", self.getConfig("reloadplugins")) self.core.scheduler.addJob(10, x, threaded=False) + def unload(self): self.pluginConfigChanged(self.__name__, "reloadplugins", False) + def setup(self): self.cb2 = None self.interval = self.MIN_INTERVAL @@ -63,11 +66,13 @@ class UpdateManager(Hook): self.info = {'pyload': False, 'version': None, 'plugins': False} self.mtimes = {} #: store modification time for each plugin + def periodical2(self): if not self.updating: self.autoreloadPlugins() self.cb2 = self.core.scheduler.addJob(4, self.periodical2, threaded=False) + @Expose def autoreloadPlugins(self): """ reload and reindex all modified plugins """ @@ -97,16 +102,19 @@ class UpdateManager(Hook): return True if self.core.pluginManager.reloadPlugins(reloads) else False + def periodical(self): if not self.info['pyload'] and not (self.getConfig("nodebugupdate") and self.core.debug): self.updateThread() + def server_request(self): try: return getURL(self.SERVER_URL, get={'v': self.core.api.getServerVersion()}).splitlines() except: self.logWarning(_("Unable to contact server to get updates")) + @threaded def updateThread(self): self.updating = True @@ -116,11 +124,13 @@ class UpdateManager(Hook): else: self.updating = False + @Expose def updatePlugins(self): """ simple wrapper for calling plugin update quickly """ return self.update(onlyplugin=True) + @Expose def update(self, onlyplugin=False): """ check for updates """ @@ -142,6 +152,7 @@ class UpdateManager(Hook): self.info['version'] = newversion return exitcode #: 0 = No plugins updated; 1 = Plugins updated; 2 = Plugins updated, but restart required; 3 = No plugins updated, new pyLoad version available + def _updatePlugins(self, updates): """ check for plugin updates """ @@ -240,6 +251,7 @@ class UpdateManager(Hook): return exitcode #: 0 = No plugins updated; 1 = Plugins updated; 2 = Plugins updated, but restart required + @Expose def removePlugins(self, type_plugins): """ delete plugins from disk """ diff --git a/module/plugins/hooks/WindowsPhoneToastNotify.py b/module/plugins/hooks/WindowsPhoneToastNotify.py index eed61adbd..cf7920b74 100644 --- a/module/plugins/hooks/WindowsPhoneToastNotify.py +++ b/module/plugins/hooks/WindowsPhoneToastNotify.py @@ -25,12 +25,14 @@ class WindowsPhoneToastNotify(Hook): def setup(self): self.info = {} + def getXmlData(self): myxml = (" " " Pyload Mobile Captcha waiting! " " ") return myxml + def doRequest(self): URL = self.getConfig("pushUrl") request = self.getXmlData() @@ -46,6 +48,7 @@ class WindowsPhoneToastNotify(Hook): webservice.close() self.setStorage("LAST_NOTIFY", time.time()) + def newCaptchaTask(self, task): if not self.getConfig("pushId") or not self.getConfig("pushUrl"): return False diff --git a/module/plugins/hooks/XMPPInterface.py b/module/plugins/hooks/XMPPInterface.py index b32eeb40b..c4d6e1b66 100644 --- a/module/plugins/hooks/XMPPInterface.py +++ b/module/plugins/hooks/XMPPInterface.py @@ -30,6 +30,7 @@ class XMPPInterface(IRCInterface, JabberClient): implements(IMessageHandlersProvider) + def __init__(self, core, manager): IRCInterface.__init__(self, core, manager) @@ -58,11 +59,13 @@ class XMPPInterface(IRCInterface, JabberClient): self, ] + def coreReady(self): self.new_package = {} self.start() + def packageFinished(self, pypack): try: if self.getConfig("info_pack"): @@ -70,6 +73,7 @@ class XMPPInterface(IRCInterface, JabberClient): except: pass + def downloadFinished(self, pyfile): try: if self.getConfig("info_file"): @@ -78,6 +82,7 @@ class XMPPInterface(IRCInterface, JabberClient): except: pass + def run(self): # connect to IRC etc. self.connect() @@ -86,21 +91,26 @@ class XMPPInterface(IRCInterface, JabberClient): except Exception, ex: self.logError(ex) + def stream_state_changed(self, state, arg): """This one is called when the state of stream connecting the component to a server changes. This will usually be used to let the user know what is going on.""" self.logDebug("*** State changed: %s %r ***" % (state, arg)) + def disconnected(self): self.logDebug("Client was disconnected") + def stream_closed(self, stream): self.logDebug("Stream was closed", stream) + def stream_error(self, err): self.logDebug("Stream Error", err) + def get_message_handlers(self): """Return list of (message_type, message_handler) tuples. @@ -108,6 +118,7 @@ class XMPPInterface(IRCInterface, JabberClient): in a client session.""" return [("normal", self.message)] + def message(self, stanza): """Message handler for the component.""" subject = stanza.get_subject() @@ -165,9 +176,11 @@ class XMPPInterface(IRCInterface, JabberClient): else: return True + def response(self, msg, origin=""): return self.announce(msg) + def announce(self, message): """ send message to all owners""" for user in self.getConfig("owners").split(";"): @@ -187,9 +200,11 @@ class XMPPInterface(IRCInterface, JabberClient): stream.send(m) + def beforeReconnecting(self, ip): self.disconnect() + def afterReconnecting(self, ip): self.connect() @@ -202,24 +217,29 @@ class VersionHandler(object): implements(IIqHandlersProvider, IFeaturesProvider) + def __init__(self, client): """Just remember who created this.""" self.client = client + def get_features(self): """Return namespace which should the client include in its reply to a disco#info query.""" return ["jabber:iq:version"] + def get_iq_get_handlers(self): """Return list of tuples (element_name, namespace, handler) describing handlers of stanzas""" return [("query", "jabber:iq:version", self.get_version)] + def get_iq_set_handlers(self): """Return empty list, as this class provides no stanza handler.""" return [] + def get_version(self, iq): """Handler for jabber:iq:version queries. -- cgit v1.2.3 From 1c4bf83881d2a22da3773666a580d51f6b57bfd1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Oct 2014 03:07:21 +0200 Subject: Avoid gettext conflict due variable `_` --- module/plugins/hooks/Captcha9kw.py | 2 +- module/plugins/hooks/CaptchaBrotherhood.py | 2 +- module/plugins/hooks/DeathByCaptcha.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index 947aff121..930293002 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -84,7 +84,7 @@ class Captcha9kw(Hook): if response.isdigit(): self.logInfo(_("New CaptchaID from upload: %s : %s") % (response, task.captchaFile)) - for _ in xrange(1, 100, 1): + for _i in xrange(1, 100, 1): response2 = getURL(self.API_URL, get={"apikey": self.getConfig("passkey"), "id": response, "pyload": "1", "source": "pyload", "action": "usercaptchacorrectdata"}) diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py index da8fcbafe..a04b8616d 100644 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ b/module/plugins/hooks/CaptchaBrotherhood.py @@ -113,7 +113,7 @@ class CaptchaBrotherhood(Hook): ticket = response[3:] - for _ in xrange(15): + for _i in xrange(15): sleep(5) response = self.get_api("askCaptchaResult", ticket) if response.startswith("OK-answered"): diff --git a/module/plugins/hooks/DeathByCaptcha.py b/module/plugins/hooks/DeathByCaptcha.py index 99d7f7401..f390954e1 100644 --- a/module/plugins/hooks/DeathByCaptcha.py +++ b/module/plugins/hooks/DeathByCaptcha.py @@ -148,7 +148,7 @@ class DeathByCaptcha(Hook): raise DeathByCaptchaException(response) ticket = response['captcha'] - for _ in xrange(24): + for _i in xrange(24): sleep(5) response = self.call_api("captcha/%d" % ticket, False) if response['text'] and response['is_correct']: -- cgit v1.2.3 From 9f2ebe486a3e155fb6a60e07cccb77ab6a772eb2 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 26 Oct 2014 02:31:54 +0200 Subject: Extend translation support in plugins + a lot of code cosmetics and typo fixes --- module/plugins/hooks/BypassCaptcha.py | 2 +- module/plugins/hooks/Captcha9kw.py | 8 ++++---- module/plugins/hooks/Checksum.py | 6 +++--- module/plugins/hooks/ExpertDecoders.py | 2 +- module/plugins/hooks/ExtractArchive.py | 12 ++++++------ module/plugins/hooks/IRCInterface.py | 6 +++--- module/plugins/hooks/PremiumizeMe.py | 2 +- module/plugins/hooks/UpdateManager.py | 6 +++--- 8 files changed, 22 insertions(+), 22 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index a07b2fc66..ef7ba01c3 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -92,7 +92,7 @@ class BypassCaptcha(Hook): response = getURL(self.RESPOND_URL, post={"task_id": ticket, "key": self.getConfig("passkey"), "cv": 1 if success else 0}) except BadHeader, e: - self.logError(_("Could not send response."), e + self.logError(_("Could not send response"), repr(e)) def newCaptchaTask(self, task): diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index 930293002..7bbfa2e73 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -137,9 +137,9 @@ class Captcha9kw(Hook): self.logInfo(_("Request correct"), response) except BadHeader, e: - self.logError(_("Could not send correct request."), e) + self.logError(_("Could not send correct request"), repr(e)) else: - self.logError(_("No CaptchaID for correct request (task %s) found.") % task) + self.logError(_("No CaptchaID for correct request (task %s) found") % task) def captchaInvalid(self, task): @@ -157,6 +157,6 @@ class Captcha9kw(Hook): self.logInfo(_("Request refund"), response) except BadHeader, e: - self.logError(_("Could not send refund request."), e) + self.logError(_("Could not send refund request"), repr(e)) else: - self.logError(_("No CaptchaID for not correct request (task %s) found.") % task) + self.logError(_("No CaptchaID for not correct request (task %s) found") % task) diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index 4a7cfd661..bcd1139d9 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -120,7 +120,7 @@ class Checksum(Hook): checksum = computeChecksum(local_file, key.replace("-", "").lower()) if checksum: if checksum == data[key].lower(): - self.logInfo(_('File integrity of "%s" verified by %s checksum (%s).') % + self.logInfo(_('File integrity of "%s" verified by %s checksum (%s)') % (pyfile.name, key.upper(), checksum)) break else: @@ -130,7 +130,7 @@ class Checksum(Hook): else: self.logWarning(_("Unsupported hashing algorithm"), key.upper()) else: - self.logWarning(_("Unable to validate checksum for file"), pyfile.name) + self.logWarning(_("Unable to validate checksum for file: ") + pyfile.name) def checkFailed(self, pyfile, local_file, msg): @@ -174,7 +174,7 @@ class Checksum(Hook): algorithm = self.methods.get(file_type, file_type) checksum = computeChecksum(local_file, algorithm) if checksum == data['hash']: - self.logInfo(_('File integrity of "%s" verified by %s checksum (%s).') % + self.logInfo(_('File integrity of "%s" verified by %s checksum (%s)') % (data['name'], algorithm, checksum)) else: self.logWarning(_("%s checksum for file %s does not match (%s != %s)") % diff --git a/module/plugins/hooks/ExpertDecoders.py b/module/plugins/hooks/ExpertDecoders.py index e786cc35a..f1d949544 100644 --- a/module/plugins/hooks/ExpertDecoders.py +++ b/module/plugins/hooks/ExpertDecoders.py @@ -96,4 +96,4 @@ class ExpertDecoders(Hook): self.logInfo(_("Request refund"), response) except BadHeader, e: - self.logError(_("Could not send refund request."), e) + self.logError(_("Could not send refund request"), repr(e)) diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 649689f6e..8164b3157 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -98,12 +98,12 @@ class ExtractArchive(Hook): if e.errno == 2: self.logInfo(_("No %s installed") % p) else: - self.logWarning(_("Could not activate %s") % p, e) + self.logWarning(_("Could not activate %s") % p, repr(e)) if self.core.debug: print_exc() except Exception, e: - self.logWarning(_("Could not activate %s") % p, e) + self.logWarning(_("Could not activate %s") % p, repr(e)) if self.core.debug: print_exc() @@ -202,7 +202,7 @@ class ExtractArchive(Hook): password = p.password.strip().splitlines() new_files = self._extract(klass, fid, password, thread) except Exception, e: - self.logError(basename(target), e) + self.logError(basename(target), repr(e)) success = False continue @@ -289,13 +289,13 @@ class ExtractArchive(Hook): return extracted_files except ArchiveError, e: - self.logError(basename(plugin.file), _("Archive Error"), e) + self.logError(basename(plugin.file), _("Archive Error"), repr(e)) except CRCError: self.logError(basename(plugin.file), _("CRC Mismatch")) except Exception, e: if self.core.debug: print_exc() - self.logError(basename(plugin.file), _("Unknown Error"), e) + self.logError(basename(plugin.file), _("Unknown Error"), repr(e)) self.manager.dispatchEvent("archive_extract_failed", pyfile) raise Exception(_("Extract failed")) @@ -352,4 +352,4 @@ class ExtractArchive(Hook): gid = getgrnam(self.config['permission']['group'])[2] chown(f, uid, gid) except Exception, e: - self.logWarning(_("Setting User and Group failed"), e) + self.logWarning(_("Setting User and Group failed"), repr(e)) diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index 59977b8af..9a23951cf 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -156,15 +156,15 @@ class IRCInterface(Thread, Hook): # HANDLE CTCP ANTI FLOOD/BOT PROTECTION if msg['text'] == "\x01VERSION\x01": - self.logDebug("Sending CTCP VERSION.") + self.logDebug("Sending CTCP VERSION") self.sock.send("NOTICE %s :%s\r\n" % (msg['origin'], "pyLoad! IRC Interface")) return elif msg['text'] == "\x01TIME\x01": - self.logDebug("Sending CTCP TIME.") + self.logDebug("Sending CTCP TIME") self.sock.send("NOTICE %s :%d\r\n" % (msg['origin'], time.time())) return elif msg['text'] == "\x01LAG\x01": - self.logDebug("Received CTCP LAG.") # don't know how to answer + self.logDebug("Received CTCP LAG") #: don't know how to answer return trigger = "pass" diff --git a/module/plugins/hooks/PremiumizeMe.py b/module/plugins/hooks/PremiumizeMe.py index 1ef82612e..2adeadb75 100644 --- a/module/plugins/hooks/PremiumizeMe.py +++ b/module/plugins/hooks/PremiumizeMe.py @@ -48,7 +48,7 @@ class PremiumizeMe(MultiHoster): self.account = self.core.accountManager.getAccountPlugin("PremiumizeMe") if not self.account.canUse(): self.account = None - self.logError(_("Please add a valid premiumize.me account first and restart pyLoad.")) + self.logError(_("Please add a valid premiumize.me account first and restart pyLoad")) return # Run the overwriten core ready which actually enables the multihoster hook diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index be1d6e5fc..1bddbf967 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -218,7 +218,7 @@ class UpdateManager(Hook): else: raise Exception, _("Version mismatch") except Exception, e: - self.logError(_("Error updating plugin %s") % filename, e) + self.logError(_("Error updating plugin %s") % filename, repr(e)) if blacklist: blacklisted = sorted(map(lambda x: (x.split('|')[0], x.split('|')[1].rsplit('.', 1)[0]), blacklist)) @@ -273,7 +273,7 @@ class UpdateManager(Hook): try: remove(filename) except Exception, e: - self.logDebug("Error deleting", path.basename(filename), e) + self.logDebug("Error deleting", path.basename(filename), repr(e)) err = True filename += "c" @@ -283,7 +283,7 @@ class UpdateManager(Hook): self.manager.deactivateHook(name) remove(filename) except Exception, e: - self.logDebug("Error deleting", path.basename(filename), e) + self.logDebug("Error deleting", path.basename(filename), repr(e)) err = True if not err: -- cgit v1.2.3 From 65317e4807e564ef527b7694335a771db0fa5ad0 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 26 Oct 2014 02:38:48 +0200 Subject: [XFileSharingPro] Added filevice.com to HOSTER_LIST --- module/plugins/hooks/XFileSharingPro.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 54d97de53..691af8d4c 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.18" + __version__ = "0.19" __config__ = [("activated", "bool", "Activated", True), ("match_hoster", "Always;Always except excluded;Listed only", "Hoster match", "Always except excluded"), @@ -28,7 +28,7 @@ class XFileSharingPro(Hook): event_list = ["pluginConfigChanged"] HOSTER_LIST = [#WORKING HOSTERS: - "eyesfile.ca", "fileband.com", "filedwon.com", "hostingbulk.com", "linestorage.com", + "eyesfile.ca", "fileband.com", "filedwon.com", "filevice.com", "hostingbulk.com", "linestorage.com", "ravishare.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", #NOT TESTED: "101shared.com", "4upfiles.com", "filemaze.ws", "filenuke.com", "linkzhost.com", "mightyupload.com", -- cgit v1.2.3 From 146fe1e309c33ab149bfaf58ad86c0dd4fb9b156 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 27 Oct 2014 01:18:45 +0100 Subject: Spare code cosmetics --- module/plugins/hooks/BypassCaptcha.py | 2 +- module/plugins/hooks/Captcha9kw.py | 4 ++-- module/plugins/hooks/ExpertDecoders.py | 2 +- module/plugins/hooks/ExtractArchive.py | 12 ++++++------ module/plugins/hooks/IRCInterface.py | 2 +- module/plugins/hooks/MergeFiles.py | 5 +++-- module/plugins/hooks/UpdateManager.py | 6 +++--- module/plugins/hooks/XMPPInterface.py | 2 +- 8 files changed, 18 insertions(+), 17 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index ef7ba01c3..d4c41b02a 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -92,7 +92,7 @@ class BypassCaptcha(Hook): response = getURL(self.RESPOND_URL, post={"task_id": ticket, "key": self.getConfig("passkey"), "cv": 1 if success else 0}) except BadHeader, e: - self.logError(_("Could not send response"), repr(e)) + self.logError(_("Could not send response"), str(e)) def newCaptchaTask(self, task): diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index 7bbfa2e73..eb6313bc0 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -137,7 +137,7 @@ class Captcha9kw(Hook): self.logInfo(_("Request correct"), response) except BadHeader, e: - self.logError(_("Could not send correct request"), repr(e)) + self.logError(_("Could not send correct request"), str(e)) else: self.logError(_("No CaptchaID for correct request (task %s) found") % task) @@ -157,6 +157,6 @@ class Captcha9kw(Hook): self.logInfo(_("Request refund"), response) except BadHeader, e: - self.logError(_("Could not send refund request"), repr(e)) + self.logError(_("Could not send refund request"), str(e)) else: self.logError(_("No CaptchaID for not correct request (task %s) found") % task) diff --git a/module/plugins/hooks/ExpertDecoders.py b/module/plugins/hooks/ExpertDecoders.py index f1d949544..d112b3a35 100644 --- a/module/plugins/hooks/ExpertDecoders.py +++ b/module/plugins/hooks/ExpertDecoders.py @@ -96,4 +96,4 @@ class ExpertDecoders(Hook): self.logInfo(_("Request refund"), response) except BadHeader, e: - self.logError(_("Could not send refund request"), repr(e)) + self.logError(_("Could not send refund request"), str(e)) diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 8164b3157..4a4f2d4d8 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -98,12 +98,12 @@ class ExtractArchive(Hook): if e.errno == 2: self.logInfo(_("No %s installed") % p) else: - self.logWarning(_("Could not activate %s") % p, repr(e)) + self.logWarning(_("Could not activate %s") % p, str(e)) if self.core.debug: print_exc() except Exception, e: - self.logWarning(_("Could not activate %s") % p, repr(e)) + self.logWarning(_("Could not activate %s") % p, str(e)) if self.core.debug: print_exc() @@ -202,7 +202,7 @@ class ExtractArchive(Hook): password = p.password.strip().splitlines() new_files = self._extract(klass, fid, password, thread) except Exception, e: - self.logError(basename(target), repr(e)) + self.logError(basename(target), str(e)) success = False continue @@ -289,13 +289,13 @@ class ExtractArchive(Hook): return extracted_files except ArchiveError, e: - self.logError(basename(plugin.file), _("Archive Error"), repr(e)) + self.logError(basename(plugin.file), _("Archive Error"), str(e)) except CRCError: self.logError(basename(plugin.file), _("CRC Mismatch")) except Exception, e: if self.core.debug: print_exc() - self.logError(basename(plugin.file), _("Unknown Error"), repr(e)) + self.logError(basename(plugin.file), _("Unknown Error"), str(e)) self.manager.dispatchEvent("archive_extract_failed", pyfile) raise Exception(_("Extract failed")) @@ -352,4 +352,4 @@ class ExtractArchive(Hook): gid = getgrnam(self.config['permission']['group'])[2] chown(f, uid, gid) except Exception, e: - self.logWarning(_("Setting User and Group failed"), repr(e)) + self.logWarning(_("Setting User and Group failed"), str(e)) diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index 9a23951cf..061714757 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -184,7 +184,7 @@ class IRCInterface(Thread, Hook): for line in res: self.response(line, msg['origin']) except Exception, e: - self.logError(repr(e)) + self.logError(str(e)) def response(self, msg, origin=""): diff --git a/module/plugins/hooks/MergeFiles.py b/module/plugins/hooks/MergeFiles.py index 0eab0037c..7562df2a8 100644 --- a/module/plugins/hooks/MergeFiles.py +++ b/module/plugins/hooks/MergeFiles.py @@ -2,7 +2,8 @@ import os import re -import traceback + +from traceback import print_exc from module.plugins.Hook import Hook, threaded from module.utils import save_join, fs_encode @@ -68,7 +69,7 @@ class MergeFiles(Hook): s_file.close() self.logDebug("Finished merging part", splitted_file) except Exception, e: - print traceback.print_exc() + print_exc() finally: pyfile.setProgress(100) pyfile.setStatus("finished") diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 1bddbf967..d5fb43ddc 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -218,7 +218,7 @@ class UpdateManager(Hook): else: raise Exception, _("Version mismatch") except Exception, e: - self.logError(_("Error updating plugin %s") % filename, repr(e)) + self.logError(_("Error updating plugin %s") % filename, str(e)) if blacklist: blacklisted = sorted(map(lambda x: (x.split('|')[0], x.split('|')[1].rsplit('.', 1)[0]), blacklist)) @@ -273,7 +273,7 @@ class UpdateManager(Hook): try: remove(filename) except Exception, e: - self.logDebug("Error deleting", path.basename(filename), repr(e)) + self.logDebug("Error deleting", path.basename(filename), str(e)) err = True filename += "c" @@ -283,7 +283,7 @@ class UpdateManager(Hook): self.manager.deactivateHook(name) remove(filename) except Exception, e: - self.logDebug("Error deleting", path.basename(filename), repr(e)) + self.logDebug("Error deleting", path.basename(filename), str(e)) err = True if not err: diff --git a/module/plugins/hooks/XMPPInterface.py b/module/plugins/hooks/XMPPInterface.py index c4d6e1b66..8a4e0e9d9 100644 --- a/module/plugins/hooks/XMPPInterface.py +++ b/module/plugins/hooks/XMPPInterface.py @@ -169,7 +169,7 @@ class XMPPInterface(IRCInterface, JabberClient): messages.append(m) except Exception, e: - self.logError(repr(e)) + self.logError(str(e)) return messages -- cgit v1.2.3 From 885f8ed782e64d9e73367905e642a84d0a8999f1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Oct 2014 04:01:38 +0100 Subject: Update __config__ --- module/plugins/hooks/AlldebridCom.py | 3 +-- module/plugins/hooks/BypassCaptcha.py | 3 +-- module/plugins/hooks/Captcha9kw.py | 3 +-- module/plugins/hooks/CaptchaBrotherhood.py | 3 +-- module/plugins/hooks/Checksum.py | 3 +-- module/plugins/hooks/DeathByCaptcha.py | 3 +-- module/plugins/hooks/DebridItaliaCom.py | 3 +-- module/plugins/hooks/DownloadScheduler.py | 3 +-- module/plugins/hooks/EasybytezCom.py | 3 +-- module/plugins/hooks/ExpertDecoders.py | 3 +-- module/plugins/hooks/FastixRu.py | 3 +-- module/plugins/hooks/FreeWayMe.py | 3 +-- module/plugins/hooks/HotFolder.py | 3 +-- module/plugins/hooks/IRCInterface.py | 3 +-- module/plugins/hooks/ImageTyperz.py | 3 +-- module/plugins/hooks/LinkdecrypterCom.py | 2 -- module/plugins/hooks/LinksnappyCom.py | 3 +-- module/plugins/hooks/MegaDebridEu.py | 3 +-- module/plugins/hooks/MergeFiles.py | 2 +- module/plugins/hooks/MultiHome.py | 3 +-- module/plugins/hooks/MultishareCz.py | 3 +-- module/plugins/hooks/MyfastfileCom.py | 3 +-- module/plugins/hooks/OverLoadMe.py | 3 +-- module/plugins/hooks/PremiumTo.py | 3 +-- module/plugins/hooks/PremiumizeMe.py | 3 +-- module/plugins/hooks/RPNetBiz.py | 3 +-- module/plugins/hooks/RealdebridCom.py | 3 +-- module/plugins/hooks/RehostTo.py | 3 +-- module/plugins/hooks/RestartFailed.py | 3 +-- module/plugins/hooks/SimplydebridCom.py | 3 +-- module/plugins/hooks/UnrestrictLi.py | 3 +-- module/plugins/hooks/WindowsPhoneToastNotify.py | 3 +-- module/plugins/hooks/XMPPInterface.py | 3 +-- module/plugins/hooks/ZeveraCom.py | 3 +-- 34 files changed, 33 insertions(+), 67 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/AlldebridCom.py b/module/plugins/hooks/AlldebridCom.py index e2e044526..fda57ee0f 100644 --- a/module/plugins/hooks/AlldebridCom.py +++ b/module/plugins/hooks/AlldebridCom.py @@ -9,8 +9,7 @@ class AlldebridCom(MultiHoster): __type__ = "hook" __version__ = "0.13" - __config__ = [("activated", "bool", "Activated", False), - ("https", "bool", "Enable HTTPS", False), + __config__ = [("https", "bool", "Enable HTTPS", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("hosterList", "str", "Hoster list (comma separated)", ""), ("unloadFailing", "bool", "Revert to stanard download if download fails", False), diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index d4c41b02a..4150ed242 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -31,8 +31,7 @@ class BypassCaptcha(Hook): __type__ = "hook" __version__ = "0.04" - __config__ = [("activated", "bool", "Activated", False), - ("force", "bool", "Force BC even if client is connected", False), + __config__ = [("force", "bool", "Force BC even if client is connected", False), ("passkey", "password", "Passkey", "")] __description__ = """Send captchas to BypassCaptcha.com""" diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index eb6313bc0..4ab163358 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -17,8 +17,7 @@ class Captcha9kw(Hook): __type__ = "hook" __version__ = "0.10" - __config__ = [("activated", "bool", "Activated", False), - ("force", "bool", "Force CT even if client is connected", True), + __config__ = [("force", "bool", "Force CT even if client is connected", True), ("https", "bool", "Enable HTTPS", False), ("confirm", "bool", "Confirm Captcha (Cost +6)", False), ("captchaperhour", "int", "Captcha per hour (max. 9999)", 9999), diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py index a04b8616d..011968060 100644 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ b/module/plugins/hooks/CaptchaBrotherhood.py @@ -41,8 +41,7 @@ class CaptchaBrotherhood(Hook): __type__ = "hook" __version__ = "0.05" - __config__ = [("activated", "bool", "Activated", False), - ("username", "str", "Username", ""), + __config__ = [("username", "str", "Username", ""), ("force", "bool", "Force CT even if client is connected", False), ("passkey", "password", "Password", "")] diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index bcd1139d9..af9ff22a9 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -42,8 +42,7 @@ class Checksum(Hook): __type__ = "hook" __version__ = "0.13" - __config__ = [("activated", "bool", "Activated", False), - ("check_checksum", "bool", "Check checksum? (If False only size will be verified)", True), + __config__ = [("check_checksum", "bool", "Check checksum? (If False only size will be verified)", True), ("check_action", "fail;retry;nothing", "What to do if check fails?", "retry"), ("max_tries", "int", "Number of retries", 2), ("retry_action", "fail;nothing", "What to do if all retries fail?", "fail"), diff --git a/module/plugins/hooks/DeathByCaptcha.py b/module/plugins/hooks/DeathByCaptcha.py index f390954e1..97f55d826 100644 --- a/module/plugins/hooks/DeathByCaptcha.py +++ b/module/plugins/hooks/DeathByCaptcha.py @@ -54,8 +54,7 @@ class DeathByCaptcha(Hook): __type__ = "hook" __version__ = "0.03" - __config__ = [("activated", "bool", "Activated", False), - ("username", "str", "Username", ""), + __config__ = [("username", "str", "Username", ""), ("passkey", "password", "Password", ""), ("force", "bool", "Force DBC even if client is connected", False)] diff --git a/module/plugins/hooks/DebridItaliaCom.py b/module/plugins/hooks/DebridItaliaCom.py index 667e78b97..dab496c37 100644 --- a/module/plugins/hooks/DebridItaliaCom.py +++ b/module/plugins/hooks/DebridItaliaCom.py @@ -8,8 +8,7 @@ class DebridItaliaCom(MultiHoster): __type__ = "hook" __version__ = "0.07" - __config__ = [("activated", "bool", "Activated", False), - ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), + __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("hosterList", "str", "Hoster list (comma separated)", ""), ("unloadFailing", "bool", "Revert to standard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 24)] diff --git a/module/plugins/hooks/DownloadScheduler.py b/module/plugins/hooks/DownloadScheduler.py index 70930ab67..d0095306c 100644 --- a/module/plugins/hooks/DownloadScheduler.py +++ b/module/plugins/hooks/DownloadScheduler.py @@ -12,8 +12,7 @@ class DownloadScheduler(Hook): __type__ = "hook" __version__ = "0.21" - __config__ = [("activated", "bool", "Activated", False), - ("timetable", "str", "List time periods as hh:mm full or number(kB/s)", + __config__ = [("timetable", "str", "List time periods as hh:mm full or number(kB/s)", "0:00 full, 7:00 250, 10:00 0, 17:00 150"), ("abort", "bool", "Abort active downloads when start period with speed 0", False)] diff --git a/module/plugins/hooks/EasybytezCom.py b/module/plugins/hooks/EasybytezCom.py index 5489dd6ac..305b32de3 100644 --- a/module/plugins/hooks/EasybytezCom.py +++ b/module/plugins/hooks/EasybytezCom.py @@ -10,8 +10,7 @@ class EasybytezCom(MultiHoster): __type__ = "hook" __version__ = "0.03" - __config__ = [("activated", "bool", "Activated", False), - ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), + __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("hosterList", "str", "Hoster list (comma separated)", "")] __description__ = """EasyBytez.com hook plugin""" diff --git a/module/plugins/hooks/ExpertDecoders.py b/module/plugins/hooks/ExpertDecoders.py index d112b3a35..84d6b8597 100644 --- a/module/plugins/hooks/ExpertDecoders.py +++ b/module/plugins/hooks/ExpertDecoders.py @@ -17,8 +17,7 @@ class ExpertDecoders(Hook): __type__ = "hook" __version__ = "0.01" - __config__ = [("activated", "bool", "Activated", False), - ("force", "bool", "Force CT even if client is connected", False), + __config__ = [("force", "bool", "Force CT even if client is connected", False), ("passkey", "password", "Access key", "")] __description__ = """Send captchas to expertdecoders.com""" diff --git a/module/plugins/hooks/FastixRu.py b/module/plugins/hooks/FastixRu.py index a6c94a66a..4be38dad3 100644 --- a/module/plugins/hooks/FastixRu.py +++ b/module/plugins/hooks/FastixRu.py @@ -10,8 +10,7 @@ class FastixRu(MultiHoster): __type__ = "hook" __version__ = "0.02" - __config__ = [("activated", "bool", "Activated", False), - ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), + __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("unloadFailing", "bool", "Revert to standard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 24)] diff --git a/module/plugins/hooks/FreeWayMe.py b/module/plugins/hooks/FreeWayMe.py index 110f371c2..6019a1c35 100644 --- a/module/plugins/hooks/FreeWayMe.py +++ b/module/plugins/hooks/FreeWayMe.py @@ -9,8 +9,7 @@ class FreeWayMe(MultiHoster): __type__ = "hook" __version__ = "0.11" - __config__ = [("activated", "bool", "Activated", False), - ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), + __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), ("hosterList", "str", "Hoster list (comma separated)", ""), ("unloadFailing", "bool", "Revert to stanard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 24)] diff --git a/module/plugins/hooks/HotFolder.py b/module/plugins/hooks/HotFolder.py index 688dcbf48..00eac266c 100644 --- a/module/plugins/hooks/HotFolder.py +++ b/module/plugins/hooks/HotFolder.py @@ -14,8 +14,7 @@ class HotFolder(Hook): __type__ = "hook" __version__ = "0.11" - __config__ = [("activated", "bool", "Activated", False), - ("folder", "str", "Folder to observe", "container"), + __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")] diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index 061714757..bc99d708b 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -21,8 +21,7 @@ class IRCInterface(Thread, Hook): __type__ = "hook" __version__ = "0.11" - __config__ = [("activated", "bool", "Activated", False), - ("host", "str", "IRC-Server Address", "Enter your server here!"), + __config__ = [("host", "str", "IRC-Server Address", "Enter your server here!"), ("port", "int", "IRC-Server Port", 6667), ("ident", "str", "Clients ident", "pyload-irc"), ("realname", "str", "Realname", "pyload-irc"), diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py index 3eb0acd64..baa62ce31 100644 --- a/module/plugins/hooks/ImageTyperz.py +++ b/module/plugins/hooks/ImageTyperz.py @@ -35,8 +35,7 @@ class ImageTyperz(Hook): __type__ = "hook" __version__ = "0.04" - __config__ = [("activated", "bool", "Activated", False), - ("username", "str", "Username", ""), + __config__ = [("username", "str", "Username", ""), ("passkey", "password", "Password", ""), ("force", "bool", "Force IT even if client is connected", False)] diff --git a/module/plugins/hooks/LinkdecrypterCom.py b/module/plugins/hooks/LinkdecrypterCom.py index 463a5af96..0a6974584 100644 --- a/module/plugins/hooks/LinkdecrypterCom.py +++ b/module/plugins/hooks/LinkdecrypterCom.py @@ -12,8 +12,6 @@ class LinkdecrypterCom(Hook): __type__ = "hook" __version__ = "0.19" - __config__ = [("activated", "bool", "Activated", False)] - __description__ = """Linkdecrypter.com hook plugin""" __license__ = "GPLv3" __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] diff --git a/module/plugins/hooks/LinksnappyCom.py b/module/plugins/hooks/LinksnappyCom.py index bfd85f6b5..771ab2d62 100644 --- a/module/plugins/hooks/LinksnappyCom.py +++ b/module/plugins/hooks/LinksnappyCom.py @@ -10,8 +10,7 @@ class LinksnappyCom(MultiHoster): __type__ = "hook" __version__ = "0.01" - __config__ = [("activated", "bool", "Activated", False), - ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), + __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("hosterList", "str", "Hoster list (comma separated)", ""), ("unloadFailing", "bool", "Revert to standard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 24)] diff --git a/module/plugins/hooks/MegaDebridEu.py b/module/plugins/hooks/MegaDebridEu.py index 0d16e04d2..11cfa0824 100644 --- a/module/plugins/hooks/MegaDebridEu.py +++ b/module/plugins/hooks/MegaDebridEu.py @@ -10,8 +10,7 @@ class MegaDebridEu(MultiHoster): __type__ = "hook" __version__ = "0.02" - __config__ = [("activated", "bool", "Activated", False), - ("unloadFailing", "bool", "Revert to standard download if download fails", False)] + __config__ = [("unloadFailing", "bool", "Revert to standard download if download fails", False)] __description__ = """mega-debrid.eu hook plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/MergeFiles.py b/module/plugins/hooks/MergeFiles.py index 7562df2a8..b61857189 100644 --- a/module/plugins/hooks/MergeFiles.py +++ b/module/plugins/hooks/MergeFiles.py @@ -14,7 +14,7 @@ class MergeFiles(Hook): __type__ = "hook" __version__ = "0.12" - __config__ = [("activated", "bool", "Activated", False)] + __config__ = [("activated", "bool", "Activated", True)] __description__ = """Merges parts splitted with hjsplit""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/MultiHome.py b/module/plugins/hooks/MultiHome.py index 378c493e9..d71e5800a 100644 --- a/module/plugins/hooks/MultiHome.py +++ b/module/plugins/hooks/MultiHome.py @@ -10,8 +10,7 @@ class MultiHome(Hook): __type__ = "hook" __version__ = "0.11" - __config__ = [("activated", "bool", "Activated", False), - ("interfaces", "str", "Interfaces", "None")] + __config__ = [("interfaces", "str", "Interfaces", "None")] __description__ = """Ip address changer""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/MultishareCz.py b/module/plugins/hooks/MultishareCz.py index b7c69b3dc..e53932b14 100644 --- a/module/plugins/hooks/MultishareCz.py +++ b/module/plugins/hooks/MultishareCz.py @@ -11,8 +11,7 @@ class MultishareCz(MultiHoster): __type__ = "hook" __version__ = "0.04" - __config__ = [("activated", "bool", "Activated", False), - ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), + __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("hosterList", "str", "Hoster list (comma separated)", "uloz.to")] __description__ = """MultiShare.cz hook plugin""" diff --git a/module/plugins/hooks/MyfastfileCom.py b/module/plugins/hooks/MyfastfileCom.py index 5c22f7910..a95dd2ac8 100644 --- a/module/plugins/hooks/MyfastfileCom.py +++ b/module/plugins/hooks/MyfastfileCom.py @@ -10,8 +10,7 @@ class MyfastfileCom(MultiHoster): __type__ = "hook" __version__ = "0.02" - __config__ = [("activated", "bool", "Activated", False), - ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), + __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("hosterList", "str", "Hoster list (comma separated)", ""), ("unloadFailing", "bool", "Revert to standard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 24)] diff --git a/module/plugins/hooks/OverLoadMe.py b/module/plugins/hooks/OverLoadMe.py index fcb9a647a..2fcd132a2 100644 --- a/module/plugins/hooks/OverLoadMe.py +++ b/module/plugins/hooks/OverLoadMe.py @@ -9,8 +9,7 @@ class OverLoadMe(MultiHoster): __type__ = "hook" __version__ = "0.01" - __config__ = [("activated", "bool", "Activated", False), - ("https", "bool", "Enable HTTPS", True), + __config__ = [("https", "bool", "Enable HTTPS", True), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), ("hosterList", "str", "Hoster list (comma separated)", ""), ("unloadFailing", "bool", "Revert to standard download if download fails", False), diff --git a/module/plugins/hooks/PremiumTo.py b/module/plugins/hooks/PremiumTo.py index 15a357ce3..d9f80f263 100644 --- a/module/plugins/hooks/PremiumTo.py +++ b/module/plugins/hooks/PremiumTo.py @@ -9,8 +9,7 @@ class PremiumTo(MultiHoster): __type__ = "hook" __version__ = "0.04" - __config__ = [("activated", "bool", "Activated", False), - ("hosterListMode", "all;listed;unlisted", "Use for downloads from supported hosters:", "all"), + __config__ = [("hosterListMode", "all;listed;unlisted", "Use for downloads from supported hosters:", "all"), ("hosterList", "str", "Hoster list (comma separated)", "")] __description__ = """Premium.to hook plugin""" diff --git a/module/plugins/hooks/PremiumizeMe.py b/module/plugins/hooks/PremiumizeMe.py index 2adeadb75..f55efc6bd 100644 --- a/module/plugins/hooks/PremiumizeMe.py +++ b/module/plugins/hooks/PremiumizeMe.py @@ -10,8 +10,7 @@ class PremiumizeMe(MultiHoster): __type__ = "hook" __version__ = "0.12" - __config__ = [("activated", "bool", "Activated", False), - ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), + __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), ("hosterList", "str", "Hoster list (comma separated)", ""), ("unloadFailing", "bool", "Revert to stanard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 24)] diff --git a/module/plugins/hooks/RPNetBiz.py b/module/plugins/hooks/RPNetBiz.py index feba36204..7ade16a24 100644 --- a/module/plugins/hooks/RPNetBiz.py +++ b/module/plugins/hooks/RPNetBiz.py @@ -10,8 +10,7 @@ class RPNetBiz(MultiHoster): __type__ = "hook" __version__ = "0.1" - __config__ = [("activated", "bool", "Activated", False), - ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), + __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), ("hosterList", "str", "Hoster list (comma separated)", ""), ("unloadFailing", "bool", "Revert to stanard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 24)] diff --git a/module/plugins/hooks/RealdebridCom.py b/module/plugins/hooks/RealdebridCom.py index f206c9319..4ea37dda7 100644 --- a/module/plugins/hooks/RealdebridCom.py +++ b/module/plugins/hooks/RealdebridCom.py @@ -9,8 +9,7 @@ class RealdebridCom(MultiHoster): __type__ = "hook" __version__ = "0.43" - __config__ = [("activated", "bool", "Activated", False), - ("https", "bool", "Enable HTTPS", False), + __config__ = [("https", "bool", "Enable HTTPS", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), ("hosterList", "str", "Hoster list (comma separated)", ""), ("unloadFailing", "bool", "Revert to stanard download if download fails", False), diff --git a/module/plugins/hooks/RehostTo.py b/module/plugins/hooks/RehostTo.py index ea4521a28..52a96855e 100644 --- a/module/plugins/hooks/RehostTo.py +++ b/module/plugins/hooks/RehostTo.py @@ -9,8 +9,7 @@ class RehostTo(MultiHoster): __type__ = "hook" __version__ = "0.43" - __config__ = [("activated", "bool", "Activated", False), - ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), + __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("hosterList", "str", "Hoster list (comma separated)", ""), ("unloadFailing", "bool", "Revert to stanard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 24)] diff --git a/module/plugins/hooks/RestartFailed.py b/module/plugins/hooks/RestartFailed.py index ebce60b3f..1c2cd1002 100644 --- a/module/plugins/hooks/RestartFailed.py +++ b/module/plugins/hooks/RestartFailed.py @@ -8,8 +8,7 @@ class RestartFailed(Hook): __type__ = "hook" __version__ = "1.55" - __config__ = [("activated", "bool", "Activated", False), - ("interval", "int", "Check interval in minutes", 90)] + __config__ = [("interval", "int", "Check interval in minutes", 90)] __description__ = """Periodically restart all failed downloads in queue""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/SimplydebridCom.py b/module/plugins/hooks/SimplydebridCom.py index 14be2a032..0e4c045fd 100644 --- a/module/plugins/hooks/SimplydebridCom.py +++ b/module/plugins/hooks/SimplydebridCom.py @@ -9,8 +9,7 @@ class SimplydebridCom(MultiHoster): __type__ = "hook" __version__ = "0.01" - __config__ = [("activated", "bool", "Activated", False), - ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), + __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("hosterList", "str", "Hoster list (comma separated)", "")] __description__ = """Simply-Debrid.com hook plugin""" diff --git a/module/plugins/hooks/UnrestrictLi.py b/module/plugins/hooks/UnrestrictLi.py index 28f0289c7..5184f5850 100644 --- a/module/plugins/hooks/UnrestrictLi.py +++ b/module/plugins/hooks/UnrestrictLi.py @@ -10,8 +10,7 @@ class UnrestrictLi(MultiHoster): __type__ = "hook" __version__ = "0.02" - __config__ = [("activated", "bool", "Activated", False), - ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), + __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("hosterList", "str", "Hoster list (comma separated)", ""), ("unloadFailing", "bool", "Revert to standard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 24), diff --git a/module/plugins/hooks/WindowsPhoneToastNotify.py b/module/plugins/hooks/WindowsPhoneToastNotify.py index cf7920b74..d33c2738a 100644 --- a/module/plugins/hooks/WindowsPhoneToastNotify.py +++ b/module/plugins/hooks/WindowsPhoneToastNotify.py @@ -11,8 +11,7 @@ class WindowsPhoneToastNotify(Hook): __type__ = "hook" __version__ = "0.02" - __config__ = [("activated", "bool", "Activated", False), - ("force", "bool", "Force even if client is connected", False), + __config__ = [("force", "bool", "Force even if client is connected", False), ("pushId", "str", "pushId", ""), ("pushUrl", "str", "pushUrl", ""), ("pushTimeout", "int", "Timeout between notifications in seconds", 0)] diff --git a/module/plugins/hooks/XMPPInterface.py b/module/plugins/hooks/XMPPInterface.py index 8a4e0e9d9..252aa820c 100644 --- a/module/plugins/hooks/XMPPInterface.py +++ b/module/plugins/hooks/XMPPInterface.py @@ -14,8 +14,7 @@ class XMPPInterface(IRCInterface, JabberClient): __type__ = "hook" __version__ = "0.11" - __config__ = [("activated", "bool", "Activated", False), - ("jid", "str", "Jabber ID", "user@exmaple-jabber-server.org"), + __config__ = [("jid", "str", "Jabber ID", "user@exmaple-jabber-server.org"), ("pw", "str", "Password", ""), ("tls", "bool", "Use TLS", False), ("owners", "str", "List of JIDs accepting commands from", "me@icq-gateway.org;some@msn-gateway.org"), diff --git a/module/plugins/hooks/ZeveraCom.py b/module/plugins/hooks/ZeveraCom.py index c474756a7..b7a9f56fd 100644 --- a/module/plugins/hooks/ZeveraCom.py +++ b/module/plugins/hooks/ZeveraCom.py @@ -9,8 +9,7 @@ class ZeveraCom(MultiHoster): __type__ = "hook" __version__ = "0.02" - __config__ = [("activated", "bool", "Activated", False), - ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), + __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("hosterList", "str", "Hoster list (comma separated)", "")] __description__ = """Real-Debrid.com hook plugin""" -- cgit v1.2.3 From 8b3589dd394d81177bf4680dddb5bdb9506b89ea Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Oct 2014 16:04:10 +0100 Subject: Update plugins to last changes --- module/plugins/hooks/Checksum.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index af9ff22a9..b19700206 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -140,7 +140,7 @@ class Checksum(Hook): if pyfile.plugin.retries < max_tries: if local_file: remove(local_file) - pyfile.plugin.retry(max_tries=max_tries, wait_time=self.getConfig("wait_time"), reason=msg) + pyfile.plugin.retry(max_tries, self.getConfig("wait_time"), msg) elif retry_action == "nothing": return elif check_action == "nothing": -- cgit v1.2.3 From 34984dae733c3f3d47b41a0acfba3724d53c65a1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Oct 2014 16:52:10 +0100 Subject: Code cosmetics: plugin class attributes --- module/plugins/hooks/AlldebridCom.py | 8 ++++---- module/plugins/hooks/BypassCaptcha.py | 12 ++++++------ module/plugins/hooks/Captcha9kw.py | 8 ++++---- module/plugins/hooks/CaptchaBrotherhood.py | 10 +++++----- module/plugins/hooks/Checksum.py | 12 ++++++------ module/plugins/hooks/ClickAndLoad.py | 10 +++++----- module/plugins/hooks/DeathByCaptcha.py | 10 +++++----- module/plugins/hooks/DebridItaliaCom.py | 8 ++++---- module/plugins/hooks/DeleteFinished.py | 8 ++++---- module/plugins/hooks/DownloadScheduler.py | 10 +++++----- module/plugins/hooks/EasybytezCom.py | 8 ++++---- module/plugins/hooks/ExpertDecoders.py | 10 +++++----- module/plugins/hooks/ExternalScripts.py | 14 +++++++------- module/plugins/hooks/ExtractArchive.py | 12 ++++++------ module/plugins/hooks/FastixRu.py | 8 ++++---- module/plugins/hooks/FreeWayMe.py | 8 ++++---- module/plugins/hooks/HotFolder.py | 8 ++++---- module/plugins/hooks/IRCInterface.py | 8 ++++---- module/plugins/hooks/ImageTyperz.py | 10 +++++----- module/plugins/hooks/LinkdecrypterCom.py | 8 ++++---- module/plugins/hooks/LinksnappyCom.py | 8 ++++---- module/plugins/hooks/MegaDebridEu.py | 8 ++++---- module/plugins/hooks/MergeFiles.py | 8 ++++---- module/plugins/hooks/MultiHome.py | 8 ++++---- module/plugins/hooks/MultishareCz.py | 8 ++++---- module/plugins/hooks/MyfastfileCom.py | 8 ++++---- module/plugins/hooks/OverLoadMe.py | 8 ++++---- module/plugins/hooks/PremiumTo.py | 12 ++++++------ module/plugins/hooks/PremiumizeMe.py | 8 ++++---- module/plugins/hooks/RPNetBiz.py | 8 ++++---- module/plugins/hooks/RealdebridCom.py | 8 ++++---- module/plugins/hooks/RehostTo.py | 8 ++++---- module/plugins/hooks/RestartFailed.py | 8 ++++---- module/plugins/hooks/SimplyPremiumCom.py | 8 ++++---- module/plugins/hooks/SimplydebridCom.py | 8 ++++---- module/plugins/hooks/UnSkipOnFail.py | 8 ++++---- module/plugins/hooks/UnrestrictLi.py | 8 ++++---- module/plugins/hooks/UpdateManager.py | 8 ++++---- module/plugins/hooks/WindowsPhoneToastNotify.py | 8 ++++---- module/plugins/hooks/XFileSharingPro.py | 10 +++++----- module/plugins/hooks/XMPPInterface.py | 8 ++++---- module/plugins/hooks/ZeveraCom.py | 8 ++++---- 42 files changed, 186 insertions(+), 186 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/AlldebridCom.py b/module/plugins/hooks/AlldebridCom.py index fda57ee0f..c06607a28 100644 --- a/module/plugins/hooks/AlldebridCom.py +++ b/module/plugins/hooks/AlldebridCom.py @@ -5,8 +5,8 @@ from module.plugins.internal.MultiHoster import MultiHoster class AlldebridCom(MultiHoster): - __name__ = "AlldebridCom" - __type__ = "hook" + __name__ = "AlldebridCom" + __type__ = "hook" __version__ = "0.13" __config__ = [("https", "bool", "Enable HTTPS", False), @@ -16,8 +16,8 @@ class AlldebridCom(MultiHoster): ("interval", "int", "Reload interval in hours (0 to disable)", 24)] __description__ = """Alldebrid.com hook plugin""" - __license__ = "GPLv3" - __authors__ = [("Andy Voigt", "spamsales@online.de")] + __license__ = "GPLv3" + __authors__ = [("Andy Voigt", "spamsales@online.de")] def getHoster(self): diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index 4150ed242..4e287668b 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -27,18 +27,18 @@ class BypassCaptchaException(Exception): class BypassCaptcha(Hook): - __name__ = "BypassCaptcha" - __type__ = "hook" + __name__ = "BypassCaptcha" + __type__ = "hook" __version__ = "0.04" __config__ = [("force", "bool", "Force BC even if client is connected", False), ("passkey", "password", "Passkey", "")] __description__ = """Send captchas to BypassCaptcha.com""" - __license__ = "GPLv3" - __authors__ = [("RaNaN", "RaNaN@pyload.org"), - ("Godofdream", "soilfcition@gmail.com"), - ("zoidberg", "zoidberg@mujmail.cz")] + __license__ = "GPLv3" + __authors__ = [("RaNaN", "RaNaN@pyload.org"), + ("Godofdream", "soilfcition@gmail.com"), + ("zoidberg", "zoidberg@mujmail.cz")] PYLOAD_KEY = "4f771155b640970d5607f919a615bdefc67e7d32" diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index 4ab163358..b8aa2fd78 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -13,8 +13,8 @@ from module.plugins.Hook import Hook class Captcha9kw(Hook): - __name__ = "Captcha9kw" - __type__ = "hook" + __name__ = "Captcha9kw" + __type__ = "hook" __version__ = "0.10" __config__ = [("force", "bool", "Force CT even if client is connected", True), @@ -29,8 +29,8 @@ class Captcha9kw(Hook): ("passkey", "password", "API key", "")] __description__ = """Send captchas to 9kw.eu""" - __license__ = "GPLv3" - __authors__ = [("RaNaN", "RaNaN@pyload.org")] + __license__ = "GPLv3" + __authors__ = [("RaNaN", "RaNaN@pyload.org")] API_URL = "://www.9kw.eu/index.cgi" diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py index 011968060..8033ad544 100644 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ b/module/plugins/hooks/CaptchaBrotherhood.py @@ -37,8 +37,8 @@ class CaptchaBrotherhoodException(Exception): class CaptchaBrotherhood(Hook): - __name__ = "CaptchaBrotherhood" - __type__ = "hook" + __name__ = "CaptchaBrotherhood" + __type__ = "hook" __version__ = "0.05" __config__ = [("username", "str", "Username", ""), @@ -46,9 +46,9 @@ class CaptchaBrotherhood(Hook): ("passkey", "password", "Password", "")] __description__ = """Send captchas to CaptchaBrotherhood.com""" - __license__ = "GPLv3" - __authors__ = [("RaNaN", "RaNaN@pyload.org"), - ("zoidberg", "zoidberg@mujmail.cz")] + __license__ = "GPLv3" + __authors__ = [("RaNaN", "RaNaN@pyload.org"), + ("zoidberg", "zoidberg@mujmail.cz")] API_URL = "http://www.captchabrotherhood.com/" diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index b19700206..fe2efdb41 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -38,8 +38,8 @@ def computeChecksum(local_file, algorithm): class Checksum(Hook): - __name__ = "Checksum" - __type__ = "hook" + __name__ = "Checksum" + __type__ = "hook" __version__ = "0.13" __config__ = [("check_checksum", "bool", "Check checksum? (If False only size will be verified)", True), @@ -49,10 +49,10 @@ class Checksum(Hook): ("wait_time", "int", "Time to wait before each retry (seconds)", 1)] __description__ = """Verify downloaded file size and checksum""" - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), - ("Walter Purcaro", "vuolter@gmail.com"), - ("stickell", "l.stickell@yahoo.it")] + __license__ = "GPLv3" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), + ("Walter Purcaro", "vuolter@gmail.com"), + ("stickell", "l.stickell@yahoo.it")] methods = {'sfv': 'crc32', 'crc': 'crc32', 'hash': 'md5'} diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py index 253f05ac5..c9c0f60c0 100644 --- a/module/plugins/hooks/ClickAndLoad.py +++ b/module/plugins/hooks/ClickAndLoad.py @@ -50,17 +50,17 @@ def forward(source, destination): class ClickAndLoad(Hook): - __name__ = "ClickAndLoad" - __type__ = "hook" + __name__ = "ClickAndLoad" + __type__ = "hook" __version__ = "0.22" __config__ = [("activated", "bool", "Activated", True), ("extern", "bool", "Allow external link adding", False)] __description__ = """Click'N'Load hook plugin""" - __license__ = "GPLv3" - __authors__ = [("RaNaN", "RaNaN@pyload.de"), - ("mkaay", "mkaay@mkaay.de")] + __license__ = "GPLv3" + __authors__ = [("RaNaN", "RaNaN@pyload.de"), + ("mkaay", "mkaay@mkaay.de")] def coreReady(self): diff --git a/module/plugins/hooks/DeathByCaptcha.py b/module/plugins/hooks/DeathByCaptcha.py index 97f55d826..0b584c632 100644 --- a/module/plugins/hooks/DeathByCaptcha.py +++ b/module/plugins/hooks/DeathByCaptcha.py @@ -50,8 +50,8 @@ class DeathByCaptchaException(Exception): class DeathByCaptcha(Hook): - __name__ = "DeathByCaptcha" - __type__ = "hook" + __name__ = "DeathByCaptcha" + __type__ = "hook" __version__ = "0.03" __config__ = [("username", "str", "Username", ""), @@ -59,9 +59,9 @@ class DeathByCaptcha(Hook): ("force", "bool", "Force DBC even if client is connected", False)] __description__ = """Send captchas to DeathByCaptcha.com""" - __license__ = "GPLv3" - __authors__ = [("RaNaN", "RaNaN@pyload.org"), - ("zoidberg", "zoidberg@mujmail.cz")] + __license__ = "GPLv3" + __authors__ = [("RaNaN", "RaNaN@pyload.org"), + ("zoidberg", "zoidberg@mujmail.cz")] API_URL = "http://api.dbcapi.me/api/" diff --git a/module/plugins/hooks/DebridItaliaCom.py b/module/plugins/hooks/DebridItaliaCom.py index dab496c37..86d37b3bd 100644 --- a/module/plugins/hooks/DebridItaliaCom.py +++ b/module/plugins/hooks/DebridItaliaCom.py @@ -4,8 +4,8 @@ from module.plugins.internal.MultiHoster import MultiHoster class DebridItaliaCom(MultiHoster): - __name__ = "DebridItaliaCom" - __type__ = "hook" + __name__ = "DebridItaliaCom" + __type__ = "hook" __version__ = "0.07" __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), @@ -14,8 +14,8 @@ class DebridItaliaCom(MultiHoster): ("interval", "int", "Reload interval in hours (0 to disable)", 24)] __description__ = """Debriditalia.com hook plugin""" - __license__ = "GPLv3" - __authors__ = [("stickell", "l.stickell@yahoo.it")] + __license__ = "GPLv3" + __authors__ = [("stickell", "l.stickell@yahoo.it")] def getHoster(self): diff --git a/module/plugins/hooks/DeleteFinished.py b/module/plugins/hooks/DeleteFinished.py index fe808e3af..b68e68679 100644 --- a/module/plugins/hooks/DeleteFinished.py +++ b/module/plugins/hooks/DeleteFinished.py @@ -5,8 +5,8 @@ from module.plugins.Hook import Hook class DeleteFinished(Hook): - __name__ = "DeleteFinished" - __type__ = "hook" + __name__ = "DeleteFinished" + __type__ = "hook" __version__ = "1.10" __config__ = [('activated', 'bool', 'Activated', 'False'), @@ -14,8 +14,8 @@ class DeleteFinished(Hook): ('deloffline', 'bool', 'Delete packages with offline links', 'False')] __description__ = """Automatically delete all finished packages from queue""" - __license__ = "GPLv3" - __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + __license__ = "GPLv3" + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] event_list = ["pluginConfigChanged"] diff --git a/module/plugins/hooks/DownloadScheduler.py b/module/plugins/hooks/DownloadScheduler.py index d0095306c..14884426f 100644 --- a/module/plugins/hooks/DownloadScheduler.py +++ b/module/plugins/hooks/DownloadScheduler.py @@ -8,8 +8,8 @@ from module.plugins.Hook import Hook class DownloadScheduler(Hook): - __name__ = "DownloadScheduler" - __type__ = "hook" + __name__ = "DownloadScheduler" + __type__ = "hook" __version__ = "0.21" __config__ = [("timetable", "str", "List time periods as hh:mm full or number(kB/s)", @@ -17,9 +17,9 @@ class DownloadScheduler(Hook): ("abort", "bool", "Abort active downloads when start period with speed 0", False)] __description__ = """Download Scheduler""" - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), - ("stickell", "l.stickell@yahoo.it")] + __license__ = "GPLv3" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), + ("stickell", "l.stickell@yahoo.it")] def setup(self): diff --git a/module/plugins/hooks/EasybytezCom.py b/module/plugins/hooks/EasybytezCom.py index 305b32de3..89deaed2b 100644 --- a/module/plugins/hooks/EasybytezCom.py +++ b/module/plugins/hooks/EasybytezCom.py @@ -6,16 +6,16 @@ from module.plugins.internal.MultiHoster import MultiHoster class EasybytezCom(MultiHoster): - __name__ = "EasybytezCom" - __type__ = "hook" + __name__ = "EasybytezCom" + __type__ = "hook" __version__ = "0.03" __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("hosterList", "str", "Hoster list (comma separated)", "")] __description__ = """EasyBytez.com hook plugin""" - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] + __license__ = "GPLv3" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] def getHoster(self): diff --git a/module/plugins/hooks/ExpertDecoders.py b/module/plugins/hooks/ExpertDecoders.py index 84d6b8597..a4ae6fa89 100644 --- a/module/plugins/hooks/ExpertDecoders.py +++ b/module/plugins/hooks/ExpertDecoders.py @@ -13,17 +13,17 @@ from module.plugins.Hook import Hook class ExpertDecoders(Hook): - __name__ = "ExpertDecoders" - __type__ = "hook" + __name__ = "ExpertDecoders" + __type__ = "hook" __version__ = "0.01" __config__ = [("force", "bool", "Force CT even if client is connected", False), ("passkey", "password", "Access key", "")] __description__ = """Send captchas to expertdecoders.com""" - __license__ = "GPLv3" - __authors__ = [("RaNaN", "RaNaN@pyload.org"), - ("zoidberg", "zoidberg@mujmail.cz")] + __license__ = "GPLv3" + __authors__ = [("RaNaN", "RaNaN@pyload.org"), + ("zoidberg", "zoidberg@mujmail.cz")] API_URL = "http://www.fasttypers.org/imagepost.ashx" diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index 55182cf84..5db2037fa 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -11,18 +11,18 @@ from module.utils import save_join class ExternalScripts(Hook): - __name__ = "ExternalScripts" - __type__ = "hook" + __name__ = "ExternalScripts" + __type__ = "hook" __version__ = "0.24" __config__ = [("activated", "bool", "Activated", True)] __description__ = """Run external scripts""" - __license__ = "GPLv3" - __authors__ = [("mkaay", "mkaay@mkaay.de"), - ("RaNaN", "ranan@pyload.org"), - ("spoob", "spoob@pyload.org"), - ("Walter Purcaro", "vuolter@gmail.com")] + __license__ = "GPLv3" + __authors__ = [("mkaay", "mkaay@mkaay.de"), + ("RaNaN", "ranan@pyload.org"), + ("spoob", "spoob@pyload.org"), + ("Walter Purcaro", "vuolter@gmail.com")] event_list = ["archive_extracted", "package_extracted", "all_archives_extracted", "all_archives_processed", diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 4a4f2d4d8..3d6df5b02 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -55,8 +55,8 @@ from module.utils import save_join, fs_encode class ExtractArchive(Hook): - __name__ = "ExtractArchive" - __type__ = "hook" + __name__ = "ExtractArchive" + __type__ = "hook" __version__ = "0.17" __config__ = [("activated", "bool", "Activated", True), @@ -72,10 +72,10 @@ class ExtractArchive(Hook): ("renice", "int", "CPU Priority", 0)] __description__ = """Extract different kind of archives""" - __license__ = "GPLv3" - __authors__ = [("RaNaN", "ranan@pyload.org"), - ("AndroKev", None), - ("Walter Purcaro", "vuolter@gmail.com")] + __license__ = "GPLv3" + __authors__ = [("RaNaN", "ranan@pyload.org"), + ("AndroKev", None), + ("Walter Purcaro", "vuolter@gmail.com")] event_list = ["allDownloadsProcessed"] diff --git a/module/plugins/hooks/FastixRu.py b/module/plugins/hooks/FastixRu.py index 4be38dad3..fe89a190c 100644 --- a/module/plugins/hooks/FastixRu.py +++ b/module/plugins/hooks/FastixRu.py @@ -6,8 +6,8 @@ from module.plugins.internal.MultiHoster import MultiHoster class FastixRu(MultiHoster): - __name__ = "FastixRu" - __type__ = "hook" + __name__ = "FastixRu" + __type__ = "hook" __version__ = "0.02" __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), @@ -15,8 +15,8 @@ class FastixRu(MultiHoster): ("interval", "int", "Reload interval in hours (0 to disable)", 24)] __description__ = """Fastix.ru hook plugin""" - __license__ = "GPLv3" - __authors__ = [("Massimo Rosamilia", "max@spiritix.eu")] + __license__ = "GPLv3" + __authors__ = [("Massimo Rosamilia", "max@spiritix.eu")] def getHoster(self): diff --git a/module/plugins/hooks/FreeWayMe.py b/module/plugins/hooks/FreeWayMe.py index 6019a1c35..1d7dd369e 100644 --- a/module/plugins/hooks/FreeWayMe.py +++ b/module/plugins/hooks/FreeWayMe.py @@ -5,8 +5,8 @@ from module.plugins.internal.MultiHoster import MultiHoster class FreeWayMe(MultiHoster): - __name__ = "FreeWayMe" - __type__ = "hook" + __name__ = "FreeWayMe" + __type__ = "hook" __version__ = "0.11" __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), @@ -15,8 +15,8 @@ class FreeWayMe(MultiHoster): ("interval", "int", "Reload interval in hours (0 to disable)", 24)] __description__ = """FreeWay.me hook plugin""" - __license__ = "GPLv3" - __authors__ = [("Nicolas Giese", "james@free-way.me")] + __license__ = "GPLv3" + __authors__ = [("Nicolas Giese", "james@free-way.me")] def getHoster(self): diff --git a/module/plugins/hooks/HotFolder.py b/module/plugins/hooks/HotFolder.py index 00eac266c..d7e8093b3 100644 --- a/module/plugins/hooks/HotFolder.py +++ b/module/plugins/hooks/HotFolder.py @@ -10,8 +10,8 @@ from module.plugins.Hook import Hook class HotFolder(Hook): - __name__ = "HotFolder" - __type__ = "hook" + __name__ = "HotFolder" + __type__ = "hook" __version__ = "0.11" __config__ = [("folder", "str", "Folder to observe", "container"), @@ -20,8 +20,8 @@ class HotFolder(Hook): ("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")] + __license__ = "GPLv3" + __authors__ = [("RaNaN", "RaNaN@pyload.de")] def setup(self): diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index bc99d708b..5ff24cc79 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -17,8 +17,8 @@ from module.utils import formatSize class IRCInterface(Thread, Hook): - __name__ = "IRCInterface" - __type__ = "hook" + __name__ = "IRCInterface" + __type__ = "hook" __version__ = "0.11" __config__ = [("host", "str", "IRC-Server Address", "Enter your server here!"), @@ -32,8 +32,8 @@ class IRCInterface(Thread, Hook): ("captcha", "bool", "Send captcha requests", True)] __description__ = """Connect to irc and let owner perform different tasks""" - __license__ = "GPLv3" - __authors__ = [("Jeix", "Jeix@hasnomail.com")] + __license__ = "GPLv3" + __authors__ = [("Jeix", "Jeix@hasnomail.com")] def __init__(self, core, manager): diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py index baa62ce31..c0a573c5c 100644 --- a/module/plugins/hooks/ImageTyperz.py +++ b/module/plugins/hooks/ImageTyperz.py @@ -31,8 +31,8 @@ class ImageTyperzException(Exception): class ImageTyperz(Hook): - __name__ = "ImageTyperz" - __type__ = "hook" + __name__ = "ImageTyperz" + __type__ = "hook" __version__ = "0.04" __config__ = [("username", "str", "Username", ""), @@ -40,9 +40,9 @@ class ImageTyperz(Hook): ("force", "bool", "Force IT even if client is connected", False)] __description__ = """Send captchas to ImageTyperz.com""" - __license__ = "GPLv3" - __authors__ = [("RaNaN", "RaNaN@pyload.org"), - ("zoidberg", "zoidberg@mujmail.cz")] + __license__ = "GPLv3" + __authors__ = [("RaNaN", "RaNaN@pyload.org"), + ("zoidberg", "zoidberg@mujmail.cz")] SUBMIT_URL = "http://captchatypers.com/Forms/UploadFileAndGetTextNEW.ashx" diff --git a/module/plugins/hooks/LinkdecrypterCom.py b/module/plugins/hooks/LinkdecrypterCom.py index 0a6974584..9343208de 100644 --- a/module/plugins/hooks/LinkdecrypterCom.py +++ b/module/plugins/hooks/LinkdecrypterCom.py @@ -8,13 +8,13 @@ from module.utils import remove_chars class LinkdecrypterCom(Hook): - __name__ = "LinkdecrypterCom" - __type__ = "hook" + __name__ = "LinkdecrypterCom" + __type__ = "hook" __version__ = "0.19" __description__ = """Linkdecrypter.com hook plugin""" - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] + __license__ = "GPLv3" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] def coreReady(self): diff --git a/module/plugins/hooks/LinksnappyCom.py b/module/plugins/hooks/LinksnappyCom.py index 771ab2d62..aa130f416 100644 --- a/module/plugins/hooks/LinksnappyCom.py +++ b/module/plugins/hooks/LinksnappyCom.py @@ -6,8 +6,8 @@ from module.plugins.internal.MultiHoster import MultiHoster class LinksnappyCom(MultiHoster): - __name__ = "LinksnappyCom" - __type__ = "hook" + __name__ = "LinksnappyCom" + __type__ = "hook" __version__ = "0.01" __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), @@ -16,8 +16,8 @@ class LinksnappyCom(MultiHoster): ("interval", "int", "Reload interval in hours (0 to disable)", 24)] __description__ = """Linksnappy.com hook plugin""" - __license__ = "GPLv3" - __authors__ = [("stickell", "l.stickell@yahoo.it")] + __license__ = "GPLv3" + __authors__ = [("stickell", "l.stickell@yahoo.it")] def getHoster(self): diff --git a/module/plugins/hooks/MegaDebridEu.py b/module/plugins/hooks/MegaDebridEu.py index 11cfa0824..d8e338aec 100644 --- a/module/plugins/hooks/MegaDebridEu.py +++ b/module/plugins/hooks/MegaDebridEu.py @@ -6,15 +6,15 @@ from module.plugins.internal.MultiHoster import MultiHoster class MegaDebridEu(MultiHoster): - __name__ = "MegaDebridEu" - __type__ = "hook" + __name__ = "MegaDebridEu" + __type__ = "hook" __version__ = "0.02" __config__ = [("unloadFailing", "bool", "Revert to standard download if download fails", False)] __description__ = """mega-debrid.eu hook plugin""" - __license__ = "GPLv3" - __authors__ = [("D.Ducatel", "dducatel@je-geek.fr")] + __license__ = "GPLv3" + __authors__ = [("D.Ducatel", "dducatel@je-geek.fr")] def getHoster(self): diff --git a/module/plugins/hooks/MergeFiles.py b/module/plugins/hooks/MergeFiles.py index b61857189..e6f8bb26f 100644 --- a/module/plugins/hooks/MergeFiles.py +++ b/module/plugins/hooks/MergeFiles.py @@ -10,15 +10,15 @@ from module.utils import save_join, fs_encode class MergeFiles(Hook): - __name__ = "MergeFiles" - __type__ = "hook" + __name__ = "MergeFiles" + __type__ = "hook" __version__ = "0.12" __config__ = [("activated", "bool", "Activated", True)] __description__ = """Merges parts splitted with hjsplit""" - __license__ = "GPLv3" - __authors__ = [("and9000", "me@has-no-mail.com")] + __license__ = "GPLv3" + __authors__ = [("and9000", "me@has-no-mail.com")] BUFFER_SIZE = 4096 diff --git a/module/plugins/hooks/MultiHome.py b/module/plugins/hooks/MultiHome.py index d71e5800a..228e6027d 100644 --- a/module/plugins/hooks/MultiHome.py +++ b/module/plugins/hooks/MultiHome.py @@ -6,15 +6,15 @@ from module.plugins.Hook import Hook class MultiHome(Hook): - __name__ = "MultiHome" - __type__ = "hook" + __name__ = "MultiHome" + __type__ = "hook" __version__ = "0.11" __config__ = [("interfaces", "str", "Interfaces", "None")] __description__ = """Ip address changer""" - __license__ = "GPLv3" - __authors__ = [("mkaay", "mkaay@mkaay.de")] + __license__ = "GPLv3" + __authors__ = [("mkaay", "mkaay@mkaay.de")] def setup(self): diff --git a/module/plugins/hooks/MultishareCz.py b/module/plugins/hooks/MultishareCz.py index e53932b14..0e651393d 100644 --- a/module/plugins/hooks/MultishareCz.py +++ b/module/plugins/hooks/MultishareCz.py @@ -7,16 +7,16 @@ from module.plugins.internal.MultiHoster import MultiHoster class MultishareCz(MultiHoster): - __name__ = "MultishareCz" - __type__ = "hook" + __name__ = "MultishareCz" + __type__ = "hook" __version__ = "0.04" __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("hosterList", "str", "Hoster list (comma separated)", "uloz.to")] __description__ = """MultiShare.cz hook plugin""" - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] + __license__ = "GPLv3" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] HOSTER_PATTERN = r']*?alt="([^"]+)">\s*[^>]*?alt="OK"' diff --git a/module/plugins/hooks/MyfastfileCom.py b/module/plugins/hooks/MyfastfileCom.py index a95dd2ac8..07731f1c2 100644 --- a/module/plugins/hooks/MyfastfileCom.py +++ b/module/plugins/hooks/MyfastfileCom.py @@ -6,8 +6,8 @@ from module.plugins.internal.MultiHoster import MultiHoster class MyfastfileCom(MultiHoster): - __name__ = "MyfastfileCom" - __type__ = "hook" + __name__ = "MyfastfileCom" + __type__ = "hook" __version__ = "0.02" __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), @@ -16,8 +16,8 @@ class MyfastfileCom(MultiHoster): ("interval", "int", "Reload interval in hours (0 to disable)", 24)] __description__ = """Myfastfile.com hook plugin""" - __license__ = "GPLv3" - __authors__ = [("stickell", "l.stickell@yahoo.it")] + __license__ = "GPLv3" + __authors__ = [("stickell", "l.stickell@yahoo.it")] def getHoster(self): diff --git a/module/plugins/hooks/OverLoadMe.py b/module/plugins/hooks/OverLoadMe.py index 2fcd132a2..f4cbdd7fe 100644 --- a/module/plugins/hooks/OverLoadMe.py +++ b/module/plugins/hooks/OverLoadMe.py @@ -5,8 +5,8 @@ from module.plugins.internal.MultiHoster import MultiHoster class OverLoadMe(MultiHoster): - __name__ = "OverLoadMe" - __type__ = "hook" + __name__ = "OverLoadMe" + __type__ = "hook" __version__ = "0.01" __config__ = [("https", "bool", "Enable HTTPS", True), @@ -16,8 +16,8 @@ class OverLoadMe(MultiHoster): ("interval", "int", "Reload interval in hours (0 to disable)", 12)] __description__ = """Over-Load.me hook plugin""" - __license__ = "GPLv3" - __authors__ = [("marley", "marley@over-load.me")] + __license__ = "GPLv3" + __authors__ = [("marley", "marley@over-load.me")] def getHoster(self): diff --git a/module/plugins/hooks/PremiumTo.py b/module/plugins/hooks/PremiumTo.py index d9f80f263..7be46945f 100644 --- a/module/plugins/hooks/PremiumTo.py +++ b/module/plugins/hooks/PremiumTo.py @@ -5,18 +5,18 @@ from module.plugins.internal.MultiHoster import MultiHoster class PremiumTo(MultiHoster): - __name__ = "PremiumTo" - __type__ = "hook" + __name__ = "PremiumTo" + __type__ = "hook" __version__ = "0.04" __config__ = [("hosterListMode", "all;listed;unlisted", "Use for downloads from supported hosters:", "all"), ("hosterList", "str", "Hoster list (comma separated)", "")] __description__ = """Premium.to hook plugin""" - __license__ = "GPLv3" - __authors__ = [("RaNaN", "RaNaN@pyload.org"), - ("zoidberg", "zoidberg@mujmail.cz"), - ("stickell", "l.stickell@yahoo.it")] + __license__ = "GPLv3" + __authors__ = [("RaNaN", "RaNaN@pyload.org"), + ("zoidberg", "zoidberg@mujmail.cz"), + ("stickell", "l.stickell@yahoo.it")] def getHoster(self): diff --git a/module/plugins/hooks/PremiumizeMe.py b/module/plugins/hooks/PremiumizeMe.py index f55efc6bd..ec21fbcb4 100644 --- a/module/plugins/hooks/PremiumizeMe.py +++ b/module/plugins/hooks/PremiumizeMe.py @@ -6,8 +6,8 @@ from module.plugins.internal.MultiHoster import MultiHoster class PremiumizeMe(MultiHoster): - __name__ = "PremiumizeMe" - __type__ = "hook" + __name__ = "PremiumizeMe" + __type__ = "hook" __version__ = "0.12" __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), @@ -16,8 +16,8 @@ class PremiumizeMe(MultiHoster): ("interval", "int", "Reload interval in hours (0 to disable)", 24)] __description__ = """Premiumize.me hook plugin""" - __license__ = "GPLv3" - __authors__ = [("Florian Franzen", "FlorianFranzen@gmail.com")] + __license__ = "GPLv3" + __authors__ = [("Florian Franzen", "FlorianFranzen@gmail.com")] def getHoster(self): diff --git a/module/plugins/hooks/RPNetBiz.py b/module/plugins/hooks/RPNetBiz.py index 7ade16a24..94c7dbff7 100644 --- a/module/plugins/hooks/RPNetBiz.py +++ b/module/plugins/hooks/RPNetBiz.py @@ -6,8 +6,8 @@ from module.plugins.internal.MultiHoster import MultiHoster class RPNetBiz(MultiHoster): - __name__ = "RPNetBiz" - __type__ = "hook" + __name__ = "RPNetBiz" + __type__ = "hook" __version__ = "0.1" __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), @@ -16,8 +16,8 @@ class RPNetBiz(MultiHoster): ("interval", "int", "Reload interval in hours (0 to disable)", 24)] __description__ = """RPNet.biz hook plugin""" - __license__ = "GPLv3" - __authors__ = [("Dman", "dmanugm@gmail.com")] + __license__ = "GPLv3" + __authors__ = [("Dman", "dmanugm@gmail.com")] def getHoster(self): diff --git a/module/plugins/hooks/RealdebridCom.py b/module/plugins/hooks/RealdebridCom.py index 4ea37dda7..50cc81f0c 100644 --- a/module/plugins/hooks/RealdebridCom.py +++ b/module/plugins/hooks/RealdebridCom.py @@ -5,8 +5,8 @@ from module.plugins.internal.MultiHoster import MultiHoster class RealdebridCom(MultiHoster): - __name__ = "RealdebridCom" - __type__ = "hook" + __name__ = "RealdebridCom" + __type__ = "hook" __version__ = "0.43" __config__ = [("https", "bool", "Enable HTTPS", False), @@ -16,8 +16,8 @@ class RealdebridCom(MultiHoster): ("interval", "int", "Reload interval in hours (0 to disable)", 24)] __description__ = """Real-Debrid.com hook plugin""" - __license__ = "GPLv3" - __authors__ = [("Devirex Hazzard", "naibaf_11@yahoo.de")] + __license__ = "GPLv3" + __authors__ = [("Devirex Hazzard", "naibaf_11@yahoo.de")] def getHoster(self): diff --git a/module/plugins/hooks/RehostTo.py b/module/plugins/hooks/RehostTo.py index 52a96855e..c58abf3f3 100644 --- a/module/plugins/hooks/RehostTo.py +++ b/module/plugins/hooks/RehostTo.py @@ -5,8 +5,8 @@ from module.plugins.internal.MultiHoster import MultiHoster class RehostTo(MultiHoster): - __name__ = "RehostTo" - __type__ = "hook" + __name__ = "RehostTo" + __type__ = "hook" __version__ = "0.43" __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), @@ -15,8 +15,8 @@ class RehostTo(MultiHoster): ("interval", "int", "Reload interval in hours (0 to disable)", 24)] __description__ = """Rehost.to hook plugin""" - __license__ = "GPLv3" - __authors__ = [("RaNaN", "RaNaN@pyload.org")] + __license__ = "GPLv3" + __authors__ = [("RaNaN", "RaNaN@pyload.org")] def getHoster(self): diff --git a/module/plugins/hooks/RestartFailed.py b/module/plugins/hooks/RestartFailed.py index 1c2cd1002..4c48c7077 100644 --- a/module/plugins/hooks/RestartFailed.py +++ b/module/plugins/hooks/RestartFailed.py @@ -4,15 +4,15 @@ from module.plugins.Hook import Hook class RestartFailed(Hook): - __name__ = "RestartFailed" - __type__ = "hook" + __name__ = "RestartFailed" + __type__ = "hook" __version__ = "1.55" __config__ = [("interval", "int", "Check interval in minutes", 90)] __description__ = """Periodically restart all failed downloads in queue""" - __license__ = "GPLv3" - __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + __license__ = "GPLv3" + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] event_list = ["pluginConfigChanged"] diff --git a/module/plugins/hooks/SimplyPremiumCom.py b/module/plugins/hooks/SimplyPremiumCom.py index 3a2586b94..ba0543691 100644 --- a/module/plugins/hooks/SimplyPremiumCom.py +++ b/module/plugins/hooks/SimplyPremiumCom.py @@ -6,8 +6,8 @@ from module.plugins.internal.MultiHoster import MultiHoster class SimplyPremiumCom(MultiHoster): - __name__ = "SimplyPremiumCom" - __type__ = "hook" + __name__ = "SimplyPremiumCom" + __type__ = "hook" __version__ = "0.02" __config__ = [("activated", "bool", "Activated", "False"), @@ -17,8 +17,8 @@ class SimplyPremiumCom(MultiHoster): ("interval", "int", "Reload interval in hours (0 to disable)", "24")] __description__ = """Simply-Premium.com hook plugin""" - __license__ = "GPLv3" - __authors__ = [("EvolutionClip", "evolutionclip@live.de")] + __license__ = "GPLv3" + __authors__ = [("EvolutionClip", "evolutionclip@live.de")] def getHoster(self): diff --git a/module/plugins/hooks/SimplydebridCom.py b/module/plugins/hooks/SimplydebridCom.py index 0e4c045fd..3fbc0459c 100644 --- a/module/plugins/hooks/SimplydebridCom.py +++ b/module/plugins/hooks/SimplydebridCom.py @@ -5,16 +5,16 @@ from module.plugins.internal.MultiHoster import MultiHoster class SimplydebridCom(MultiHoster): - __name__ = "SimplydebridCom" - __type__ = "hook" + __name__ = "SimplydebridCom" + __type__ = "hook" __version__ = "0.01" __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("hosterList", "str", "Hoster list (comma separated)", "")] __description__ = """Simply-Debrid.com hook plugin""" - __license__ = "GPLv3" - __authors__ = [("Kagenoshin", "kagenoshin@gmx.ch")] + __license__ = "GPLv3" + __authors__ = [("Kagenoshin", "kagenoshin@gmx.ch")] def getHoster(self): diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index e3c0f6af9..f97d12431 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -8,15 +8,15 @@ from module.utils import fs_encode class UnSkipOnFail(Hook): - __name__ = "UnSkipOnFail" - __type__ = "hook" + __name__ = "UnSkipOnFail" + __type__ = "hook" __version__ = "0.01" __config__ = [("activated", "bool", "Activated", True)] __description__ = """When a download fails, restart skipped duplicates""" - __license__ = "GPLv3" - __authors__ = [("hagg", None)] + __license__ = "GPLv3" + __authors__ = [("hagg", None)] def downloadFailed(self, pyfile): diff --git a/module/plugins/hooks/UnrestrictLi.py b/module/plugins/hooks/UnrestrictLi.py index 5184f5850..295cfaf5a 100644 --- a/module/plugins/hooks/UnrestrictLi.py +++ b/module/plugins/hooks/UnrestrictLi.py @@ -6,8 +6,8 @@ from module.plugins.internal.MultiHoster import MultiHoster class UnrestrictLi(MultiHoster): - __name__ = "UnrestrictLi" - __type__ = "hook" + __name__ = "UnrestrictLi" + __type__ = "hook" __version__ = "0.02" __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), @@ -17,8 +17,8 @@ class UnrestrictLi(MultiHoster): ("history", "bool", "Delete History", False)] __description__ = """Unrestrict.li hook plugin""" - __license__ = "GPLv3" - __authors__ = [("stickell", "l.stickell@yahoo.it")] + __license__ = "GPLv3" + __authors__ = [("stickell", "l.stickell@yahoo.it")] def getHoster(self): diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index d5fb43ddc..e55c0e104 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -12,8 +12,8 @@ from module.utils import save_join class UpdateManager(Hook): - __name__ = "UpdateManager" - __type__ = "hook" + __name__ = "UpdateManager" + __type__ = "hook" __version__ = "0.36" __config__ = [("activated", "bool", "Activated", True), @@ -23,8 +23,8 @@ class UpdateManager(Hook): ("nodebugupdate", "bool", "Don't check for updates in debug mode", True)] __description__ = """ Check for updates """ - __license__ = "GPLv3" - __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + __license__ = "GPLv3" + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] event_list = ["pluginConfigChanged"] diff --git a/module/plugins/hooks/WindowsPhoneToastNotify.py b/module/plugins/hooks/WindowsPhoneToastNotify.py index d33c2738a..746aa188d 100644 --- a/module/plugins/hooks/WindowsPhoneToastNotify.py +++ b/module/plugins/hooks/WindowsPhoneToastNotify.py @@ -7,8 +7,8 @@ from module.plugins.Hook import Hook class WindowsPhoneToastNotify(Hook): - __name__ = "WindowsPhoneToastNotify" - __type__ = "hook" + __name__ = "WindowsPhoneToastNotify" + __type__ = "hook" __version__ = "0.02" __config__ = [("force", "bool", "Force even if client is connected", False), @@ -17,8 +17,8 @@ class WindowsPhoneToastNotify(Hook): ("pushTimeout", "int", "Timeout between notifications in seconds", 0)] __description__ = """Send push notifications to Windows Phone""" - __license__ = "GPLv3" - __authors__ = [("Andy Voigt", "phone-support@hotmail.de")] + __license__ = "GPLv3" + __authors__ = [("Andy Voigt", "phone-support@hotmail.de")] def setup(self): diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 691af8d4c..0259cbee7 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -6,8 +6,8 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): - __name__ = "XFileSharingPro" - __type__ = "hook" + __name__ = "XFileSharingPro" + __type__ = "hook" __version__ = "0.19" __config__ = [("activated", "bool", "Activated", True), @@ -20,9 +20,9 @@ class XFileSharingPro(Hook): ("exclude_crypters", "str", "Exclude crypters (comma separated)", "")] __description__ = """Load hosters and crypter, based upon XFileSharingPro, which don't need a own plugin to work fine""" - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), - ("Walter Purcaro", "vuolter@gmail.com")] + __license__ = "GPLv3" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), + ("Walter Purcaro", "vuolter@gmail.com")] event_list = ["pluginConfigChanged"] diff --git a/module/plugins/hooks/XMPPInterface.py b/module/plugins/hooks/XMPPInterface.py index 252aa820c..e23398023 100644 --- a/module/plugins/hooks/XMPPInterface.py +++ b/module/plugins/hooks/XMPPInterface.py @@ -10,8 +10,8 @@ from module.plugins.hooks.IRCInterface import IRCInterface class XMPPInterface(IRCInterface, JabberClient): - __name__ = "XMPPInterface" - __type__ = "hook" + __name__ = "XMPPInterface" + __type__ = "hook" __version__ = "0.11" __config__ = [("jid", "str", "Jabber ID", "user@exmaple-jabber-server.org"), @@ -23,8 +23,8 @@ class XMPPInterface(IRCInterface, JabberClient): ("captcha", "bool", "Send captcha requests", True)] __description__ = """Connect to jabber and let owner perform different tasks""" - __license__ = "GPLv3" - __authors__ = [("RaNaN", "RaNaN@pyload.org")] + __license__ = "GPLv3" + __authors__ = [("RaNaN", "RaNaN@pyload.org")] implements(IMessageHandlersProvider) diff --git a/module/plugins/hooks/ZeveraCom.py b/module/plugins/hooks/ZeveraCom.py index b7a9f56fd..6ea05de4f 100644 --- a/module/plugins/hooks/ZeveraCom.py +++ b/module/plugins/hooks/ZeveraCom.py @@ -5,16 +5,16 @@ from module.plugins.internal.MultiHoster import MultiHoster class ZeveraCom(MultiHoster): - __name__ = "ZeveraCom" - __type__ = "hook" + __name__ = "ZeveraCom" + __type__ = "hook" __version__ = "0.02" __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("hosterList", "str", "Hoster list (comma separated)", "")] __description__ = """Real-Debrid.com hook plugin""" - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] + __license__ = "GPLv3" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] def getHoster(self): -- cgit v1.2.3 From 2b8bfcfed0dd32b79a8a3ba95cb84adb5ab22811 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Oct 2014 17:40:39 +0100 Subject: Code cosmetics: use self.core.api instead self.api (for now) --- module/plugins/hooks/IRCInterface.py | 32 +++++++++++++++----------------- module/plugins/hooks/RestartFailed.py | 3 +-- 2 files changed, 16 insertions(+), 19 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index 5ff24cc79..4bf2c7866 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -40,8 +40,6 @@ class IRCInterface(Thread, Hook): Thread.__init__(self) Hook.__init__(self, core, manager) self.setDaemon(True) - # self.sm = core.server_methods - self.api = core.api # todo, only use api def coreReady(self): @@ -201,7 +199,7 @@ class IRCInterface(Thread, Hook): def event_status(self, args): - downloads = self.api.statusDownloads() + downloads = self.core.api.statusDownloads() if not downloads: return ["INFO: There are no active downloads currently."] @@ -227,7 +225,7 @@ class IRCInterface(Thread, Hook): def event_queue(self, args): - ps = self.api.getQueueData() + ps = self.core.api.getQueueData() if not ps: return ["INFO: There are no packages in queue."] @@ -240,7 +238,7 @@ class IRCInterface(Thread, Hook): def event_collector(self, args): - ps = self.api.getCollectorData() + ps = self.core.api.getCollectorData() if not ps: return ["INFO: No packages in collector!"] @@ -257,7 +255,7 @@ class IRCInterface(Thread, Hook): info = None try: - info = self.api.getFileData(int(args[0])) + info = self.core.api.getFileData(int(args[0])) except FileDoesNotExists: return ["ERROR: Link doesn't exists."] @@ -272,7 +270,7 @@ class IRCInterface(Thread, Hook): lines = [] pack = None try: - pack = self.api.getPackageData(int(args[0])) + pack = self.core.api.getPackageData(int(args[0])) except PackageDoesNotExists: return ["ERROR: Package doesn't exists."] @@ -309,12 +307,12 @@ class IRCInterface(Thread, Hook): def event_start(self, args): - self.api.unpauseServer() + self.core.api.unpauseServer() return ["INFO: Starting downloads."] def event_stop(self, args): - self.api.pauseServer() + self.core.api.pauseServer() return ["INFO: No new downloads will be started."] @@ -330,7 +328,7 @@ class IRCInterface(Thread, Hook): count_failed = 0 try: id = int(pack) - pack = self.api.getPackageData(id) + pack = self.core.api.getPackageData(id) if not pack: return ["ERROR: Package doesn't exists."] @@ -340,7 +338,7 @@ class IRCInterface(Thread, Hook): except: # create new package - id = self.api.addPackage(pack, links, 1) + id = self.core.api.addPackage(pack, links, 1) return ["INFO: Created new Package %s [#%d] with %d links." % (pack, id, len(links))] @@ -349,11 +347,11 @@ class IRCInterface(Thread, Hook): return ["ERROR: Use del command like this: del -p|-l [...] (-p indicates that the ids are from packages, -l indicates that the ids are from links)"] if args[0] == "-p": - ret = self.api.deletePackages(map(int, args[1:])) + ret = self.core.api.deletePackages(map(int, args[1:])) return ["INFO: Deleted %d packages!" % len(args[1:])] elif args[0] == "-l": - ret = self.api.delLinks(map(int, args[1:])) + ret = self.core.api.delLinks(map(int, args[1:])) return ["INFO: Deleted %d links!" % len(args[1:])] else: @@ -366,11 +364,11 @@ class IRCInterface(Thread, Hook): id = int(args[0]) try: - info = self.api.getPackageInfo(id) + info = self.core.api.getPackageInfo(id) except PackageDoesNotExists: return ["ERROR: Package #%d does not exist." % id] - self.api.pushToQueue(id) + self.core.api.pushToQueue(id) return ["INFO: Pushed package #%d to queue." % id] @@ -379,10 +377,10 @@ class IRCInterface(Thread, Hook): return ["ERROR: Pull package from queue like this: pull ."] id = int(args[0]) - if not self.api.getPackageData(id): + if not self.core.api.getPackageData(id): return ["ERROR: Package #%d does not exist." % id] - self.api.pullFromQueue(id) + self.core.api.pullFromQueue(id) return ["INFO: Pulled package #%d from queue to collector." % id] diff --git a/module/plugins/hooks/RestartFailed.py b/module/plugins/hooks/RestartFailed.py index 4c48c7077..81a83e2c9 100644 --- a/module/plugins/hooks/RestartFailed.py +++ b/module/plugins/hooks/RestartFailed.py @@ -33,11 +33,10 @@ class RestartFailed(Hook): def periodical(self): self.logInfo(_("Restart failed downloads")) - self.api.restartFailed() + self.core.api.restartFailed() def setup(self): - self.api = self.core.api self.interval = self.MIN_INTERVAL -- cgit v1.2.3 From 57ac823aabc7d58771bd6c215e6ed1f44098199c Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 30 Oct 2014 17:19:33 +0100 Subject: [XFileSharingPro] Massive cleanup for hook plugin --- module/plugins/hooks/XFileSharingPro.py | 79 +++++++++++++-------------------- 1 file changed, 30 insertions(+), 49 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 0259cbee7..3c35adedb 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,28 +8,29 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.19" + __version__ = "0.20" __config__ = [("activated", "bool", "Activated", True), - ("match_hoster", "Always;Always except excluded;Listed only", "Hoster match", "Always except excluded"), - ("match_crypter", "Always;Always except excluded;Listed only", "Crypter match", "Always except excluded"), - ("load_default", "bool", "Include built-in lists", True), - ("include_hosters", "str", "Include hosters (comma separated)", ""), - ("exclude_hosters", "str", "Exclude hosters (comma separated)", ""), - ("include_crypters", "str", "Include crypters (comma separated)", ""), - ("exclude_crypters", "str", "Exclude crypters (comma separated)", "")] - - __description__ = """Load hosters and crypter, based upon XFileSharingPro, which don't need a own plugin to work fine""" + ("every_hoster", "bool", "Try to hook any hoster", True), + ("every_crypter", "bool", "Try to hook any crypter", True), + ("load_default", "bool", "Load built-in plugins", True), + ("hoster_list", "str", "Load hosters (comma separated)", ""), + ("crypter_list", "str", "Load crypters (comma separated)", "")] + + __description__ = """Load XFileSharingPro based hosters and crypter which don't need a own plugin to run""" __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), - ("Walter Purcaro", "vuolter@gmail.com")] + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - event_list = ["pluginConfigChanged"] + # event_list = ["pluginConfigChanged"] + regex = {'hoster' : (r'https?://(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:embed-)?\w{12}', + r'https?://(?:[^/]+\.)?(%s)/(?:embed-)?\w{12}\W?'), + 'crypter': (r'https?://(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:user|folder)s?/\w+', + r'https?://(?:[^/]+\.)?(%s)/(?:user|folder)s?/\w+')} HOSTER_LIST = [#WORKING HOSTERS: - "eyesfile.ca", "fileband.com", "filedwon.com", "filevice.com", "hostingbulk.com", "linestorage.com", - "ravishare.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", + "eyesfile.ca", "file4safe.com", "fileband.com", "filedwon.com", "filevice.com", "hostingbulk.com", + "linestorage.com", "ravishare.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", #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", @@ -39,9 +40,8 @@ class XFileSharingPro(Hook): CRYPTER_LIST = [] - def pluginConfigChanged(self, plugin, name, value): - if name != "activated": - self.loadPattern() + # def pluginConfigChanged(self, plugin, name, value): + # self.loadPattern() def coreReady(self): @@ -49,53 +49,34 @@ class XFileSharingPro(Hook): def loadPattern(self): - regex = {'hoster' : (r'https?://(?!(?:www\.)?(?:%s))(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:embed-)?\w{12}', - r'https?://(?:[^/]+\.)?(%s)/(?:embed-)?\w{12}\W?'), - 'crypter': (r'https?://(?!(?:www\.)?(?:%s))(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:user|folder)s?/\w+', - r'https?://(?:[^/]+\.)?(%s)/(?:user|folder)s?/\w+')} - for type, plugin in (("hoster", "XFileSharingPro"), ("crypter", "XFileSharingProFolder")): - match = self.getConfig('match_%s' % type) - include_set = self.getConfigSet('include_%ss' % type) - exclude_set = self.getConfigSet('exclude_%ss' % type) - - if match != "Listed only": - if match == "Always": - match_list = "" - else: - hoster_list = exclude_set - set(('', u'')) - match_list = '|'.join(sorted(hoster_list)) - self.logDebug("Excluding %d %ss" % (len(hoster_list), type), match_list.replace('|', ', ')) - - regexp = regex[type][0] % match_list.replace('.', '\.') + every_plugin = self.getConfig('every_%s' % type) + if every_plugin: + regexp = self.regex[type][0] else: - hoster_list = include_set + s = self.getConfig('%s_list' % type).replace('\\', '').replace('|', ',').replace(';', ',').lower() + plugin_list = set([x.strip() for x in s.split(',')]) if self.getConfig('load_default'): - hoster_list |= set(getattr(self, "%s_LIST" % type.upper())) + plugin_list |= set([x.lower() for x in getattr(self, "%s_LIST" % type.upper())]) - hoster_list -= exclude_set - hoster_list -= set(('', u'')) + plugin_list -= set(('', u'')) - if not hoster_list: + if not plugin_list: self.unload() return - match_list = '|'.join(sorted(hoster_list)) - self.logDebug("Handling %d %ss" % (len(hoster_list), type), match_list.replace('|', ', ')) + match_list = '|'.join(sorted(plugin_list)) + self.logInfo("Handling %d %ss: %s" % (len(plugin_list), type, match_list.replace('|', ', '))) - regexp = regex[type][1] % match_list.replace('.', '\.') + regexp = self.regex[type][1] % match_list #.replace('.', '\.') dict = self.core.pluginManager.plugins[type][plugin] dict['pattern'] = regexp dict['re'] = re.compile(regexp) - self.logDebug("Pattern loaded for %ss" % type) - - def getConfigSet(self, option): - s = self.getConfig(option).lower().replace('|', ',').replace(';', ',') - return set([x.strip() for x in s.split(',')]) + self.logDebug("Loaded %s regex: `%s`" % (type, regexp)) def unload(self): -- cgit v1.2.3 From 5fb500416177562d5fed138e4f840d17b4fb604f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Sat, 1 Nov 2014 00:10:06 +0100 Subject: [IRCInterface] Initial SSL Support --- module/plugins/hooks/IRCInterface.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index 4bf2c7866..4d0cd1619 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -2,6 +2,7 @@ import re import socket +import ssl import time from pycurl import FORM_FILE @@ -19,12 +20,13 @@ from module.utils import formatSize class IRCInterface(Thread, Hook): __name__ = "IRCInterface" __type__ = "hook" - __version__ = "0.11" + __version__ = "0.12" __config__ = [("host", "str", "IRC-Server Address", "Enter your server here!"), ("port", "int", "IRC-Server Port", 6667), ("ident", "str", "Clients ident", "pyload-irc"), ("realname", "str", "Realname", "pyload-irc"), + ("ssl", "bool", "Use SSL", False), ("nick", "str", "Nickname the Client will take", "pyLoad-IRC"), ("owner", "str", "Nickname the Client will accept commands from", "Enter your nick here!"), ("info_file", "bool", "Inform about every file finished", False), @@ -85,6 +87,10 @@ class IRCInterface(Thread, Hook): self.sock = socket.socket() host = self.getConfig("host") self.sock.connect((host, self.getConfig("port"))) + + if self.getConfig("ssl"): + self.sock = ssl.wrap_socket(self.sock, cert_reqs=ssl.CERT_NONE) #@TODO: support certificate + nick = self.getConfig("nick") self.sock.send("NICK %s\r\n" % nick) self.sock.send("USER %s %s bla :%s\r\n" % (nick, host, nick)) -- cgit v1.2.3 From dbcec9627ab27c0493fd277b93f08504a90cefe6 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 1 Nov 2014 18:48:07 +0100 Subject: [XFileSharingPro] Tiny code cosmetics --- module/plugins/hooks/XFileSharingPro.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 3c35adedb..552730f5d 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -53,6 +53,7 @@ class XFileSharingPro(Hook): every_plugin = self.getConfig('every_%s' % type) if every_plugin: + self.logInfo("Handling all %ss: %s" % (len(plugin_list), type, match_list.replace('|', ', '))) regexp = self.regex[type][0] else: s = self.getConfig('%s_list' % type).replace('\\', '').replace('|', ',').replace(';', ',').lower() @@ -68,9 +69,9 @@ class XFileSharingPro(Hook): return match_list = '|'.join(sorted(plugin_list)) - self.logInfo("Handling %d %ss: %s" % (len(plugin_list), type, match_list.replace('|', ', '))) + self.logInfo("Handling %s %ss" % (u'\u221E', type)) - regexp = self.regex[type][1] % match_list #.replace('.', '\.') + regexp = self.regex[type][1] % match_list.replace('.', '\.') dict = self.core.pluginManager.plugins[type][plugin] dict['pattern'] = regexp -- cgit v1.2.3 From 4cc95697eface0d00c73d5b39f0cfdf5607f814d Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 1 Nov 2014 22:21:58 +0100 Subject: Don't handle bugged event pluginConfigChanged --- module/plugins/hooks/DeleteFinished.py | 6 +++--- module/plugins/hooks/RestartFailed.py | 4 ++-- module/plugins/hooks/UpdateManager.py | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/DeleteFinished.py b/module/plugins/hooks/DeleteFinished.py index b68e68679..5d2b78d50 100644 --- a/module/plugins/hooks/DeleteFinished.py +++ b/module/plugins/hooks/DeleteFinished.py @@ -7,7 +7,7 @@ from module.plugins.Hook import Hook class DeleteFinished(Hook): __name__ = "DeleteFinished" __type__ = "hook" - __version__ = "1.10" + __version__ = "1.11" __config__ = [('activated', 'bool', 'Activated', 'False'), ('interval', 'int', 'Delete every (hours)', '72'), @@ -18,7 +18,7 @@ class DeleteFinished(Hook): __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - event_list = ["pluginConfigChanged"] + # event_list = ["pluginConfigChanged"] ## overwritten methods ## @@ -46,7 +46,7 @@ class DeleteFinished(Hook): def coreReady(self): self.info = {'sleep': True} interval = self.getConfig('interval') - self.pluginConfigChanged('DeleteFinished', 'interval', interval) + self.pluginConfigChanged(self.__name__, 'interval', interval) self.addEvent('packageFinished', self.wakeup) diff --git a/module/plugins/hooks/RestartFailed.py b/module/plugins/hooks/RestartFailed.py index 81a83e2c9..b866c9d0a 100644 --- a/module/plugins/hooks/RestartFailed.py +++ b/module/plugins/hooks/RestartFailed.py @@ -6,7 +6,7 @@ from module.plugins.Hook import Hook class RestartFailed(Hook): __name__ = "RestartFailed" __type__ = "hook" - __version__ = "1.55" + __version__ = "1.56" __config__ = [("interval", "int", "Check interval in minutes", 90)] @@ -15,7 +15,7 @@ class RestartFailed(Hook): __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - event_list = ["pluginConfigChanged"] + # event_list = ["pluginConfigChanged"] MIN_INTERVAL = 15 * 60 #: 15m minimum check interval (value is in seconds) diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index e55c0e104..5fe1b0e5f 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -14,7 +14,7 @@ from module.utils import save_join class UpdateManager(Hook): __name__ = "UpdateManager" __type__ = "hook" - __version__ = "0.36" + __version__ = "0.37" __config__ = [("activated", "bool", "Activated", True), ("mode", "pyLoad + plugins;plugins only", "Check updates for", "pyLoad + plugins"), @@ -27,7 +27,7 @@ class UpdateManager(Hook): __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - event_list = ["pluginConfigChanged"] + # event_list = ["pluginConfigChanged"] SERVER_URL = "http://updatemanager.pyload.org" MIN_INTERVAL = 6 * 60 * 60 #: 6h minimum check interval (value is in seconds) -- cgit v1.2.3 From 0c65a1e6c6ffa739731e3101dcac1dc5d728c9ad Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 2 Nov 2014 22:41:04 +0100 Subject: [XFileSharingPro] Fix hook plugin --- module/plugins/hooks/XFileSharingPro.py | 60 +++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 25 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 552730f5d..c4205b34f 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,14 +8,14 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.20" + __version__ = "0.21" __config__ = [("activated", "bool", "Activated", True), - ("every_hoster", "bool", "Try to hook any hoster", True), - ("every_crypter", "bool", "Try to hook any crypter", True), - ("load_default", "bool", "Load built-in plugins", True), - ("hoster_list", "str", "Load hosters (comma separated)", ""), - ("crypter_list", "str", "Load crypters (comma separated)", "")] + ("use_hoster_list", "bool", "Load listed hosters only", False), + ("use_crypter_list", "bool", "Load listed crypters only", False), + ("use_builtin_list", "bool", "Load built-in plugin list", True), + ("hoster_list", "str", "Hoster list (comma separated)", ""), + ("crypter_list", "str", "Crypter list (comma separated)", "")] __description__ = """Load XFileSharingPro based hosters and crypter which don't need a own plugin to run""" __license__ = "GPLv3" @@ -23,7 +23,7 @@ class XFileSharingPro(Hook): # event_list = ["pluginConfigChanged"] - regex = {'hoster' : (r'https?://(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:embed-)?\w{12}', + regexp = {'hoster' : (r'https?://(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:embed-)?\w{12}', r'https?://(?:[^/]+\.)?(%s)/(?:embed-)?\w{12}\W?'), 'crypter': (r'https?://(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:user|folder)s?/\w+', r'https?://(?:[^/]+\.)?(%s)/(?:user|folder)s?/\w+')} @@ -40,7 +40,7 @@ class XFileSharingPro(Hook): CRYPTER_LIST = [] - # def pluginConfigChanged(self, plugin, name, value): + # def pluginConfigChanged(self.__name__, plugin, name, value): # self.loadPattern() @@ -49,40 +49,50 @@ class XFileSharingPro(Hook): def loadPattern(self): - for type, plugin in (("hoster", "XFileSharingPro"), ("crypter", "XFileSharingProFolder")): - every_plugin = self.getConfig('every_%s' % type) + use_builtin_list = self.getConfig('use_builtin_list') + + for type, plugin in (("hoster", "XFileSharingPro"), + ("crypter", "XFileSharingProFolder")): + every_plugin = not self.getConfig("use_%s_list" % type) if every_plugin: - self.logInfo("Handling all %ss: %s" % (len(plugin_list), type, match_list.replace('|', ', '))) - regexp = self.regex[type][0] + self.logInfo(_("Handling any %s I can!") % type) + pattern = self.regexp[type][0] else: s = self.getConfig('%s_list' % type).replace('\\', '').replace('|', ',').replace(';', ',').lower() plugin_list = set([x.strip() for x in s.split(',')]) - if self.getConfig('load_default'): + if use_builtin_list: plugin_list |= set([x.lower() for x in getattr(self, "%s_LIST" % type.upper())]) - plugin_list -= set(('', u'')) + plugin_list -= set(('', u'') if not plugin_list: - self.unload() + self.logInfo(_("No %s to handle") % type) + self._unload(type, plugin) return match_list = '|'.join(sorted(plugin_list)) - self.logInfo("Handling %s %ss" % (u'\u221E', type)) - regexp = self.regex[type][1] % match_list.replace('.', '\.') + len_match_list = len(plugin_list) + self.logInfo(_("Handling %d %s%s: %s") % (len_match_list, type, "" if len_match_list is 1 else "s", match_list.replace('|', ', '))) + + pattern = self.regexp[type][1] % match_list.replace('.', '\.') dict = self.core.pluginManager.plugins[type][plugin] - dict['pattern'] = regexp - dict['re'] = re.compile(regexp) + dict['pattern'] = pattern + dict['re'] = re.compile(pattern) + + self.logDebug("Loaded %s pattern: %s" % (type, pattern)) - self.logDebug("Loaded %s regex: `%s`" % (type, regexp)) + + def _unload(self, type, plugin): + dict = self.core.pluginManager.plugins[type][plugin] + dict['pattern'] = r'^unmatchable$' + dict['re'] = re.compile(dict['pattern']) def unload(self): - regexp = r'^unmatchable$' - for type, plugin in (("hoster", "XFileSharingPro"), ("crypter", "XFileSharingProFolder")): - dict = self.core.pluginManager.plugins[type][plugin] - dict['pattern'] = regexp - dict['re'] = re.compile(regexp) + for type, plugin in (("hoster", "XFileSharingPro"), + ("crypter", "XFileSharingProFolder")): + self._unload(type, plugin) -- cgit v1.2.3 From 57e7d7049a569bc96e7bdf135a2d40df520cf3b3 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 3 Nov 2014 13:04:22 +0100 Subject: [XFileSharingPro] Fix typo --- module/plugins/hooks/XFileSharingPro.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index c4205b34f..55fb5948a 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.21" + __version__ = "0.22" __config__ = [("activated", "bool", "Activated", True), ("use_hoster_list", "bool", "Load listed hosters only", False), @@ -65,7 +65,7 @@ class XFileSharingPro(Hook): if use_builtin_list: plugin_list |= set([x.lower() for x in getattr(self, "%s_LIST" % type.upper())]) - plugin_list -= set(('', u'') + plugin_list -= set(('', u'')) if not plugin_list: self.logInfo(_("No %s to handle") % type) -- cgit v1.2.3 From 168f175ce4765dec7e847c45d95e4babe20a7193 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Mon, 3 Nov 2014 14:42:05 +0100 Subject: New __authors__ key, added __license__ --- module/plugins/hooks/NoPremiumPl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/NoPremiumPl.py b/module/plugins/hooks/NoPremiumPl.py index 757af6037..f60cb3dd6 100644 --- a/module/plugins/hooks/NoPremiumPl.py +++ b/module/plugins/hooks/NoPremiumPl.py @@ -17,8 +17,8 @@ class NoPremiumPl(MultiHoster): ("interval", "int", "Reload supported hosts interval in hours (0 to disable)", "24")] __description__ = "NoPremium.pl hook" - __author_name__ = ("goddie") - __author_mail__ = ("dev@nopremium.pl") + __license__ = "GPLv3" + __authors__ = [("goddie", "dev@nopremium.pl")] def getHoster(self): hostings = loads(getURL("https://www.nopremium.pl/clipboard.php?json=3").strip()) -- cgit v1.2.3 From 005710831caa04bbe372b54ac357658963fe02bb Mon Sep 17 00:00:00 2001 From: synweap15 Date: Mon, 3 Nov 2014 14:44:44 +0100 Subject: New __authors__ key, added __license__ --- module/plugins/hooks/RapideoPl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/RapideoPl.py b/module/plugins/hooks/RapideoPl.py index 910dd175b..a5d7a34a5 100644 --- a/module/plugins/hooks/RapideoPl.py +++ b/module/plugins/hooks/RapideoPl.py @@ -17,8 +17,8 @@ class RapideoPl(MultiHoster): ("interval", "int", "Reload supported hosts interval in hours (0 to disable)", "24")] __description__ = "Rapideo.pl hook" - __author_name__ = ("goddie") - __author_mail__ = ("dev@rapideo.pl") + __license__ = "GPLv3" + __authors__ = [("goddie", "dev@rapideo.pl")] def getHoster(self): hostings = loads(getURL("https://www.rapideo.pl/clipboard.php?json=3").strip()) -- cgit v1.2.3 From edfaaed90d59991ada592da31a65cc518d7d3871 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 4 Nov 2014 03:23:39 +0100 Subject: Code cosmetics --- module/plugins/hooks/XFileSharingPro.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 55fb5948a..6e9962f3c 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -28,15 +28,15 @@ class XFileSharingPro(Hook): 'crypter': (r'https?://(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:user|folder)s?/\w+', r'https?://(?:[^/]+\.)?(%s)/(?:user|folder)s?/\w+')} - HOSTER_LIST = [#WORKING HOSTERS: - "eyesfile.ca", "file4safe.com", "fileband.com", "filedwon.com", "filevice.com", "hostingbulk.com", - "linestorage.com", "ravishare.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", - #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: - "amonshare.com", "banicrazy.info", "boosterking.com", "host4desi.com", "laoupload.com", "rd-fs.com"] + HOSTER_LIST = [#WORKING HOSTERS: + "eyesfile.ca", "file4safe.com", "fileband.com", "filedwon.com", "filevice.com", "hostingbulk.com", + "linestorage.com", "ravishare.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", + #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: + "amonshare.com", "banicrazy.info", "boosterking.com", "host4desi.com", "laoupload.com", "rd-fs.com"] CRYPTER_LIST = [] -- cgit v1.2.3 From 7add58fd4e712037d0a4b775cda10c7a9e677645 Mon Sep 17 00:00:00 2001 From: Firefly Date: Tue, 4 Nov 2014 14:17:03 +0100 Subject: [RestartFailed] Removed clutter message in normal mode --- module/plugins/hooks/RestartFailed.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/RestartFailed.py b/module/plugins/hooks/RestartFailed.py index b866c9d0a..07fb80967 100644 --- a/module/plugins/hooks/RestartFailed.py +++ b/module/plugins/hooks/RestartFailed.py @@ -6,7 +6,7 @@ from module.plugins.Hook import Hook class RestartFailed(Hook): __name__ = "RestartFailed" __type__ = "hook" - __version__ = "1.56" + __version__ = "1.57" __config__ = [("interval", "int", "Check interval in minutes", 90)] @@ -32,7 +32,7 @@ class RestartFailed(Hook): def periodical(self): - self.logInfo(_("Restart failed downloads")) + self.logDebug(_("Restart failed downloads")) self.core.api.restartFailed() -- cgit v1.2.3 From f74309f89923317eeaaca31d74dff10590ed3d40 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 4 Nov 2014 23:42:46 +0100 Subject: [XFSHoster] Use URL_REPLACEMENTS to clean url --- module/plugins/hooks/XFileSharingPro.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 6e9962f3c..ddc20b98a 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -24,9 +24,9 @@ class XFileSharingPro(Hook): # event_list = ["pluginConfigChanged"] regexp = {'hoster' : (r'https?://(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:embed-)?\w{12}', - r'https?://(?:[^/]+\.)?(%s)/(?:embed-)?\w{12}\W?'), - 'crypter': (r'https?://(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:user|folder)s?/\w+', - r'https?://(?:[^/]+\.)?(%s)/(?:user|folder)s?/\w+')} + r'https?://(?:[^/]+\.)?(%s)/(?:embed-)?\w{12}\W?'), + 'crypter': (r'https?://(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:user|folder)s?/\w+', + r'https?://(?:[^/]+\.)?(%s)/(?:user|folder)s?/\w+')} HOSTER_LIST = [#WORKING HOSTERS: "eyesfile.ca", "file4safe.com", "fileband.com", "filedwon.com", "filevice.com", "hostingbulk.com", -- cgit v1.2.3 From 77269c8c78fcf7bd7a8ddbdbfc972043263fea46 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 6 Nov 2014 03:33:31 +0100 Subject: Code cosmetics --- module/plugins/hooks/UpdateManager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 5fe1b0e5f..022300c7a 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -14,7 +14,7 @@ from module.utils import save_join class UpdateManager(Hook): __name__ = "UpdateManager" __type__ = "hook" - __version__ = "0.37" + __version__ = "0.38" __config__ = [("activated", "bool", "Activated", True), ("mode", "pyLoad + plugins;plugins only", "Check updates for", "pyLoad + plugins"), @@ -196,7 +196,7 @@ class UpdateManager(Hook): if not oldver: msg = "New [%(type)s] %(name)s (v%(newver)s)" elif newver > oldver: - msg = "New version of [%(type)s] %(name)s (v%(oldver)s -> v%(newver)s)" + msg = "New version of [%(type)s] %(name)s (v%(oldver)f -> v%(newver)f)" else: continue -- cgit v1.2.3 From 29b39ec6020ec8be623687f03bdf48172a612a66 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 6 Nov 2014 04:32:37 +0100 Subject: Code cosmetics --- module/plugins/hooks/UpdateManager.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 022300c7a..c2fdd412e 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -259,7 +259,7 @@ class UpdateManager(Hook): if not type_plugins: return - self.logDebug("Requested deletion of plugins", type_plugins) + self.logDebug("Requested deletion of plugins", ", ".join(type_plugins)) removed = [] @@ -273,7 +273,7 @@ class UpdateManager(Hook): try: remove(filename) except Exception, e: - self.logDebug("Error deleting", path.basename(filename), str(e)) + self.logDebug("Error removing: %s" % path.basename(filename), str(e)) err = True filename += "c" @@ -283,7 +283,7 @@ class UpdateManager(Hook): self.manager.deactivateHook(name) remove(filename) except Exception, e: - self.logDebug("Error deleting", path.basename(filename), str(e)) + self.logDebug("Error removing: %s" % path.basename(filename), str(e)) err = True if not err: -- cgit v1.2.3 From 5808282e10117332ce97911bac48a4a142d42f28 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 6 Nov 2014 04:51:45 +0100 Subject: Tiny code cosmetics to fix previous ones --- module/plugins/hooks/UpdateManager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index c2fdd412e..08ba40cd3 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -259,7 +259,7 @@ class UpdateManager(Hook): if not type_plugins: return - self.logDebug("Requested deletion of plugins", ", ".join(type_plugins)) + self.logDebug("Requested deletion of plugins: %s" % type_plugins) removed = [] -- cgit v1.2.3 From 0bbc20062b99a9bd627ca5cce2f43188838611f0 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 8 Nov 2014 12:55:45 +0100 Subject: [LinkdecrypterCom] Check if is down --- module/plugins/hooks/LinkdecrypterCom.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/LinkdecrypterCom.py b/module/plugins/hooks/LinkdecrypterCom.py index 9343208de..6194f67f1 100644 --- a/module/plugins/hooks/LinkdecrypterCom.py +++ b/module/plugins/hooks/LinkdecrypterCom.py @@ -10,7 +10,7 @@ from module.utils import remove_chars class LinkdecrypterCom(Hook): __name__ = "LinkdecrypterCom" __type__ = "hook" - __version__ = "0.19" + __version__ = "0.20" __description__ = """Linkdecrypter.com hook plugin""" __license__ = "GPLv3" @@ -21,12 +21,18 @@ class LinkdecrypterCom(Hook): try: self.loadPatterns() except Exception, e: - self.logError(e) + self.logError(str(e)) def loadPatterns(self): - page = getURL("http://linkdecrypter.com/") - m = re.search(r'Supported\(\d+\): ([^+<]*)', page) + html = getURL("http://linkdecrypter.com/") + + m = re.search(r'', html) + if m is None: + self.logError(_("Linkdecrypter site is down")) + return + + m = re.search(r'<b>Supported\(\d+\)</b>: <i>([^+<]*)', html) if m is None: self.logError(_("Crypter list not found")) return @@ -51,4 +57,4 @@ class LinkdecrypterCom(Hook): dict['pattern'] = regexp dict['re'] = re.compile(regexp) - self.logDebug("REGEXP", regexp) + self.logDebug("Loaded pattern: %s" % regexp) -- cgit v1.2.3 From ba8429ea41fdf142a0f8c0f116c82e70c9c018bb Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sat, 8 Nov 2014 14:35:06 +0100 Subject: [Captcha9kw] Update --- module/plugins/hooks/Captcha9kw.py | 291 ++++++++++++++++++++++++------------- 1 file changed, 186 insertions(+), 105 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index b8aa2fd78..0b0de8ba5 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -2,160 +2,241 @@ from __future__ import with_statement -import time +import re from base64 import b64encode from thread import start_new_thread +from time import sleep from module.network.HTTPRequest import BadHeader from module.network.RequestFactory import getURL + from module.plugins.Hook import Hook class Captcha9kw(Hook): __name__ = "Captcha9kw" __type__ = "hook" - __version__ = "0.10" + __version__ = "0.13" - __config__ = [("force", "bool", "Force CT even if client is connected", True), - ("https", "bool", "Enable HTTPS", False), + __config__ = [("activated", "bool", "Activated", True), + ("force", "bool", "Force captcha resolving even if client is connected", True), ("confirm", "bool", "Confirm Captcha (Cost +6)", False), - ("captchaperhour", "int", "Captcha per hour (max. 9999)", 9999), - ("prio", "int", "Prio 1-10 (Cost +1-10)", 0), - ("selfsolve", "bool", - "If enabled and you have a 9kw client active only you will get your captcha to solve it (Selfsolve)", - False), - ("timeout", "int", "Timeout (max. 300)", 300), - ("passkey", "password", "API key", "")] + ("captchaperhour", "int", "Captcha per hour", "9999"), + ("prio", "int", "Priority (max. 20)(Cost +0 -> +20)", "0"), + ("queue", "int", "Max. Queue (max. 999)", "0"), + ("hoster_options", "string", "Hoster options (Format: pluginname:prio=1:selfsolfe=1:confirm=1:timeout=900;)", "ShareonlineBiz:prio=0:timeout=999;UploadedTo:prio=0:timeout=999;SerienjunkiesOrg:prio=1:min=3;max=3;timeout=90"), + ("selfsolve", "bool", "If enabled and you have a 9kw client active only you will get your captcha to solve it (Selfsolve)", "0"), + ("passkey", "password", "API key", ""), + ("timeout", "int", "Timeout (min. 60s, max. 3999s)", "900")] __description__ = """Send captchas to 9kw.eu""" __license__ = "GPLv3" - __authors__ = [("RaNaN", "RaNaN@pyload.org")] + __authors__ = [("RaNaN", "RaNaN@pyload.org"), + ("Walter Purcaro", "vuolter@gmail.com")] - API_URL = "://www.9kw.eu/index.cgi" + API_URL = "http://www.9kw.eu/index.cgi" def setup(self): - self.API_URL = "https" + self.API_URL if self.getConfig("https") else "http" + self.API_URL - self.info = {} + self.info = {} #@TODO: Remove in 0.4.10 def getCredits(self): - response = getURL(self.API_URL, get={"apikey": self.getConfig("passkey"), "pyload": "1", "source": "pyload", - "action": "usercaptchaguthaben"}) - - if response.isdigit(): - self.logInfo(_("%s credits left") % response) - self.info['credits'] = credits = int(response) + res = getURL(self.API_URL, + get={'apikey': self.getConfig("passkey"), + 'pyload': "1", + 'source': "pyload", + 'action': "usercaptchaguthaben"}) + + if res.isdigit(): + self.logInfo(_("%d credits left") % res) + credits = self.info["credits"] = int(res) return credits else: - self.logError(response) + self.logError(res) return 0 - def processCaptcha(self, task): - result = None + def _processCaptcha(self, task): + try: + with open(task.captchaFile, 'rb') as f: + data = f.read() + except IOError, e: + self.logError(str(e)) + return - with open(task.captchaFile, 'rb') as f: - data = f.read() data = b64encode(data) - self.logDebug(task.captchaFile, data) - if task.isPositional(): - mouse = 1 - else: - mouse = 0 - - response = getURL(self.API_URL, post={ - "apikey": self.getConfig("passkey"), - "prio": self.getConfig("prio"), - "confirm": self.getConfig("confirm"), - "captchaperhour": self.getConfig("captchaperhour"), - "maxtimeout": self.getConfig("timeout"), - "selfsolve": self.getConfig("selfsolve"), - "pyload": "1", - "source": "pyload", - "base64": "1", - "mouse": mouse, - "file-upload-01": data, - "action": "usercaptchaupload"}) - - if response.isdigit(): - self.logInfo(_("New CaptchaID from upload: %s : %s") % (response, task.captchaFile)) - - for _i in xrange(1, 100, 1): - response2 = getURL(self.API_URL, get={"apikey": self.getConfig("passkey"), "id": response, - "pyload": "1", "source": "pyload", - "action": "usercaptchacorrectdata"}) - - if response2 != "": + mouse = 1 if task.isPositional() else 0 + pluginname = re.search(r'_([^_]*)_\d+.\w+', task.captchaFile).group(1) + + self.logDebug("%s: %s" % (task.captchaFile, data)) + + option = {'min' : 2 + 'max' : 50 + 'phrase' : 0 + 'numeric' : 0 + 'case_sensitive' : 0 + 'math' : 0 + 'prio' : self.getConfig("prio") + 'confirm' : self.getConfig("confirm") + 'timeout' : min(max(self.getConfig("timeout") * 60, 300), 3999) + 'selfsolve' : self.getConfig("selfsolve") + 'cph' : self.getConfig("captchaperhour") + 'hoster_options' : self.getConfig("hoster_options").split(";")} + + for opt in hoster_options: + details = opt.split(":") + + if not details or details[0].lower() != pluginname.lower(): + continue + + for d in details: + hosteroption = d.split("=") + + if len(hosteroption) <= 1 or not hosteroption[1].isdigit(): + continue + + o = hosteroption[0].lower() + if o in option: + option[o] = hosteroption[1] + + for _ in xrange(5): + post_data = {'apikey' : self.getConfig("passkey"), + 'prio' : prio_option, + 'confirm' : confirm_option, + 'maxtimeout' : timeout_option, + 'selfsolve' : selfsolve_option, + 'captchaperhour': cph_option, + 'case-sensitive': case_sensitive_option, + 'min_len' : min_option, + 'max_len' : max_option, + 'phrase' : phrase_option, + 'numeric' : numeric_option, + 'math' : math_option, + 'oldsource' : pluginname, + 'pyload' : "1", + 'source' : "pyload", + 'base64' : "1", + 'mouse' : mouse, + 'file-upload-01': data, + 'action' : "usercaptchaupload"} + try: + res = getURL(self.API_URL, post=post_data) + if res: break + except BadHeader, e: + sleep(3) - time.sleep(3) + if not res.isdigit(): + self.logError(_("Bad upload: %s") % res) + return - result = response2 - task.data['ticket'] = response - self.logInfo(_("Result %s : %s") % (response, result)) - task.setResult(result) - else: - self.logError(_("Bad upload"), response) - return False + self.logInfo(_("NewCaptchaID from upload: %s : %s") % (res, task.captchaFile)) + + task.data["ticket"] = res + self.logInfo("result %s : %s" % (res, result)) + + for _ in xrange(int(self.getConfig("timeout") / 5)): + res2 = getURL(self.API_URL, + get={'apikey': self.getConfig("passkey"), + 'id' : res, + 'pyload': "1", + 'info' : "1", + 'source': "pyload", + 'action': "usercaptchacorrectdata"}) + + if not res2 or res2 == "NO DATA": + sleep(5) + else: + break + + task.setResult(res2 or None) def newCaptchaTask(self, task): if not task.isTextual() and not task.isPositional(): - return False + return - if not self.getConfig("passkey"): - return False + elif not self.getConfig("passkey"): + return - if self.core.isClientConnected() and not self.getConfig("force"): - return False + elif self.core.isClientConnected() and not self.getConfig("force"): + return - if self.getCredits() > 0: - task.handler.append(self) - task.setWaiting(self.getConfig("timeout")) - start_new_thread(self.processCaptcha, (task,)) + credits = self.getCredits() - else: + if not credits: self.logError(_("Your Captcha 9kw.eu Account has not enough credits")) + return + queue = self.getConfig("queue") + timeout = min(max(self.getConfig("timeout") * 60, 300), 3999) + hoster_options = self.getConfig("hoster_options").split(";") + pluginname = re.search(r'_([^_]*)_\d+.\w+', task.captchaFile).group(1) - def captchaCorrect(self, task): - if "ticket" in task.data: + if 1000 > queue > 10: + servercheck = getURL("http://www.9kw.eu/grafik/servercheck.txt") + regex = re.compile("queue=(\d+)") - try: - response = getURL(self.API_URL, - post={"action": "usercaptchacorrectback", - "apikey": self.getConfig("passkey"), - "api_key": self.getConfig("passkey"), - "correct": "1", - "pyload": "1", - "source": "pyload", - "id": task.data['ticket']}) - self.logInfo(_("Request correct"), response) + for _ in xrange(3): + if queue < regex.search(servercheck).group(1): + break - except BadHeader, e: - self.logError(_("Could not send correct request"), str(e)) - else: - self.logError(_("No CaptchaID for correct request (task %s) found") % task) + sleep(10) + for opt in hoster_options: + details = opt.split(":") - def captchaInvalid(self, task): - if "ticket" in task.data: + if not details or details[0].lower() != pluginname.lower(): + continue - try: - response = getURL(self.API_URL, - post={"action": "usercaptchacorrectback", - "apikey": self.getConfig("passkey"), - "api_key": self.getConfig("passkey"), - "correct": "2", - "pyload": "1", - "source": "pyload", - "id": task.data['ticket']}) - self.logInfo(_("Request refund"), response) + for d in details: + hosteroption = d.split("=") - except BadHeader, e: - self.logError(_("Could not send refund request"), str(e)) - else: - self.logError(_("No CaptchaID for not correct request (task %s) found") % task) + if (len(hosteroption) > 1 + and hosteroption[0].lower() == 'timeout' + and hosteroption[1].isdigit()): + timeout = int(hosteroption[1]) + + task.handler.append(self) + + task.setWaiting(timeout) + + start_new_thread(self._processCaptcha, (task,)) + + + def _captchaResponse(self, task, correct): + if "ticket" not in task.data: + return + + type = "correct" if correct else "refund" + passkey = self.getConfig("passkey") + + for _ in xrange(3): + res = getURL(self.API_URL, + get={'action' : "usercaptchacorrectback", + 'apikey' : passkey, + 'api_key': passkey, + 'correct': "1" if correct else "2", + 'pyload' : "1", + 'source' : "pyload", + 'id' : task.data["ticket"]}) + + if res is "OK": + self.logInfo(_("Request %s: %s" % type) % res) + return + else: + self.logDebug(_("Could not send %s request: %s" % type) % res) + sleep(1) + else: + self.logDebug(_("No CaptchaID for %s request (task: %s)" % type) % task) + + + def captchaCorrect(self, task): + self._captchaResponse(self, task, True) + + + def captchaInvalid(self, task): + self._captchaResponse(self, task, False) -- cgit v1.2.3 From 9d9d30887a4b229b5a5b280de49ab1355998a614 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sun, 9 Nov 2014 02:43:20 +0100 Subject: [Checksum] Don't use b'' --- module/plugins/hooks/Checksum.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index fe2efdb41..b746fce5f 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -18,7 +18,7 @@ def computeChecksum(local_file, algorithm): h = getattr(hashlib, algorithm)() with open(local_file, 'rb') as f: - for chunk in iter(lambda: f.read(128 * h.block_size), b''): + for chunk in iter(lambda: f.read(128 * h.block_size), ''): h.update(chunk) return h.hexdigest() @@ -28,7 +28,7 @@ def computeChecksum(local_file, algorithm): last = 0 with open(local_file, 'rb') as f: - for chunk in iter(lambda: f.read(8192), b''): + for chunk in iter(lambda: f.read(8192), ''): last = hf(chunk, last) return "%x" % last @@ -40,7 +40,7 @@ def computeChecksum(local_file, algorithm): class Checksum(Hook): __name__ = "Checksum" __type__ = "hook" - __version__ = "0.13" + __version__ = "0.14" __config__ = [("check_checksum", "bool", "Check checksum? (If False only size will be verified)", True), ("check_action", "fail;retry;nothing", "What to do if check fails?", "retry"), -- cgit v1.2.3 From d6ef06aa8f1e2de97cf22e6895b631da0a8bb816 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sun, 9 Nov 2014 02:44:07 +0100 Subject: [Captcha9kw] Fix a couple of typo --- module/plugins/hooks/Captcha9kw.py | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index 0b0de8ba5..af12ca830 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -17,7 +17,7 @@ from module.plugins.Hook import Hook class Captcha9kw(Hook): __name__ = "Captcha9kw" __type__ = "hook" - __version__ = "0.13" + __version__ = "0.14" __config__ = [("activated", "bool", "Activated", True), ("force", "bool", "Force captcha resolving even if client is connected", True), @@ -73,17 +73,17 @@ class Captcha9kw(Hook): self.logDebug("%s: %s" % (task.captchaFile, data)) - option = {'min' : 2 - 'max' : 50 - 'phrase' : 0 - 'numeric' : 0 - 'case_sensitive' : 0 - 'math' : 0 - 'prio' : self.getConfig("prio") - 'confirm' : self.getConfig("confirm") - 'timeout' : min(max(self.getConfig("timeout") * 60, 300), 3999) - 'selfsolve' : self.getConfig("selfsolve") - 'cph' : self.getConfig("captchaperhour") + option = {'min' : 2, + 'max' : 50, + 'phrase' : 0, + 'numeric' : 0, + 'case_sensitive' : 0, + 'math' : 0, + 'prio' : self.getConfig("prio"), + 'confirm' : self.getConfig("confirm"), + 'timeout' : min(max(self.getConfig("timeout") * 60, 300), 3999), + 'selfsolve' : self.getConfig("selfsolve"), + 'cph' : self.getConfig("captchaperhour"), 'hoster_options' : self.getConfig("hoster_options").split(";")} for opt in hoster_options: @@ -209,6 +209,7 @@ class Captcha9kw(Hook): def _captchaResponse(self, task, correct): if "ticket" not in task.data: + self.logDebug(_("No CaptchaID for %s request (task: %s)" % type) % task) return type = "correct" if correct else "refund" @@ -230,8 +231,6 @@ class Captcha9kw(Hook): else: self.logDebug(_("Could not send %s request: %s" % type) % res) sleep(1) - else: - self.logDebug(_("No CaptchaID for %s request (task: %s)" % type) % task) def captchaCorrect(self, task): -- cgit v1.2.3 From bd8259220ab4d56ab419b7b32045b08cc9b0a7c8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sun, 9 Nov 2014 03:08:19 +0100 Subject: Use with statement instead open method when accessing fod + handle i/o error --- module/plugins/hooks/ExtractArchive.py | 33 ++++++++++------- module/plugins/hooks/HotFolder.py | 67 +++++++++++++++++----------------- 2 files changed, 52 insertions(+), 48 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 3d6df5b02..39da1ee7b 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -309,16 +309,18 @@ class ExtractArchive(Hook): def reloadPasswords(self): passwordfile = self.getConfig("passwordfile") - if not exists(passwordfile): - open(passwordfile, "wb").close() - - passwords = [] - f = open(passwordfile, "rb") - for pw in f.read().splitlines(): - passwords.append(pw) - f.close() - - self.passwords = passwords + + try: + passwords = [] + with open(passwordfile, "a+") as f: + for pw in f.read().splitlines(): + passwords.append(pw) + + except IOError, e: + self.logError(str(e)) + + else: + self.passwords = passwords @Expose @@ -328,12 +330,15 @@ class ExtractArchive(Hook): if pw in self.passwords: self.passwords.remove(pw) + self.passwords.insert(0, pw) - f = open(passwordfile, "wb") - for pw in self.passwords: - f.write(pw + "\n") - f.close() + try: + with open(passwordfile, "wb") as f: + for pw in self.passwords: + f.write(pw + "\n") + except IOError, e: + self.logError(str(e)) def setPermissions(self, files): diff --git a/module/plugins/hooks/HotFolder.py b/module/plugins/hooks/HotFolder.py index d7e8093b3..5e9dd9547 100644 --- a/module/plugins/hooks/HotFolder.py +++ b/module/plugins/hooks/HotFolder.py @@ -7,6 +7,7 @@ from os.path import exists, isfile, join from shutil import move from module.plugins.Hook import Hook +from module.utils import fs_encode, save_join class HotFolder(Hook): @@ -29,37 +30,35 @@ class HotFolder(Hook): def periodical(self): - if not exists(join(self.getConfig("folder"), "finished")): - makedirs(join(self.getConfig("folder"), "finished")) - - if self.getConfig("watch_file"): - - if not exists(self.getConfig("file")): - f = open(self.getConfig("file"), "wb") - f.close() - - f = open(self.getConfig("file"), "rb") - content = f.read().strip() - f.close() - f = open(self.getConfig("file"), "wb") - f.close() - if content: - name = "%s_%s.txt" % (self.getConfig("file"), time.strftime("%H-%M-%S_%d%b%Y")) - - f = open(join(self.getConfig("folder"), "finished", name), "wb") - f.write(content) - f.close() - - self.core.api.addPackage(f.name, [f.name], 1) - - for f in listdir(self.getConfig("folder")): - path = join(self.getConfig("folder"), f) - - if not isfile(path) or f.endswith("~") or f.startswith("#") or f.startswith("."): - continue - - newpath = join(self.getConfig("folder"), "finished", f if self.getConfig("keep") else "tmp_" + f) - move(path, newpath) - - self.logInfo(_("Added %s from HotFolder") % f) - self.core.api.addPackage(f, [newpath], 1) + folder = fs_encode(self.getConfig("folder")) + + try: + if not exists(join(folder, "finished")): + makedirs(join(folder, "finished")) + + if self.getConfig("watch_file"): + with open(fs_encode(self.getConfig("file")), "a+") as f: + content = f.read().strip() + + if content: + name = "%s_%s.txt" % (self.getConfig("file"), time.strftime("%H-%M-%S_%d%b%Y")) + + with open(save_join(folder, "finished", name), "wb") as f: + f.write(content) + + self.core.api.addPackage(f.name, [f.name], 1) + + for f in listdir(folder): + path = join(folder, f) + + if not isfile(path) or f.endswith("~") or f.startswith("#") or f.startswith("."): + continue + + newpath = join(folder, "finished", f if self.getConfig("keep") else "tmp_" + f) + move(path, newpath) + + self.logInfo(_("Added %s from HotFolder") % f) + self.core.api.addPackage(f, [newpath], 1) + + except IOError, e: + self.logError(str(e)) -- cgit v1.2.3 From 59f72bfc5ed721c80c821bd0ca1bc8daf0d49880 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sun, 9 Nov 2014 03:12:41 +0100 Subject: Code cosmetics --- module/plugins/hooks/BypassCaptcha.py | 2 +- module/plugins/hooks/CaptchaBrotherhood.py | 2 +- module/plugins/hooks/DeathByCaptcha.py | 2 +- module/plugins/hooks/ExpertDecoders.py | 2 +- module/plugins/hooks/ExtractArchive.py | 8 ++++---- module/plugins/hooks/HotFolder.py | 6 +++--- module/plugins/hooks/ImageTyperz.py | 2 +- module/plugins/hooks/WindowsPhoneToastNotify.py | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index 4e287668b..b8b55ac63 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -49,7 +49,7 @@ class BypassCaptcha(Hook): def setup(self): - self.info = {} + self.info = {} #@TODO: Remove in 0.4.10 def getCredits(self): diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py index 8033ad544..eb0bd9e67 100644 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ b/module/plugins/hooks/CaptchaBrotherhood.py @@ -55,7 +55,7 @@ class CaptchaBrotherhood(Hook): def setup(self): - self.info = {} + self.info = {} #@TODO: Remove in 0.4.10 def getCredits(self): diff --git a/module/plugins/hooks/DeathByCaptcha.py b/module/plugins/hooks/DeathByCaptcha.py index 0b584c632..42495f5fb 100644 --- a/module/plugins/hooks/DeathByCaptcha.py +++ b/module/plugins/hooks/DeathByCaptcha.py @@ -68,7 +68,7 @@ class DeathByCaptcha(Hook): def setup(self): - self.info = {} + self.info = {} #@TODO: Remove in 0.4.10 def call_api(self, api="captcha", post=False, multipart=False): diff --git a/module/plugins/hooks/ExpertDecoders.py b/module/plugins/hooks/ExpertDecoders.py index a4ae6fa89..faaba6906 100644 --- a/module/plugins/hooks/ExpertDecoders.py +++ b/module/plugins/hooks/ExpertDecoders.py @@ -30,7 +30,7 @@ class ExpertDecoders(Hook): def setup(self): - self.info = {} + self.info = {} #@TODO: Remove in 0.4.10 def getCredits(self): diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 39da1ee7b..f5f30fc52 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -309,16 +309,16 @@ class ExtractArchive(Hook): def reloadPasswords(self): passwordfile = self.getConfig("passwordfile") - + try: passwords = [] with open(passwordfile, "a+") as f: for pw in f.read().splitlines(): passwords.append(pw) - + except IOError, e: self.logError(str(e)) - + else: self.passwords = passwords @@ -330,7 +330,7 @@ class ExtractArchive(Hook): if pw in self.passwords: self.passwords.remove(pw) - + self.passwords.insert(0, pw) try: diff --git a/module/plugins/hooks/HotFolder.py b/module/plugins/hooks/HotFolder.py index 5e9dd9547..15a8f43d5 100644 --- a/module/plugins/hooks/HotFolder.py +++ b/module/plugins/hooks/HotFolder.py @@ -31,7 +31,7 @@ class HotFolder(Hook): def periodical(self): folder = fs_encode(self.getConfig("folder")) - + try: if not exists(join(folder, "finished")): makedirs(join(folder, "finished")) @@ -39,7 +39,7 @@ class HotFolder(Hook): if self.getConfig("watch_file"): with open(fs_encode(self.getConfig("file")), "a+") as f: content = f.read().strip() - + if content: name = "%s_%s.txt" % (self.getConfig("file"), time.strftime("%H-%M-%S_%d%b%Y")) @@ -59,6 +59,6 @@ class HotFolder(Hook): self.logInfo(_("Added %s from HotFolder") % f) self.core.api.addPackage(f, [newpath], 1) - + except IOError, e: self.logError(str(e)) diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py index c0a573c5c..8d253c249 100644 --- a/module/plugins/hooks/ImageTyperz.py +++ b/module/plugins/hooks/ImageTyperz.py @@ -51,7 +51,7 @@ class ImageTyperz(Hook): def setup(self): - self.info = {} + self.info = {} #@TODO: Remove in 0.4.10 def getCredits(self): diff --git a/module/plugins/hooks/WindowsPhoneToastNotify.py b/module/plugins/hooks/WindowsPhoneToastNotify.py index 746aa188d..053ea47d0 100644 --- a/module/plugins/hooks/WindowsPhoneToastNotify.py +++ b/module/plugins/hooks/WindowsPhoneToastNotify.py @@ -22,7 +22,7 @@ class WindowsPhoneToastNotify(Hook): def setup(self): - self.info = {} + self.info = {} #@TODO: Remove in 0.4.10 def getXmlData(self): -- cgit v1.2.3 From 92fbe511be5cbcc96f2d286c25ffd552e4940f3b Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sun, 9 Nov 2014 16:16:08 +0100 Subject: [Captcha9kw] Fix indentation --- module/plugins/hooks/Captcha9kw.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index af12ca830..e831d977c 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -17,7 +17,7 @@ from module.plugins.Hook import Hook class Captcha9kw(Hook): __name__ = "Captcha9kw" __type__ = "hook" - __version__ = "0.14" + __version__ = "0.15" __config__ = [("activated", "bool", "Activated", True), ("force", "bool", "Force captcha resolving even if client is connected", True), @@ -176,12 +176,12 @@ class Captcha9kw(Hook): hoster_options = self.getConfig("hoster_options").split(";") pluginname = re.search(r'_([^_]*)_\d+.\w+', task.captchaFile).group(1) - if 1000 > queue > 10: - servercheck = getURL("http://www.9kw.eu/grafik/servercheck.txt") + if 1000 > queue > 10: + servercheck = getURL("http://www.9kw.eu/grafik/servercheck.txt") regex = re.compile("queue=(\d+)") - for _ in xrange(3): - if queue < regex.search(servercheck).group(1): + for _ in xrange(3): + if queue < regex.search(servercheck).group(1): break sleep(10) @@ -201,9 +201,9 @@ class Captcha9kw(Hook): timeout = int(hosteroption[1]) task.handler.append(self) - + task.setWaiting(timeout) - + start_new_thread(self._processCaptcha, (task,)) -- cgit v1.2.3 From c9e31d875d32de31e54959b82bc35eff2b3e0f3f Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Mon, 10 Nov 2014 00:19:51 +0100 Subject: Code cosmetics --- module/plugins/hooks/BypassCaptcha.py | 24 ++++++++-------- module/plugins/hooks/Captcha9kw.py | 2 +- module/plugins/hooks/CaptchaBrotherhood.py | 34 +++++++++++----------- module/plugins/hooks/DeathByCaptcha.py | 46 ++++++++++++++++-------------- module/plugins/hooks/ExpertDecoders.py | 18 ++++++------ module/plugins/hooks/ExtractArchive.py | 16 +++++------ module/plugins/hooks/HotFolder.py | 2 +- module/plugins/hooks/IRCInterface.py | 2 +- module/plugins/hooks/ImageTyperz.py | 45 ++++++++++++++++------------- module/plugins/hooks/LinkdecrypterCom.py | 2 +- module/plugins/hooks/RPNetBiz.py | 6 ++-- module/plugins/hooks/XMPPInterface.py | 2 +- 12 files changed, 103 insertions(+), 96 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index b8b55ac63..7e1ea6424 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -53,9 +53,9 @@ class BypassCaptcha(Hook): def getCredits(self): - response = getURL(self.GETCREDITS_URL, post={"key": self.getConfig("passkey")}) + res = getURL(self.GETCREDITS_URL, post={"key": self.getConfig("passkey")}) - data = dict([x.split(' ', 1) for x in response.splitlines()]) + data = dict([x.split(' ', 1) for x in res.splitlines()]) return int(data['Left']) @@ -66,18 +66,18 @@ class BypassCaptcha(Hook): req.c.setopt(LOW_SPEED_TIME, 80) try: - response = req.load(self.SUBMIT_URL, - post={"vendor_key": self.PYLOAD_KEY, - "key": self.getConfig("passkey"), - "gen_task_id": "1", - "file": (FORM_FILE, captcha)}, - multipart=True) + res = req.load(self.SUBMIT_URL, + post={'vendor_key': self.PYLOAD_KEY, + 'key': self.getConfig("passkey"), + 'gen_task_id': "1", + 'file': (FORM_FILE, captcha)}, + multipart=True) finally: req.close() - data = dict([x.split(' ', 1) for x in response.splitlines()]) + data = dict([x.split(' ', 1) for x in res.splitlines()]) if not data or "Value" not in data: - raise BypassCaptchaException(response) + raise BypassCaptchaException(res) result = data['Value'] ticket = data['TaskId'] @@ -88,10 +88,10 @@ class BypassCaptcha(Hook): def respond(self, ticket, success): try: - response = getURL(self.RESPOND_URL, post={"task_id": ticket, "key": self.getConfig("passkey"), + res = getURL(self.RESPOND_URL, post={"task_id": ticket, "key": self.getConfig("passkey"), "cv": 1 if success else 0}) except BadHeader, e: - self.logError(_("Could not send response"), str(e)) + self.logError(_("Could not send response"), e) def newCaptchaTask(self, task): diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index e831d977c..c8f034847 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -64,7 +64,7 @@ class Captcha9kw(Hook): with open(task.captchaFile, 'rb') as f: data = f.read() except IOError, e: - self.logError(str(e)) + self.logError(e) return data = b64encode(data) diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py index eb0bd9e67..2ebeb1734 100644 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ b/module/plugins/hooks/CaptchaBrotherhood.py @@ -59,12 +59,12 @@ class CaptchaBrotherhood(Hook): def getCredits(self): - response = getURL(self.API_URL + "askCredits.aspx", - get={"username": self.getConfig("username"), "password": self.getConfig("passkey")}) - if not response.startswith("OK"): - raise CaptchaBrotherhoodException(response) + res = getURL(self.API_URL + "askCredits.aspx", + get={"username": self.getConfig("username"), "password": self.getConfig("passkey")}) + if not res.startswith("OK"): + raise CaptchaBrotherhoodException(res) else: - credits = int(response[3:]) + credits = int(res[3:]) self.logInfo(_("%d credits left") % credits) self.info['credits'] = credits return credits @@ -101,35 +101,35 @@ class CaptchaBrotherhood(Hook): try: req.c.perform() - response = req.getResponse() + res = req.getResponse() except Exception, e: raise CaptchaBrotherhoodException("Submit captcha image failed") req.close() - if not response.startswith("OK"): - raise CaptchaBrotherhoodException(response[1]) + if not res.startswith("OK"): + raise CaptchaBrotherhoodException(res[1]) - ticket = response[3:] + ticket = res[3:] for _i in xrange(15): sleep(5) - response = self.get_api("askCaptchaResult", ticket) - if response.startswith("OK-answered"): - return ticket, response[12:] + res = self.get_api("askCaptchaResult", ticket) + if res.startswith("OK-answered"): + return ticket, res[12:] raise CaptchaBrotherhoodException("No solution received in time") def get_api(self, api, ticket): - response = getURL("%s%s.aspx" % (self.API_URL, api), + res = getURL("%s%s.aspx" % (self.API_URL, api), get={"username": self.getConfig("username"), "password": self.getConfig("passkey"), "captchaID": ticket}) - if not response.startswith("OK"): - raise CaptchaBrotherhoodException("Unknown response: %s" % response) + if not res.startswith("OK"): + raise CaptchaBrotherhoodException("Unknown response: %s" % res) - return response + return res def newCaptchaTask(self, task): @@ -156,7 +156,7 @@ class CaptchaBrotherhood(Hook): def captchaInvalid(self, task): if task.data['service'] == self.__name__ and "ticket" in task.data: - response = self.get_api("complainCaptcha", task.data['ticket']) + res = self.get_api("complainCaptcha", task.data['ticket']) def processCaptcha(self, task): diff --git a/module/plugins/hooks/DeathByCaptcha.py b/module/plugins/hooks/DeathByCaptcha.py index 42495f5fb..df09769ce 100644 --- a/module/plugins/hooks/DeathByCaptcha.py +++ b/module/plugins/hooks/DeathByCaptcha.py @@ -81,18 +81,18 @@ class DeathByCaptcha(Hook): post.update({"username": self.getConfig("username"), "password": self.getConfig("passkey")}) - response = None + res = None try: json = req.load("%s%s" % (self.API_URL, api), post=post, multipart=multipart) self.logDebug(json) - response = json_loads(json) + res = json_loads(json) - if "error" in response: - raise DeathByCaptchaException(response['error']) - elif "status" not in response: - raise DeathByCaptchaException(str(response)) + if "error" in res: + raise DeathByCaptchaException(res['error']) + elif "status" not in res: + raise DeathByCaptchaException(str(res)) except BadHeader, e: if 403 == e.code: @@ -109,24 +109,24 @@ class DeathByCaptcha(Hook): finally: req.close() - return response + return res def getCredits(self): - response = self.call_api("user", True) + res = self.call_api("user", True) - if 'is_banned' in response and response['is_banned']: + if 'is_banned' in res and res['is_banned']: raise DeathByCaptchaException('banned') - elif 'balance' in response and 'rate' in response: - self.info.update(response) + elif 'balance' in res and 'rate' in res: + self.info.update(res) else: - raise DeathByCaptchaException(response) + raise DeathByCaptchaException(res) def getStatus(self): - response = self.call_api("status", False) + res = self.call_api("status", False) - if 'is_service_overloaded' in response and response['is_service_overloaded']: + if 'is_service_overloaded' in res and res['is_service_overloaded']: raise DeathByCaptchaException('service-overload') @@ -141,21 +141,21 @@ class DeathByCaptcha(Hook): data = f.read() data = "base64:" + b64encode(data) - response = self.call_api("captcha", {"captchafile": data}, multipart) + res = self.call_api("captcha", {"captchafile": data}, multipart) - if "captcha" not in response: - raise DeathByCaptchaException(response) - ticket = response['captcha'] + if "captcha" not in res: + raise DeathByCaptchaException(res) + ticket = res['captcha'] for _i in xrange(24): sleep(5) - response = self.call_api("captcha/%d" % ticket, False) - if response['text'] and response['is_correct']: + res = self.call_api("captcha/%d" % ticket, False) + if res['text'] and res['is_correct']: break else: raise DeathByCaptchaException('timed-out') - result = response['text'] + result = res['text'] self.logDebug("Result %s : %s" % (ticket, result)) return ticket, result @@ -196,9 +196,11 @@ class DeathByCaptcha(Hook): def captchaInvalid(self, task): if task.data['service'] == self.__name__ and "ticket" in task.data: try: - response = self.call_api("captcha/%d/report" % task.data['ticket'], True) + res = self.call_api("captcha/%d/report" % task.data['ticket'], True) + except DeathByCaptchaException, e: self.logError(e.getDesc()) + except Exception, e: self.logError(e) diff --git a/module/plugins/hooks/ExpertDecoders.py b/module/plugins/hooks/ExpertDecoders.py index faaba6906..1b9459eb6 100644 --- a/module/plugins/hooks/ExpertDecoders.py +++ b/module/plugins/hooks/ExpertDecoders.py @@ -34,14 +34,14 @@ class ExpertDecoders(Hook): def getCredits(self): - response = getURL(self.API_URL, post={"key": self.getConfig("passkey"), "action": "balance"}) + res = getURL(self.API_URL, post={"key": self.getConfig("passkey"), "action": "balance"}) - if response.isdigit(): - self.logInfo(_("%s credits left") % response) - self.info['credits'] = credits = int(response) + if res.isdigit(): + self.logInfo(_("%s credits left") % res) + self.info['credits'] = credits = int(res) return credits else: - self.logError(response) + self.logError(res) return 0 @@ -90,9 +90,9 @@ class ExpertDecoders(Hook): if "ticket" in task.data: try: - response = getURL(self.API_URL, post={"action": "refund", "key": self.getConfig("passkey"), - "gen_task_id": task.data['ticket']}) - self.logInfo(_("Request refund"), response) + res = getURL(self.API_URL, + post={'action': "refund", 'key': self.getConfig("passkey"), 'gen_task_id': task.data['ticket']}) + self.logInfo(_("Request refund", res) except BadHeader, e: - self.logError(_("Could not send refund request"), str(e)) + self.logError(_("Could not send refund request"), e) diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index f5f30fc52..11c44a6d1 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -98,12 +98,12 @@ class ExtractArchive(Hook): if e.errno == 2: self.logInfo(_("No %s installed") % p) else: - self.logWarning(_("Could not activate %s") % p, str(e)) + self.logWarning(_("Could not activate %s") % p, e) if self.core.debug: print_exc() except Exception, e: - self.logWarning(_("Could not activate %s") % p, str(e)) + self.logWarning(_("Could not activate %s") % p, e) if self.core.debug: print_exc() @@ -202,7 +202,7 @@ class ExtractArchive(Hook): password = p.password.strip().splitlines() new_files = self._extract(klass, fid, password, thread) except Exception, e: - self.logError(basename(target), str(e)) + self.logError(basename(target), e) success = False continue @@ -289,13 +289,13 @@ class ExtractArchive(Hook): return extracted_files except ArchiveError, e: - self.logError(basename(plugin.file), _("Archive Error"), str(e)) + self.logError(basename(plugin.file), _("Archive Error"), e) except CRCError: self.logError(basename(plugin.file), _("CRC Mismatch")) except Exception, e: if self.core.debug: print_exc() - self.logError(basename(plugin.file), _("Unknown Error"), str(e)) + self.logError(basename(plugin.file), _("Unknown Error"), e) self.manager.dispatchEvent("archive_extract_failed", pyfile) raise Exception(_("Extract failed")) @@ -317,7 +317,7 @@ class ExtractArchive(Hook): passwords.append(pw) except IOError, e: - self.logError(str(e)) + self.logError(e) else: self.passwords = passwords @@ -338,7 +338,7 @@ class ExtractArchive(Hook): for pw in self.passwords: f.write(pw + "\n") except IOError, e: - self.logError(str(e)) + self.logError(e) def setPermissions(self, files): @@ -357,4 +357,4 @@ class ExtractArchive(Hook): gid = getgrnam(self.config['permission']['group'])[2] chown(f, uid, gid) except Exception, e: - self.logWarning(_("Setting User and Group failed"), str(e)) + self.logWarning(_("Setting User and Group failed"), e) diff --git a/module/plugins/hooks/HotFolder.py b/module/plugins/hooks/HotFolder.py index 15a8f43d5..518bbac2b 100644 --- a/module/plugins/hooks/HotFolder.py +++ b/module/plugins/hooks/HotFolder.py @@ -61,4 +61,4 @@ class HotFolder(Hook): self.core.api.addPackage(f, [newpath], 1) except IOError, e: - self.logError(str(e)) + self.logError(e) diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index 4d0cd1619..98edc2f7f 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -187,7 +187,7 @@ class IRCInterface(Thread, Hook): for line in res: self.response(line, msg['origin']) except Exception, e: - self.logError(str(e)) + self.logError(e) def response(self, msg, origin=""): diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py index 8d253c249..b00c5118f 100644 --- a/module/plugins/hooks/ImageTyperz.py +++ b/module/plugins/hooks/ImageTyperz.py @@ -55,18 +55,20 @@ class ImageTyperz(Hook): def getCredits(self): - response = getURL(self.GETCREDITS_URL, post={"action": "REQUESTBALANCE", "username": self.getConfig("username"), - "password": self.getConfig("passkey")}) + res = getURL(self.GETCREDITS_URL, + post={'action': "REQUESTBALANCE", + 'username': self.getConfig("username"), + 'password': self.getConfig("passkey")}) - if response.startswith('ERROR'): - raise ImageTyperzException(response) + if res.startswith('ERROR'): + raise ImageTyperzException(res) try: - balance = float(response) + balance = float(res) except: - raise ImageTyperzException("invalid response") + raise ImageTyperzException("Invalid response") - self.logInfo(_("Account balance: $%s left") % response) + self.logInfo(_("Account balance: $%s left") % res) return balance @@ -86,21 +88,22 @@ class ImageTyperz(Hook): data = f.read() data = b64encode(data) - response = req.load(self.SUBMIT_URL, post={"action": "UPLOADCAPTCHA", - "username": self.getConfig("username"), - "password": self.getConfig("passkey"), "file": data}, - multipart=multipart) + res = req.load(self.SUBMIT_URL, + post={'action': "UPLOADCAPTCHA", + 'username': self.getConfig("username"), + 'password': self.getConfig("passkey"), "file": data}, + multipart=multipart) finally: req.close() - if response.startswith("ERROR"): - raise ImageTyperzException(response) + if res.startswith("ERROR"): + raise ImageTyperzException(res) else: - data = response.split('|') + data = res.split('|') if len(data) == 2: ticket, result = data else: - raise ImageTyperzException("Unknown response %s" % response) + raise ImageTyperzException("Unknown response: %s" % res) return ticket, result @@ -130,14 +133,16 @@ class ImageTyperz(Hook): def captchaInvalid(self, task): if task.data['service'] == self.__name__ and "ticket" in task.data: - response = getURL(self.RESPOND_URL, post={"action": "SETBADIMAGE", "username": self.getConfig("username"), - "password": self.getConfig("passkey"), - "imageid": task.data['ticket']}) + res = getURL(self.RESPOND_URL, + post={'action': "SETBADIMAGE", + 'username': self.getConfig("username"), + 'password': self.getConfig("passkey"), + 'imageid': task.data['ticket']}) - if response == "SUCCESS": + if res == "SUCCESS": self.logInfo(_("Bad captcha solution received, requested refund")) else: - self.logError(_("Bad captcha solution received, refund request failed"), response) + self.logError(_("Bad captcha solution received, refund request failed"), res) def processCaptcha(self, task): diff --git a/module/plugins/hooks/LinkdecrypterCom.py b/module/plugins/hooks/LinkdecrypterCom.py index 6194f67f1..0c5f6e754 100644 --- a/module/plugins/hooks/LinkdecrypterCom.py +++ b/module/plugins/hooks/LinkdecrypterCom.py @@ -21,7 +21,7 @@ class LinkdecrypterCom(Hook): try: self.loadPatterns() except Exception, e: - self.logError(str(e)) + self.logError(e) def loadPatterns(self): diff --git a/module/plugins/hooks/RPNetBiz.py b/module/plugins/hooks/RPNetBiz.py index 94c7dbff7..01591354d 100644 --- a/module/plugins/hooks/RPNetBiz.py +++ b/module/plugins/hooks/RPNetBiz.py @@ -28,9 +28,9 @@ class RPNetBiz(MultiHoster): # Get account data (user, data) = self.account.selectAccount() - response = getURL("https://premium.rpnet.biz/client_api.php", - get={"username": user, "password": data['password'], "action": "showHosterList"}) - hoster_list = json_loads(response) + res = getURL("https://premium.rpnet.biz/client_api.php", + get={"username": user, "password": data['password'], "action": "showHosterList"}) + hoster_list = json_loads(res) # If account is not valid thera are no hosters available if 'error' in hoster_list: diff --git a/module/plugins/hooks/XMPPInterface.py b/module/plugins/hooks/XMPPInterface.py index e23398023..bbeab4341 100644 --- a/module/plugins/hooks/XMPPInterface.py +++ b/module/plugins/hooks/XMPPInterface.py @@ -168,7 +168,7 @@ class XMPPInterface(IRCInterface, JabberClient): messages.append(m) except Exception, e: - self.logError(str(e)) + self.logError(e) return messages -- cgit v1.2.3 From fa6662c3352d4eea43b42e66fc80cabcc85709e9 Mon Sep 17 00:00:00 2001 From: Velociraptor85 <Velociraptor85@users.noreply.github.com> Date: Mon, 10 Nov 2014 23:00:53 +0100 Subject: Format error in Default config see Hoster Options --- module/plugins/hooks/Captcha9kw.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index c8f034847..11fbf6448 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -17,7 +17,7 @@ from module.plugins.Hook import Hook class Captcha9kw(Hook): __name__ = "Captcha9kw" __type__ = "hook" - __version__ = "0.15" + __version__ = "0.16" __config__ = [("activated", "bool", "Activated", True), ("force", "bool", "Force captcha resolving even if client is connected", True), @@ -25,7 +25,7 @@ class Captcha9kw(Hook): ("captchaperhour", "int", "Captcha per hour", "9999"), ("prio", "int", "Priority (max. 20)(Cost +0 -> +20)", "0"), ("queue", "int", "Max. Queue (max. 999)", "0"), - ("hoster_options", "string", "Hoster options (Format: pluginname:prio=1:selfsolfe=1:confirm=1:timeout=900;)", "ShareonlineBiz:prio=0:timeout=999;UploadedTo:prio=0:timeout=999;SerienjunkiesOrg:prio=1:min=3;max=3;timeout=90"), + ("hoster_options", "string", "Hoster options (Format: pluginname:prio=1:selfsolfe=1:confirm=1:timeout=900;)", "ShareonlineBiz:prio=0:timeout=999;UploadedTo:prio=0:timeout=999;SerienjunkiesOrg:prio=1:min=3:max=3:timeout=90;"), ("selfsolve", "bool", "If enabled and you have a 9kw client active only you will get your captcha to solve it (Selfsolve)", "0"), ("passkey", "password", "API key", ""), ("timeout", "int", "Timeout (min. 60s, max. 3999s)", "900")] -- cgit v1.2.3 From 5f8d4cd870dc9865184266b4b256c529a414d425 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Mon, 10 Nov 2014 23:28:20 +0100 Subject: [Captcha9kw] Improve __config__ --- module/plugins/hooks/Captcha9kw.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index 11fbf6448..e7816168d 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -17,18 +17,18 @@ from module.plugins.Hook import Hook class Captcha9kw(Hook): __name__ = "Captcha9kw" __type__ = "hook" - __version__ = "0.16" + __version__ = "0.17" __config__ = [("activated", "bool", "Activated", True), ("force", "bool", "Force captcha resolving even if client is connected", True), - ("confirm", "bool", "Confirm Captcha (Cost +6)", False), + ("confirm", "bool", "Confirm Captcha (cost +6 credits)", False), ("captchaperhour", "int", "Captcha per hour", "9999"), - ("prio", "int", "Priority (max. 20)(Cost +0 -> +20)", "0"), - ("queue", "int", "Max. Queue (max. 999)", "0"), - ("hoster_options", "string", "Hoster options (Format: pluginname:prio=1:selfsolfe=1:confirm=1:timeout=900;)", "ShareonlineBiz:prio=0:timeout=999;UploadedTo:prio=0:timeout=999;SerienjunkiesOrg:prio=1:min=3:max=3:timeout=90;"), - ("selfsolve", "bool", "If enabled and you have a 9kw client active only you will get your captcha to solve it (Selfsolve)", "0"), + ("prio", "int", "Priority (max 20)(cost +0 -> +20 credits)", "0"), + ("queue", "int", "Max. Queue (max 999)", "0"), + ("hoster_options", "string", "Hoster options (format: pluginname:prio=1:selfsolfe=1:confirm=1:timeout=900|...)", "ShareonlineBiz:prio=0:timeout=999 | UploadedTo:prio=0:timeout=999"), + ("selfsolve", "bool", "Selfsolve (manually solve your captcha in your 9kw client if active)", "0"), ("passkey", "password", "API key", ""), - ("timeout", "int", "Timeout (min. 60s, max. 3999s)", "900")] + ("timeout", "int", "Timeout in seconds (min 60, max 3999)", "900")] __description__ = """Send captchas to 9kw.eu""" __license__ = "GPLv3" @@ -84,10 +84,10 @@ class Captcha9kw(Hook): 'timeout' : min(max(self.getConfig("timeout") * 60, 300), 3999), 'selfsolve' : self.getConfig("selfsolve"), 'cph' : self.getConfig("captchaperhour"), - 'hoster_options' : self.getConfig("hoster_options").split(";")} + 'hoster_options' : self.getConfig("hoster_options").split('|')} for opt in hoster_options: - details = opt.split(":") + details = map(strip(), opt.split(':')) if not details or details[0].lower() != pluginname.lower(): continue @@ -173,7 +173,7 @@ class Captcha9kw(Hook): queue = self.getConfig("queue") timeout = min(max(self.getConfig("timeout") * 60, 300), 3999) - hoster_options = self.getConfig("hoster_options").split(";") + hoster_options = self.getConfig("hoster_options").split('|') pluginname = re.search(r'_([^_]*)_\d+.\w+', task.captchaFile).group(1) if 1000 > queue > 10: @@ -187,7 +187,7 @@ class Captcha9kw(Hook): sleep(10) for opt in hoster_options: - details = opt.split(":") + details = map(strip(), opt.split(':')) if not details or details[0].lower() != pluginname.lower(): continue -- cgit v1.2.3 From 21c1b73162fb45d2fe67465fd14ea638832786c1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 11 Nov 2014 00:18:32 +0100 Subject: [UpdateManager] Fix version representation --- module/plugins/hooks/UpdateManager.py | 47 +++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 18 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 08ba40cd3..8f93657bf 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -14,7 +14,7 @@ from module.utils import save_join class UpdateManager(Hook): __name__ = "UpdateManager" __type__ = "hook" - __version__ = "0.38" + __version__ = "0.39" __config__ = [("activated", "bool", "Activated", True), ("mode", "pyLoad + plugins;plugins only", "Check updates for", "pyLoad + plugins"), @@ -42,6 +42,7 @@ class UpdateManager(Hook): self.initPeriodical() else: self.logDebug("Invalid interval value, kept current") + elif name == "reloadplugins": if self.cb2: self.core.scheduler.removeJob(self.cb2) @@ -60,16 +61,17 @@ class UpdateManager(Hook): def setup(self): - self.cb2 = None + self.cb2 = None self.interval = self.MIN_INTERVAL self.updating = False - self.info = {'pyload': False, 'version': None, 'plugins': False} - self.mtimes = {} #: store modification time for each plugin + self.info = {'pyload': False, 'version': None, 'plugins': False} + self.mtimes = {} #: store modification time for each plugin def periodical2(self): if not self.updating: self.autoreloadPlugins() + self.cb2 = self.core.scheduler.addJob(4, self.periodical2, threaded=False) @@ -118,7 +120,9 @@ class UpdateManager(Hook): @threaded def updateThread(self): self.updating = True + status = self.update(onlyplugin=self.getConfig("mode") == "plugins only") + if status == 2: self.core.api.restart() else: @@ -135,14 +139,18 @@ class UpdateManager(Hook): def update(self, onlyplugin=False): """ check for updates """ data = self.server_request() + if not data: exitcode = 0 + elif data[0] == "None": self.logInfo(_("No new pyLoad version available")) updates = data[1:] exitcode = self._updatePlugins(updates) + elif onlyplugin: exitcode = 0 + else: newversion = data[0] self.logInfo(_("*** New pyLoad Version %s available ***") % newversion) @@ -150,6 +158,7 @@ class UpdateManager(Hook): exitcode = 3 self.info['pyload'] = True self.info['version'] = newversion + return exitcode #: 0 = No plugins updated; 1 = Plugins updated; 2 = Plugins updated, but restart required; 3 = No plugins updated, new pyLoad version available @@ -159,11 +168,13 @@ class UpdateManager(Hook): if self.info['plugins']: return False #: plugins were already updated - updated = [] + exitcode = 0 + updated = [] vre = re.compile(r'__version__.*=.*("|\')([\d.]+)') url = updates[0] schema = updates[1].split('|') + if "BLACKLIST" in updates: blacklist = updates[updates.index('BLACKLIST') + 1:] updates = updates[2:updates.index('BLACKLIST')] @@ -171,11 +182,13 @@ class UpdateManager(Hook): blacklist = None updates = updates[2:] - upgradable = sorted(map(lambda x: dict(zip(schema, x.split('|'))), updates), key=itemgetter("type", "name")) + upgradable = sorted(map(lambda x: dict(zip(schema, x.split('|'))), updates), + key=itemgetter("type", "name")) + for plugin in upgradable: filename = plugin['name'] - prefix = plugin['type'] - version = plugin['version'] + prefix = plugin['type'] + version = plugin['version'] if filename.endswith(".pyc"): name = filename[:filename.find("_")] @@ -194,22 +207,20 @@ class UpdateManager(Hook): newver = float(version) if not oldver: - msg = "New [%(type)s] %(name)s (v%(newver)s)" + msg = "New [%(type)s] %(name)s (v%(newver).2f)" elif newver > oldver: - msg = "New version of [%(type)s] %(name)s (v%(oldver)f -> v%(newver)f)" + msg = "New version of [%(type)s] %(name)s (v%(oldver).2f -> v%(newver).2f)" else: continue - self.logInfo(_(msg) % { - 'type': type, - 'name': name, - 'oldver': oldver, - 'newver': newver, - }) - + self.logInfo(_(msg) % {'type' : type, + 'name' : name, + 'oldver': oldver, + 'newver': newver}) try: content = getURL(url % plugin) m = vre.search(content) + if m and m.group(2) == version: f = open(save_join("userplugins", prefix, filename), "wb") f.write(content) @@ -217,6 +228,7 @@ class UpdateManager(Hook): updated.append((prefix, name)) else: raise Exception, _("Version mismatch") + except Exception, e: self.logError(_("Error updating plugin %s") % filename, str(e)) @@ -247,7 +259,6 @@ class UpdateManager(Hook): exitcode = 2 else: self.logInfo(_("No plugin updates available")) - exitcode = 0 return exitcode #: 0 = No plugins updated; 1 = Plugins updated; 2 = Plugins updated, but restart required -- cgit v1.2.3 From c1ef8bc0bc79c06b2351493b5f49153fa3f59980 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 11 Nov 2014 00:34:38 +0100 Subject: [Captcha9kw] Some fixes (thx Nippey) --- module/plugins/hooks/Captcha9kw.py | 62 +++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 31 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index e7816168d..cc56ad4a2 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -17,7 +17,7 @@ from module.plugins.Hook import Hook class Captcha9kw(Hook): __name__ = "Captcha9kw" __type__ = "hook" - __version__ = "0.17" + __version__ = "0.18" __config__ = [("activated", "bool", "Activated", True), ("force", "bool", "Force captcha resolving even if client is connected", True), @@ -51,7 +51,7 @@ class Captcha9kw(Hook): 'action': "usercaptchaguthaben"}) if res.isdigit(): - self.logInfo(_("%d credits left") % res) + self.logInfo(_("%s credits left") % res) credits = self.info["credits"] = int(res) return credits else: @@ -73,20 +73,20 @@ class Captcha9kw(Hook): self.logDebug("%s: %s" % (task.captchaFile, data)) - option = {'min' : 2, - 'max' : 50, - 'phrase' : 0, - 'numeric' : 0, - 'case_sensitive' : 0, - 'math' : 0, - 'prio' : self.getConfig("prio"), - 'confirm' : self.getConfig("confirm"), - 'timeout' : min(max(self.getConfig("timeout") * 60, 300), 3999), - 'selfsolve' : self.getConfig("selfsolve"), - 'cph' : self.getConfig("captchaperhour"), - 'hoster_options' : self.getConfig("hoster_options").split('|')} - - for opt in hoster_options: + option = {'min' : 2, + 'max' : 50, + 'phrase' : 0, + 'numeric' : 0, + 'case_sensitive': 0, + 'math' : 0, + 'prio' : self.getConfig("prio"), + 'confirm' : self.getConfig("confirm"), + 'timeout' : min(max(self.getConfig("timeout") * 60, 300), 3999), + 'selfsolve' : self.getConfig("selfsolve"), + 'cph' : self.getConfig("captchaperhour")} + + for opt in self.getConfig("hoster_options").split('|'): + details = map(strip(), opt.split(':')) if not details or details[0].lower() != pluginname.lower(): @@ -104,17 +104,17 @@ class Captcha9kw(Hook): for _ in xrange(5): post_data = {'apikey' : self.getConfig("passkey"), - 'prio' : prio_option, - 'confirm' : confirm_option, - 'maxtimeout' : timeout_option, - 'selfsolve' : selfsolve_option, - 'captchaperhour': cph_option, - 'case-sensitive': case_sensitive_option, - 'min_len' : min_option, - 'max_len' : max_option, - 'phrase' : phrase_option, - 'numeric' : numeric_option, - 'math' : math_option, + 'prio' : option['prio'], + 'confirm' : option['confirm'], + 'maxtimeout' : option['timeout'], + 'selfsolve' : option['selfsolve'], + 'captchaperhour': option['cph'], + 'case-sensitive': option['case_sensitive'], + 'min_len' : option['min'], + 'max_len' : option['max'], + 'phrase' : option['phrase'], + 'numeric' : option['numeric'], + 'math' : option['math'], 'oldsource' : pluginname, 'pyload' : "1", 'source' : "pyload", @@ -173,7 +173,6 @@ class Captcha9kw(Hook): queue = self.getConfig("queue") timeout = min(max(self.getConfig("timeout") * 60, 300), 3999) - hoster_options = self.getConfig("hoster_options").split('|') pluginname = re.search(r'_([^_]*)_\d+.\w+', task.captchaFile).group(1) if 1000 > queue > 10: @@ -186,7 +185,8 @@ class Captcha9kw(Hook): sleep(10) - for opt in hoster_options: + for opt in self.getConfig("hoster_options").split('|'): + details = map(strip(), opt.split(':')) if not details or details[0].lower() != pluginname.lower(): @@ -234,8 +234,8 @@ class Captcha9kw(Hook): def captchaCorrect(self, task): - self._captchaResponse(self, task, True) + self._captchaResponse(task, True) def captchaInvalid(self, task): - self._captchaResponse(self, task, False) + self._captchaResponse(task, False) -- cgit v1.2.3 From ed52ca7df9dbd4d8b9538219bd76d2cc603e8bf1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Wed, 12 Nov 2014 01:29:53 +0100 Subject: [Captcha9kw] Code improvements --- module/plugins/hooks/Captcha9kw.py | 119 +++++++++++++++++-------------------- 1 file changed, 56 insertions(+), 63 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index cc56ad4a2..bdccf2f76 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -17,14 +17,14 @@ from module.plugins.Hook import Hook class Captcha9kw(Hook): __name__ = "Captcha9kw" __type__ = "hook" - __version__ = "0.18" + __version__ = "0.19" __config__ = [("activated", "bool", "Activated", True), ("force", "bool", "Force captcha resolving even if client is connected", True), ("confirm", "bool", "Confirm Captcha (cost +6 credits)", False), ("captchaperhour", "int", "Captcha per hour", "9999"), - ("prio", "int", "Priority (max 20)(cost +0 -> +20 credits)", "0"), - ("queue", "int", "Max. Queue (max 999)", "0"), + ("prio", "int", "Priority (max 10)(cost +0 -> +10 credits)", "0"), + ("queue", "int", "Max. Queue (max 999)", "50"), ("hoster_options", "string", "Hoster options (format: pluginname:prio=1:selfsolfe=1:confirm=1:timeout=900|...)", "ShareonlineBiz:prio=0:timeout=999 | UploadedTo:prio=0:timeout=999"), ("selfsolve", "bool", "Selfsolve (manually solve your captcha in your 9kw client if active)", "0"), ("passkey", "password", "API key", ""), @@ -63,6 +63,7 @@ class Captcha9kw(Hook): try: with open(task.captchaFile, 'rb') as f: data = f.read() + except IOError, e: self.logError(e) return @@ -79,7 +80,7 @@ class Captcha9kw(Hook): 'numeric' : 0, 'case_sensitive': 0, 'math' : 0, - 'prio' : self.getConfig("prio"), + 'prio' : min(max(self.getConfig("prio"), 0), 10), 'confirm' : self.getConfig("confirm"), 'timeout' : min(max(self.getConfig("timeout") * 60, 300), 3999), 'selfsolve' : self.getConfig("selfsolve"), @@ -95,41 +96,44 @@ class Captcha9kw(Hook): for d in details: hosteroption = d.split("=") - if len(hosteroption) <= 1 or not hosteroption[1].isdigit(): + if len(hosteroption) < 2 or not hosteroption[1].isdigit(): continue o = hosteroption[0].lower() if o in option: option[o] = hosteroption[1] + break + + post_data = {'apikey' : self.getConfig("passkey"), + 'prio' : option['prio'], + 'confirm' : option['confirm'], + 'maxtimeout' : option['timeout'], + 'selfsolve' : option['selfsolve'], + 'captchaperhour': option['cph'], + 'case-sensitive': option['case_sensitive'], + 'min_len' : option['min'], + 'max_len' : option['max'], + 'phrase' : option['phrase'], + 'numeric' : option['numeric'], + 'math' : option['math'], + 'oldsource' : pluginname, + 'pyload' : "1", + 'source' : "pyload", + 'base64' : "1", + 'mouse' : mouse, + 'file-upload-01': data, + 'action' : "usercaptchaupload"} + for _ in xrange(5): - post_data = {'apikey' : self.getConfig("passkey"), - 'prio' : option['prio'], - 'confirm' : option['confirm'], - 'maxtimeout' : option['timeout'], - 'selfsolve' : option['selfsolve'], - 'captchaperhour': option['cph'], - 'case-sensitive': option['case_sensitive'], - 'min_len' : option['min'], - 'max_len' : option['max'], - 'phrase' : option['phrase'], - 'numeric' : option['numeric'], - 'math' : option['math'], - 'oldsource' : pluginname, - 'pyload' : "1", - 'source' : "pyload", - 'base64' : "1", - 'mouse' : mouse, - 'file-upload-01': data, - 'action' : "usercaptchaupload"} try: res = getURL(self.API_URL, post=post_data) - if res: - break except BadHeader, e: sleep(3) - - if not res.isdigit(): + else: + if res and res.isdigit(): + break + else: self.logError(_("Bad upload: %s") % res) return @@ -138,55 +142,39 @@ class Captcha9kw(Hook): task.data["ticket"] = res self.logInfo("result %s : %s" % (res, result)) - for _ in xrange(int(self.getConfig("timeout") / 5)): - res2 = getURL(self.API_URL, - get={'apikey': self.getConfig("passkey"), - 'id' : res, - 'pyload': "1", - 'info' : "1", - 'source': "pyload", - 'action': "usercaptchacorrectdata"}) - - if not res2 or res2 == "NO DATA": - sleep(5) - else: - break - - task.setResult(res2 or None) + task.setResult(self._captchaResponse(task)) def newCaptchaTask(self, task): if not task.isTextual() and not task.isPositional(): return - elif not self.getConfig("passkey"): + if not self.getConfig("passkey"): return - elif self.core.isClientConnected() and not self.getConfig("force"): + if self.core.isClientConnected() and not self.getConfig("force"): return credits = self.getCredits() if not credits: - self.logError(_("Your Captcha 9kw.eu Account has not enough credits")) + self.logError(_("Your captcha 9kw.eu account has not enough credits")) return - queue = self.getConfig("queue") + queue = min(self.getConfig("queue"), 999) timeout = min(max(self.getConfig("timeout") * 60, 300), 3999) pluginname = re.search(r'_([^_]*)_\d+.\w+', task.captchaFile).group(1) - if 1000 > queue > 10: + for _ in xrange(5): servercheck = getURL("http://www.9kw.eu/grafik/servercheck.txt") - regex = re.compile("queue=(\d+)") - - for _ in xrange(3): - if queue < regex.search(servercheck).group(1): - break + if queue < re.search(r'queue=(\d+)', servercheck).group(1): + break - sleep(10) + sleep(10) + else: + self.fail(_("Too many captchas in queue")) for opt in self.getConfig("hoster_options").split('|'): - details = map(strip(), opt.split(':')) if not details or details[0].lower() != pluginname.lower(): @@ -200,16 +188,18 @@ class Captcha9kw(Hook): and hosteroption[1].isdigit()): timeout = int(hosteroption[1]) + break + task.handler.append(self) task.setWaiting(timeout) - start_new_thread(self._processCaptcha, (task,)) + self._processCaptcha(task) - def _captchaResponse(self, task, correct): + def _captchaResponse(self, task, correct=True): if "ticket" not in task.data: - self.logDebug(_("No CaptchaID for %s request (task: %s)" % type) % task) + self.logDebug("No CaptchaID for %s request (task: %s)" % type % task) return type = "correct" if correct else "refund" @@ -225,12 +215,15 @@ class Captcha9kw(Hook): 'source' : "pyload", 'id' : task.data["ticket"]}) - if res is "OK": - self.logInfo(_("Request %s: %s" % type) % res) - return + self.logDebug("Request %s: %s" % type % res) + + if not res or res is "NO DATA": + self.logDebug("Could not send %s request: %s" % type % res) + sleep(5) else: - self.logDebug(_("Could not send %s request: %s" % type) % res) - sleep(1) + return res + else: + return None def captchaCorrect(self, task): -- cgit v1.2.3 From 7699d4b88c6245bd31d94ff0b5954cdd7c08ca73 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Wed, 12 Nov 2014 01:55:00 +0100 Subject: [Captcha9kw] Fix str.strip --- module/plugins/hooks/Captcha9kw.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index bdccf2f76..ff604080d 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -17,7 +17,7 @@ from module.plugins.Hook import Hook class Captcha9kw(Hook): __name__ = "Captcha9kw" __type__ = "hook" - __version__ = "0.19" + __version__ = "0.20" __config__ = [("activated", "bool", "Activated", True), ("force", "bool", "Force captcha resolving even if client is connected", True), @@ -88,7 +88,7 @@ class Captcha9kw(Hook): for opt in self.getConfig("hoster_options").split('|'): - details = map(strip(), opt.split(':')) + details = map(str.strip, opt.split(':')) if not details or details[0].lower() != pluginname.lower(): continue @@ -175,7 +175,7 @@ class Captcha9kw(Hook): self.fail(_("Too many captchas in queue")) for opt in self.getConfig("hoster_options").split('|'): - details = map(strip(), opt.split(':')) + details = map(str.strip, opt.split(':')) if not details or details[0].lower() != pluginname.lower(): continue -- cgit v1.2.3 From 9084b84b92b4e1a23d599872356d4a67c2c2b980 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Wed, 12 Nov 2014 02:25:05 +0100 Subject: [Captcha9kw] Fix str.strip 2 --- module/plugins/hooks/Captcha9kw.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index ff604080d..327878ab7 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -17,7 +17,7 @@ from module.plugins.Hook import Hook class Captcha9kw(Hook): __name__ = "Captcha9kw" __type__ = "hook" - __version__ = "0.20" + __version__ = "0.21" __config__ = [("activated", "bool", "Activated", True), ("force", "bool", "Force captcha resolving even if client is connected", True), @@ -86,7 +86,7 @@ class Captcha9kw(Hook): 'selfsolve' : self.getConfig("selfsolve"), 'cph' : self.getConfig("captchaperhour")} - for opt in self.getConfig("hoster_options").split('|'): + for opt in str(self.getConfig("hoster_options").split('|')): details = map(str.strip, opt.split(':')) @@ -174,7 +174,7 @@ class Captcha9kw(Hook): else: self.fail(_("Too many captchas in queue")) - for opt in self.getConfig("hoster_options").split('|'): + for opt in str(self.getConfig("hoster_options").split('|')): details = map(str.strip, opt.split(':')) if not details or details[0].lower() != pluginname.lower(): -- cgit v1.2.3 From ef40c9a735946e5ecba2d18d6ee1ad23a149f9b6 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Wed, 12 Nov 2014 14:24:11 +0100 Subject: [Captcha9kw] Fix some stuff (thx stefanos) --- module/plugins/hooks/Captcha9kw.py | 48 +++++++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 14 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index 327878ab7..2ea0aeb72 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -17,7 +17,7 @@ from module.plugins.Hook import Hook class Captcha9kw(Hook): __name__ = "Captcha9kw" __type__ = "hook" - __version__ = "0.21" + __version__ = "0.22" __config__ = [("activated", "bool", "Activated", True), ("force", "bool", "Force captcha resolving even if client is connected", True), @@ -82,7 +82,7 @@ class Captcha9kw(Hook): 'math' : 0, 'prio' : min(max(self.getConfig("prio"), 0), 10), 'confirm' : self.getConfig("confirm"), - 'timeout' : min(max(self.getConfig("timeout") * 60, 300), 3999), + 'timeout' : min(max(self.getConfig("timeout"), 300), 3999), 'selfsolve' : self.getConfig("selfsolve"), 'cph' : self.getConfig("captchaperhour")} @@ -140,9 +140,27 @@ class Captcha9kw(Hook): self.logInfo(_("NewCaptchaID from upload: %s : %s") % (res, task.captchaFile)) task.data["ticket"] = res - self.logInfo("result %s : %s" % (res, result)) - task.setResult(self._captchaResponse(task)) + for _ in xrange(int(self.getConfig("timeout") / 5)): + result = getURL(self.API_URL, + get={'apikey': self.getConfig("passkey"), + 'id' : res, + 'pyload': "1", + 'info' : "1", + 'source': "pyload", + 'action': "usercaptchacorrectdata"}) + + if not result or result == "NO DATA": + sleep(5) + else: + break + else: + self.logDebug("Could not send request: %s" % res) + result = None + + self.logInfo(_("Result: %s : %s") % (res, result)) + + task.setResult(result) def newCaptchaTask(self, task): @@ -162,7 +180,7 @@ class Captcha9kw(Hook): return queue = min(self.getConfig("queue"), 999) - timeout = min(max(self.getConfig("timeout") * 60, 300), 3999) + timeout = min(max(self.getConfig("timeout"), 300), 3999) pluginname = re.search(r'_([^_]*)_\d+.\w+', task.captchaFile).group(1) for _ in xrange(5): @@ -197,12 +215,13 @@ class Captcha9kw(Hook): self._processCaptcha(task) - def _captchaResponse(self, task, correct=True): - if "ticket" not in task.data: - self.logDebug("No CaptchaID for %s request (task: %s)" % type % task) + def _captchaResponse(self, task, correct): + type = "correct" if correct else "refund" + + if 'ticket' not in task.data: + self.logDebug("No CaptchaID for %s request (task: %s)" % (type, task)) return - type = "correct" if correct else "refund" passkey = self.getConfig("passkey") for _ in xrange(3): @@ -215,13 +234,14 @@ class Captcha9kw(Hook): 'source' : "pyload", 'id' : task.data["ticket"]}) - self.logDebug("Request %s: %s" % type % res) + self.logDebug("Request %s: %s" % (type, res)) - if not res or res is "NO DATA": - self.logDebug("Could not send %s request: %s" % type % res) - sleep(5) + if res is "OK": + self.logInfo(_("Request %s: %s" % type) % res) + return else: - return res + self.logDebug("Could not send %s request: %s" % (type, res)) + sleep(5) else: return None -- cgit v1.2.3 From add077c49cc722ba277de941df0d1544db57df32 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Wed, 12 Nov 2014 16:04:47 +0100 Subject: [Captcha9kw] Fix typo --- module/plugins/hooks/Captcha9kw.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index 2ea0aeb72..a6ec18475 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -17,7 +17,7 @@ from module.plugins.Hook import Hook class Captcha9kw(Hook): __name__ = "Captcha9kw" __type__ = "hook" - __version__ = "0.22" + __version__ = "0.23" __config__ = [("activated", "bool", "Activated", True), ("force", "bool", "Force captcha resolving even if client is connected", True), @@ -125,7 +125,7 @@ class Captcha9kw(Hook): 'file-upload-01': data, 'action' : "usercaptchaupload"} - for _ in xrange(5): + for _i in xrange(5): try: res = getURL(self.API_URL, post=post_data) except BadHeader, e: @@ -141,7 +141,7 @@ class Captcha9kw(Hook): task.data["ticket"] = res - for _ in xrange(int(self.getConfig("timeout") / 5)): + for _i in xrange(int(self.getConfig("timeout") / 5)): result = getURL(self.API_URL, get={'apikey': self.getConfig("passkey"), 'id' : res, @@ -183,7 +183,7 @@ class Captcha9kw(Hook): timeout = min(max(self.getConfig("timeout"), 300), 3999) pluginname = re.search(r'_([^_]*)_\d+.\w+', task.captchaFile).group(1) - for _ in xrange(5): + for _i in xrange(5): servercheck = getURL("http://www.9kw.eu/grafik/servercheck.txt") if queue < re.search(r'queue=(\d+)', servercheck).group(1): break @@ -224,7 +224,7 @@ class Captcha9kw(Hook): passkey = self.getConfig("passkey") - for _ in xrange(3): + for _i in xrange(3): res = getURL(self.API_URL, get={'action' : "usercaptchacorrectback", 'apikey' : passkey, -- cgit v1.2.3 From 0f86cba679c796f35c9e3fa27c00e011ffd9bc92 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Wed, 12 Nov 2014 16:50:36 +0100 Subject: [Captcha9kw] Restore https feature + code cosmetics --- module/plugins/hooks/Captcha9kw.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index a6ec18475..77375fb8b 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -17,9 +17,10 @@ from module.plugins.Hook import Hook class Captcha9kw(Hook): __name__ = "Captcha9kw" __type__ = "hook" - __version__ = "0.23" + __version__ = "0.24" __config__ = [("activated", "bool", "Activated", True), + ("ssl", "bool", "Use HTTPS", True), ("force", "bool", "Force captcha resolving even if client is connected", True), ("confirm", "bool", "Confirm Captcha (cost +6 credits)", False), ("captchaperhour", "int", "Captcha per hour", "9999"), @@ -41,6 +42,8 @@ class Captcha9kw(Hook): def setup(self): self.info = {} #@TODO: Remove in 0.4.10 + if self.getConfig("ssl"): + self.API_URL = self.API_URL.replace("http://", "https://") def getCredits(self): @@ -72,8 +75,6 @@ class Captcha9kw(Hook): mouse = 1 if task.isPositional() else 0 pluginname = re.search(r'_([^_]*)_\d+.\w+', task.captchaFile).group(1) - self.logDebug("%s: %s" % (task.captchaFile, data)) - option = {'min' : 2, 'max' : 50, 'phrase' : 0, @@ -137,7 +138,7 @@ class Captcha9kw(Hook): self.logError(_("Bad upload: %s") % res) return - self.logInfo(_("NewCaptchaID from upload: %s : %s") % (res, task.captchaFile)) + self.logDebug(_("NewCaptchaID ticket: %s") % res, task.captchaFile) task.data["ticket"] = res @@ -158,7 +159,7 @@ class Captcha9kw(Hook): self.logDebug("Could not send request: %s" % res) result = None - self.logInfo(_("Result: %s : %s") % (res, result)) + self.logInfo(_("Captcha result for ticket %s: %s") % (res, result)) task.setResult(result) @@ -236,14 +237,12 @@ class Captcha9kw(Hook): self.logDebug("Request %s: %s" % (type, res)) - if res is "OK": - self.logInfo(_("Request %s: %s" % type) % res) - return - else: - self.logDebug("Could not send %s request: %s" % (type, res)) - sleep(5) + if res == "OK": + break + + sleep(5) else: - return None + self.logDebug("Could not send %s request: %s" % (type, res)) def captchaCorrect(self, task): -- cgit v1.2.3 From 71c9121e0479db4ac1cb34ac4b4881e9b291772c Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Thu, 13 Nov 2014 01:01:41 +0100 Subject: Spare code cosmetics --- module/plugins/hooks/UpdateManager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 8f93657bf..3fda0b5e8 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -207,9 +207,9 @@ class UpdateManager(Hook): newver = float(version) if not oldver: - msg = "New [%(type)s] %(name)s (v%(newver).2f)" + msg = "New plugin: [%(type)s] %(name)s (v%(newver).2f)" elif newver > oldver: - msg = "New version of [%(type)s] %(name)s (v%(oldver).2f -> v%(newver).2f)" + msg = "New version of plugin: [%(type)s] %(name)s (v%(oldver).2f -> v%(newver).2f)" else: continue -- cgit v1.2.3 From 8f02f78f4ffa8f4aef604b905e3fd06e1647a359 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sun, 23 Nov 2014 05:55:21 +0100 Subject: [XFileSharingPro] Improve hooks patterns --- module/plugins/hooks/XFileSharingPro.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index ddc20b98a..47163d2fd 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.22" + __version__ = "0.23" __config__ = [("activated", "bool", "Activated", True), ("use_hoster_list", "bool", "Load listed hosters only", False), @@ -23,8 +23,8 @@ class XFileSharingPro(Hook): # event_list = ["pluginConfigChanged"] - regexp = {'hoster' : (r'https?://(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:embed-)?\w{12}', - r'https?://(?:[^/]+\.)?(%s)/(?:embed-)?\w{12}\W?'), + regexp = {'hoster' : (r'https?://(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:embed-)?\w{12}(?:[\W_ ]|$)', + r'https?://(?:[^/]+\.)?(%s)/(?:embed-)?\w+'), 'crypter': (r'https?://(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:user|folder)s?/\w+', r'https?://(?:[^/]+\.)?(%s)/(?:user|folder)s?/\w+')} -- cgit v1.2.3 From f47b649a005045e62bc34720c0d39c4cfb8edaa3 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sun, 23 Nov 2014 12:54:15 +0100 Subject: [BasePlugin] Fix typo --- module/plugins/hooks/XFileSharingPro.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 47163d2fd..fd1fa760e 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -23,7 +23,7 @@ class XFileSharingPro(Hook): # event_list = ["pluginConfigChanged"] - regexp = {'hoster' : (r'https?://(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:embed-)?\w{12}(?:[\W_ ]|$)', + regexp = {'hoster' : (r'https?://(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:embed-)?\w{12}(?:\W|$)', r'https?://(?:[^/]+\.)?(%s)/(?:embed-)?\w+'), 'crypter': (r'https?://(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:user|folder)s?/\w+', r'https?://(?:[^/]+\.)?(%s)/(?:user|folder)s?/\w+')} -- cgit v1.2.3 From 325d5dd81226c9e1ca58e0e9e72052ed08b1ff50 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Mon, 24 Nov 2014 01:10:05 +0100 Subject: [XFileSharingPro] Temp disable universal hook feature --- module/plugins/hooks/XFileSharingPro.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index fd1fa760e..ab5086664 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,11 +8,11 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.23" + __version__ = "0.24" __config__ = [("activated", "bool", "Activated", True), - ("use_hoster_list", "bool", "Load listed hosters only", False), - ("use_crypter_list", "bool", "Load listed crypters only", False), + ("use_hoster_list", "bool", "Load listed hosters only", True), + ("use_crypter_list", "bool", "Load listed crypters only", True), ("use_builtin_list", "bool", "Load built-in plugin list", True), ("hoster_list", "str", "Hoster list (comma separated)", ""), ("crypter_list", "str", "Crypter list (comma separated)", "")] -- cgit v1.2.3 From b71a408f118eb1117dad3c11da8bfd883e6bf28f Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Fri, 28 Nov 2014 23:56:31 +0100 Subject: [Captcha9kw] Option "Captcha per minute" (thx stefanos) --- module/plugins/hooks/Captcha9kw.py | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index 77375fb8b..38b39b2af 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -17,19 +17,20 @@ from module.plugins.Hook import Hook class Captcha9kw(Hook): __name__ = "Captcha9kw" __type__ = "hook" - __version__ = "0.24" - - __config__ = [("activated", "bool", "Activated", True), - ("ssl", "bool", "Use HTTPS", True), - ("force", "bool", "Force captcha resolving even if client is connected", True), - ("confirm", "bool", "Confirm Captcha (cost +6 credits)", False), - ("captchaperhour", "int", "Captcha per hour", "9999"), - ("prio", "int", "Priority (max 10)(cost +0 -> +10 credits)", "0"), - ("queue", "int", "Max. Queue (max 999)", "50"), - ("hoster_options", "string", "Hoster options (format: pluginname:prio=1:selfsolfe=1:confirm=1:timeout=900|...)", "ShareonlineBiz:prio=0:timeout=999 | UploadedTo:prio=0:timeout=999"), - ("selfsolve", "bool", "Selfsolve (manually solve your captcha in your 9kw client if active)", "0"), - ("passkey", "password", "API key", ""), - ("timeout", "int", "Timeout in seconds (min 60, max 3999)", "900")] + __version__ = "0.25" + + __config__ = [("activated" , "bool" , "Activated" , True ), + ("ssl" , "bool" , "Use HTTPS" , True ), + ("force" , "bool" , "Force captcha resolving even if client is connected" , True ), + ("confirm" , "bool" , "Confirm Captcha (cost +6 credits)" , False ), + ("captchaperhour", "int" , "Captcha per hour" , "9999" ), + ("captchapermin" , "int" , "Captcha per minute" , "9999" ), + ("prio" , "int" , "Priority (max 10)(cost +0 -> +10 credits)" , "0" ), + ("queue" , "int" , "Max. Queue (max 999)" , "50" ), + ("hoster_options", "string" , "Hoster options (format: pluginname:prio=1:selfsolfe=1:confirm=1:timeout=900|...)", "ShareonlineBiz:prio=0:timeout=999 | UploadedTo:prio=0:timeout=999"), + ("selfsolve" , "bool" , "Selfsolve (manually solve your captcha in your 9kw client if active)" , "0" ), + ("passkey" , "password", "API key" , "" ), + ("timeout" , "int" , "Timeout in seconds (min 60, max 3999)" , "900" )] __description__ = """Send captchas to 9kw.eu""" __license__ = "GPLv3" @@ -85,7 +86,8 @@ class Captcha9kw(Hook): 'confirm' : self.getConfig("confirm"), 'timeout' : min(max(self.getConfig("timeout"), 300), 3999), 'selfsolve' : self.getConfig("selfsolve"), - 'cph' : self.getConfig("captchaperhour")} + 'cph' : self.getConfig("captchaperhour"), + 'cpm' : self.getConfig("captchapermin")} for opt in str(self.getConfig("hoster_options").split('|')): @@ -112,6 +114,7 @@ class Captcha9kw(Hook): 'maxtimeout' : option['timeout'], 'selfsolve' : option['selfsolve'], 'captchaperhour': option['cph'], + 'captchapermin' : option['cpm'], 'case-sensitive': option['case_sensitive'], 'min_len' : option['min'], 'max_len' : option['max'], -- cgit v1.2.3 From 7e44687839660802bf35bd14a82551bae424f7ba Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sun, 30 Nov 2014 19:31:10 +0100 Subject: [UpdateManager] Option autorestart --- module/plugins/hooks/UpdateManager.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 3fda0b5e8..9c26cf5d9 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -14,13 +14,14 @@ from module.utils import save_join class UpdateManager(Hook): __name__ = "UpdateManager" __type__ = "hook" - __version__ = "0.39" + __version__ = "0.40" - __config__ = [("activated", "bool", "Activated", True), - ("mode", "pyLoad + plugins;plugins only", "Check updates for", "pyLoad + plugins"), - ("interval", "int", "Check interval in hours", 8), - ("reloadplugins", "bool", "Monitor plugins for code changes (debug mode only)", True), - ("nodebugupdate", "bool", "Don't check for updates in debug mode", True)] + __config__ = [("activated" , "bool" , "Activated" , True ), + ("mode" , "pyLoad + plugins;plugins only", "Check updates for" , "pyLoad + plugins"), + ("interval" , "int" , "Check interval in hours" , 8 ), + ("autorestart" , "bool" , "Automatically restart pyLoad when required" , True ), + ("reloadplugins", "bool" , "Monitor plugins for code changes in debug mode", True ), + ("nodebugupdate", "bool" , "Don't check for updates in debug mode" , True )] __description__ = """ Check for updates """ __license__ = "GPLv3" @@ -123,7 +124,7 @@ class UpdateManager(Hook): status = self.update(onlyplugin=self.getConfig("mode") == "plugins only") - if status == 2: + if status is 2 and self.getConfig("autorestart"): self.core.api.restart() else: self.updating = False -- cgit v1.2.3 From 86d3b6249073947132ed3a9eeb1b1e987d19569a Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Mon, 1 Dec 2014 18:17:13 +0100 Subject: Update some plugins --- module/plugins/hooks/Captcha9kw.py | 2 +- module/plugins/hooks/Checksum.py | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index 38b39b2af..ead8aec9a 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -56,7 +56,7 @@ class Captcha9kw(Hook): if res.isdigit(): self.logInfo(_("%s credits left") % res) - credits = self.info["credits"] = int(res) + credits = self.info['credits'] = int(res) return credits else: self.logError(res) diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index b746fce5f..eeda2d849 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -81,10 +81,15 @@ class Checksum(Hook): a) if known, the exact filesize in bytes (e.g. "size": 123456789) b) hexadecimal hash string with algorithm name as key (e.g. "md5": "d76505d0869f9f928a17d42d66326307") """ - if hasattr(pyfile.plugin, "check_data") and (isinstance(pyfile.plugin.check_data, dict)): + if hasattr(pyfile.plugin, "check_data") and isinstance(pyfile.plugin.check_data, dict): data = pyfile.plugin.check_data.copy() - elif hasattr(pyfile.plugin, "api_data") and (isinstance(pyfile.plugin.api_data, dict)): + + elif hasattr(pyfile.plugin, "api_data") and isinstance(pyfile.plugin.api_data, dict): data = pyfile.plugin.api_data.copy() + + # elif hasattr(pyfile.plugin, "info") and isinstance(pyfile.plugin.info, dict): + # data = pyfile.plugin.info.copy() + else: return -- cgit v1.2.3 From 2d77bbe784e5f107a3823f5b780e879478d1b37a Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 2 Dec 2014 12:36:47 +0100 Subject: New addon RestartSlow --- module/plugins/hooks/RestartSlow.py | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 module/plugins/hooks/RestartSlow.py (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/RestartSlow.py b/module/plugins/hooks/RestartSlow.py new file mode 100644 index 000000000..0e9e213de --- /dev/null +++ b/module/plugins/hooks/RestartSlow.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- + +from pycurl import LOW_SPEED_LIMIT, LOW_SPEED_TIME + +from module.plugins.Hook import Hook + + +class RestartSlow(Hook): + __name__ = "RestartSlow" + __type__ = "hook" + __version__ = "0.01" + + __config__ = [("free_limit" , "int", "Transfer speed threshold in kilobytes" , 100 ), + ("free_time" , "int", "Sample interval in minutes" , 5 ), + ("premium_limit", "int", "Transfer speed threshold for premium download in kilobytes", 300 ), + ("premium_time" , "int", "Sample interval for premium download in minutes" , 2 ), + ("safe" , "bool", "Restart if download is resumable" , True)] + + __description__ = """Restart slow downloads""" + __license__ = "GPLv3" + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + + + event_list = ["downloadStarts"] + + + def downloadStarts(self, pyfile, url, filename): + if self.getConfig("safe") and not pyfile.plugin.resumeDownload: + return + + type = "premium" if pyfile.plugin.premium else "free" + + pyfile.plugin.req.http.c.setopt(LOW_SPEED_TIME, max(30, self.getConfig("%s_time" % type) * 60)) + pyfile.plugin.req.http.c.setopt(LOW_SPEED_LIMIT, max(5, self.getConfig("%s_limit" % type) * 1024)) + + + def downloadFailed(self, pyfile): + pyfile.plugin.req.http.c.setopt(LOW_SPEED_TIME, 30) + pyfile.plugin.req.http.c.setopt(LOW_SPEED_LIMIT, 5) -- cgit v1.2.3 From 9ad979dc5b3753e2982855495b240b3da37c3be4 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 2 Dec 2014 12:37:56 +0100 Subject: [SkipRev] Updated --- module/plugins/hooks/SkipRev.py | 56 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 module/plugins/hooks/SkipRev.py (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py new file mode 100644 index 000000000..3b3b450fe --- /dev/null +++ b/module/plugins/hooks/SkipRev.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- + +import re + +from module.plugins.Hook import Hook +from module.plugins.Plugin import SkipDownload + + +class SkipRev(Hook): + __name__ = "SkipRev" + __type__ = "hook" + __version__ = "0.08" + + __config__ = [("auto", "bool", "Automatically keep all rev files needed by package", True) + ("tokeep", "int" , "Min number of rev files to keep for package" , 1), + ("unskip", "bool", "Restart a skipped rev when download fails" , True)] + + __description__ = """Skip files ending with extension rev""" + __license__ = "GPLv3" + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + + + event_map = [("downloadStarts", skipRev)] + + REV = re.compile(r'\.part(\d+)\.rev$') + + + def skipRev(self, pyfile, url, filename): + if REV.search(pyfile.name) is None or pyfile.getStatusName is "unskipped": + return + + tokeep = self.getConfig("tokeep") + + if tokeep > 0: + saved = [True if link.hasStatus("finished") or link.hasStatus("downloading") and REV.search(link.name) \ + for link in pyfile.package().getChildren()].count(True) + + if saved < tokeep: + return + + raise SkipDownload("SkipRev") + + + def downloadFailed(self, pyfile): + if self.getConfig("auto") is False: + + if self.getConfig("unskip") is False: + return + + if REV.search(pyfile.name) is None: + return + + for link in pyfile.package().getChildren(): + if link.hasStatus("skipped") and REV.search(link.name): + link.setCustomStatus("unskipped", "queued") + break -- cgit v1.2.3 From a611ddfd1d8e4a85b2066cc45bc51682ac10a5f7 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 2 Dec 2014 16:35:12 +0100 Subject: [SkipRev] Fixup 1 --- module/plugins/hooks/SkipRev.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py index 3b3b450fe..e9cfa2ec5 100644 --- a/module/plugins/hooks/SkipRev.py +++ b/module/plugins/hooks/SkipRev.py @@ -9,10 +9,10 @@ from module.plugins.Plugin import SkipDownload class SkipRev(Hook): __name__ = "SkipRev" __type__ = "hook" - __version__ = "0.08" + __version__ = "0.09" - __config__ = [("auto", "bool", "Automatically keep all rev files needed by package", True) - ("tokeep", "int" , "Min number of rev files to keep for package" , 1), + __config__ = [("auto", "bool", "Automatically keep all rev files needed by package", True), + ("tokeep", "int" , "Min number of rev files to keep for package" , 1), ("unskip", "bool", "Restart a skipped rev when download fails" , True)] __description__ = """Skip files ending with extension rev""" @@ -53,4 +53,4 @@ class SkipRev(Hook): for link in pyfile.package().getChildren(): if link.hasStatus("skipped") and REV.search(link.name): link.setCustomStatus("unskipped", "queued") - break + return -- cgit v1.2.3 From a5a6cc0643c562a0d3e55a8577b4fc391009ff2b Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 2 Dec 2014 17:00:36 +0100 Subject: [SkipRev] Typo --- module/plugins/hooks/SkipRev.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py index e9cfa2ec5..a64f1a83b 100644 --- a/module/plugins/hooks/SkipRev.py +++ b/module/plugins/hooks/SkipRev.py @@ -9,7 +9,7 @@ from module.plugins.Plugin import SkipDownload class SkipRev(Hook): __name__ = "SkipRev" __type__ = "hook" - __version__ = "0.09" + __version__ = "0.10" __config__ = [("auto", "bool", "Automatically keep all rev files needed by package", True), ("tokeep", "int" , "Min number of rev files to keep for package" , 1), @@ -26,7 +26,7 @@ class SkipRev(Hook): def skipRev(self, pyfile, url, filename): - if REV.search(pyfile.name) is None or pyfile.getStatusName is "unskipped": + if REV.search(pyfile.name) is None or pyfile.getStatusName() is "unskipped": return tokeep = self.getConfig("tokeep") -- cgit v1.2.3 From c2a07e6237f46a55212cb2a9da3b07d8ee04812e Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 2 Dec 2014 23:29:49 +0100 Subject: [UpdateManager] Fix https://github.com/pyload/pyload/issues/940 --- module/plugins/hooks/UpdateManager.py | 67 ++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 32 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 9c26cf5d9..c69052ece 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -14,7 +14,7 @@ from module.utils import save_join class UpdateManager(Hook): __name__ = "UpdateManager" __type__ = "hook" - __version__ = "0.40" + __version__ = "0.41" __config__ = [("activated" , "bool" , "Activated" , True ), ("mode" , "pyLoad + plugins;plugins only", "Check updates for" , "pyLoad + plugins"), @@ -30,8 +30,9 @@ class UpdateManager(Hook): # event_list = ["pluginConfigChanged"] - SERVER_URL = "http://updatemanager.pyload.org" - MIN_INTERVAL = 6 * 60 * 60 #: 6h minimum check interval (value is in seconds) + SERVER_URL = "http://updatemanager.pyload.org" + VERSION = re.compile(r'__version__.*=.*("|\')([\d.]+)') + MIN_INTERVAL = 3 * 60 * 60 #: 3h minimum check interval (value is in seconds) def pluginConfigChanged(self, plugin, name, value): @@ -172,21 +173,39 @@ class UpdateManager(Hook): exitcode = 0 updated = [] - vre = re.compile(r'__version__.*=.*("|\')([\d.]+)') - url = updates[0] + url = updates[0] schema = updates[1].split('|') if "BLACKLIST" in updates: + updates = updates[2:updates.index('BLACKLIST')] blacklist = updates[updates.index('BLACKLIST') + 1:] - updates = updates[2:updates.index('BLACKLIST')] else: + updates = updates[2:] blacklist = None - updates = updates[2:] - upgradable = sorted(map(lambda x: dict(zip(schema, x.split('|'))), updates), - key=itemgetter("type", "name")) + upgradable = [dict(zip(schema, x.split('|'))) for x in updates] + blacklisted = [(x.split('|')[0], x.split('|')[1].rsplit('.', 1)[0]) for x in blacklist] if blacklist else [] - for plugin in upgradable: + if blacklist: + # Protect UpdateManager from self-removing + try: + blacklisted.remove(("hook", "UpdateManager")) + except: + pass + + for t, n in blacklisted: + for idx, plugin in enumerate(upgradable): + if n == plugin['name'] and t == plugin['type']: + upgradable.pop(idx) + break + + for t, n in self.removePlugins(sorted(blacklisted)): + self.logInfo(_("Removed blacklisted plugin [%(type)s] %(name)s") % { + 'type': t, + 'name': n, + }) + + for plugin in sorted(upgradable, key=itemgetter("type", "name")): filename = plugin['name'] prefix = plugin['type'] version = plugin['version'] @@ -208,9 +227,9 @@ class UpdateManager(Hook): newver = float(version) if not oldver: - msg = "New plugin: [%(type)s] %(name)s (v%(newver).2f)" + msg = "New plugin [%(type)s] %(name)s (v%(newver).2f)" elif newver > oldver: - msg = "New version of plugin: [%(type)s] %(name)s (v%(oldver).2f -> v%(newver).2f)" + msg = "New version of plugin [%(type)s] %(name)s (v%(oldver).2f -> v%(newver).2f)" else: continue @@ -220,12 +239,12 @@ class UpdateManager(Hook): 'newver': newver}) try: content = getURL(url % plugin) - m = vre.search(content) + m = VERSION.search(content) if m and m.group(2) == version: - f = open(save_join("userplugins", prefix, filename), "wb") - f.write(content) - f.close() + with open(save_join("userplugins", prefix, filename), "wb") as f: + f.write(content) + updated.append((prefix, name)) else: raise Exception, _("Version mismatch") @@ -233,22 +252,6 @@ class UpdateManager(Hook): except Exception, e: self.logError(_("Error updating plugin %s") % filename, str(e)) - if blacklist: - blacklisted = sorted(map(lambda x: (x.split('|')[0], x.split('|')[1].rsplit('.', 1)[0]), blacklist)) - - # Always protect UpdateManager from self-removing - try: - blacklisted.remove(("hook", "UpdateManager")) - except: - pass - - removed = self.removePlugins(blacklisted) - for t, n in removed: - self.logInfo(_("Removed blacklisted plugin [%(type)s] %(name)s") % { - 'type': t, - 'name': n, - }) - if updated: reloaded = self.core.pluginManager.reloadPlugins(updated) if reloaded: -- cgit v1.2.3 From 588e9dd13c18bcacdc4de8bb9106f1aa279d1e27 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Wed, 3 Dec 2014 00:27:34 +0100 Subject: [UpdateManager] Fix https://github.com/pyload/pyload/issues/940 (2) --- module/plugins/hooks/UpdateManager.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index c69052ece..a47742ab5 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -177,11 +177,11 @@ class UpdateManager(Hook): schema = updates[1].split('|') if "BLACKLIST" in updates: - updates = updates[2:updates.index('BLACKLIST')] blacklist = updates[updates.index('BLACKLIST') + 1:] + updates = updates[2:updates.index('BLACKLIST')] else: - updates = updates[2:] blacklist = None + updates = updates[2:] upgradable = [dict(zip(schema, x.split('|'))) for x in updates] blacklisted = [(x.split('|')[0], x.split('|')[1].rsplit('.', 1)[0]) for x in blacklist] if blacklist else [] @@ -227,9 +227,9 @@ class UpdateManager(Hook): newver = float(version) if not oldver: - msg = "New plugin [%(type)s] %(name)s (v%(newver).2f)" + msg = "New plugin: [%(type)s] %(name)s (v%(newver).2f)" elif newver > oldver: - msg = "New version of plugin [%(type)s] %(name)s (v%(oldver).2f -> v%(newver).2f)" + msg = "New version of plugin: [%(type)s] %(name)s (v%(oldver).2f -> v%(newver).2f)" else: continue @@ -239,7 +239,7 @@ class UpdateManager(Hook): 'newver': newver}) try: content = getURL(url % plugin) - m = VERSION.search(content) + m = self.VERSION.search(content) if m and m.group(2) == version: with open(save_join("userplugins", prefix, filename), "wb") as f: @@ -250,7 +250,7 @@ class UpdateManager(Hook): raise Exception, _("Version mismatch") except Exception, e: - self.logError(_("Error updating plugin %s") % filename, str(e)) + self.logError(_("Error updating plugin: %s") % filename, str(e)) if updated: reloaded = self.core.pluginManager.reloadPlugins(updated) -- cgit v1.2.3 From 69add4e0f3df7f078eafa022e9a59ac21cfaa19b Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Wed, 3 Dec 2014 00:28:06 +0100 Subject: [SkipRev] Syntax fixes --- module/plugins/hooks/SkipRev.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py index a64f1a83b..feed16a2b 100644 --- a/module/plugins/hooks/SkipRev.py +++ b/module/plugins/hooks/SkipRev.py @@ -9,7 +9,7 @@ from module.plugins.Plugin import SkipDownload class SkipRev(Hook): __name__ = "SkipRev" __type__ = "hook" - __version__ = "0.10" + __version__ = "0.11" __config__ = [("auto", "bool", "Automatically keep all rev files needed by package", True), ("tokeep", "int" , "Min number of rev files to keep for package" , 1), @@ -20,20 +20,20 @@ class SkipRev(Hook): __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - event_map = [("downloadStarts", skipRev)] + event_list = ["downloadStarts"] REV = re.compile(r'\.part(\d+)\.rev$') - def skipRev(self, pyfile, url, filename): - if REV.search(pyfile.name) is None or pyfile.getStatusName() is "unskipped": + def downloadStarts(self, pyfile, url, filename): + if self.REV.search(pyfile.name) is None or pyfile.getStatusName() is "unskipped": return tokeep = self.getConfig("tokeep") if tokeep > 0: - saved = [True if link.hasStatus("finished") or link.hasStatus("downloading") and REV.search(link.name) \ - for link in pyfile.package().getChildren()].count(True) + saved = [True for link in pyfile.package().getChildren() \ + if link.hasStatus("finished") or link.hasStatus("downloading") and self.REV.search(link.name)].count(True) if saved < tokeep: return @@ -47,10 +47,10 @@ class SkipRev(Hook): if self.getConfig("unskip") is False: return - if REV.search(pyfile.name) is None: + if self.REV.search(pyfile.name) is None: return for link in pyfile.package().getChildren(): - if link.hasStatus("skipped") and REV.search(link.name): + if link.hasStatus("skipped") and self.REV.search(link.name): link.setCustomStatus("unskipped", "queued") return -- cgit v1.2.3 From 01f8144b0e257897e94aa253a033849bdd273e34 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Fri, 5 Dec 2014 18:49:40 +0100 Subject: [UpdateManager] Fix with statement on old env like python 2.5 --- module/plugins/hooks/UpdateManager.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index a47742ab5..c72699228 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -1,5 +1,7 @@ # -*- coding: utf-8 -*- +from __future__ import with_statement + import re import sys @@ -14,7 +16,7 @@ from module.utils import save_join class UpdateManager(Hook): __name__ = "UpdateManager" __type__ = "hook" - __version__ = "0.41" + __version__ = "0.42" __config__ = [("activated" , "bool" , "Activated" , True ), ("mode" , "pyLoad + plugins;plugins only", "Check updates for" , "pyLoad + plugins"), -- cgit v1.2.3 From 52664e6fe8dd99fc9bb78ea8cf158c17705b6ded Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Fri, 5 Dec 2014 19:18:11 +0100 Subject: Fix with statement on old env like python 2.5 (2) --- module/plugins/hooks/ExtractArchive.py | 4 +++- module/plugins/hooks/HotFolder.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 11c44a6d1..07db13aa1 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -1,5 +1,7 @@ # -*- coding: utf-8 -*- +from __future__ import with_statement + import os import sys @@ -57,7 +59,7 @@ from module.utils import save_join, fs_encode class ExtractArchive(Hook): __name__ = "ExtractArchive" __type__ = "hook" - __version__ = "0.17" + __version__ = "0.18" __config__ = [("activated", "bool", "Activated", True), ("fullpath", "bool", "Extract full path", True), diff --git a/module/plugins/hooks/HotFolder.py b/module/plugins/hooks/HotFolder.py index 518bbac2b..b0b59e2ba 100644 --- a/module/plugins/hooks/HotFolder.py +++ b/module/plugins/hooks/HotFolder.py @@ -1,5 +1,7 @@ # -*- coding: utf-8 -*- +from __future__ import with_statement + import time from os import listdir, makedirs @@ -13,7 +15,7 @@ from module.utils import fs_encode, save_join class HotFolder(Hook): __name__ = "HotFolder" __type__ = "hook" - __version__ = "0.11" + __version__ = "0.12" __config__ = [("folder", "str", "Folder to observe", "container"), ("watch_file", "bool", "Observe link file", False), -- cgit v1.2.3 From 2c38c50e936b203183013b7be9907375801b5d3f Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sat, 6 Dec 2014 01:38:05 +0100 Subject: [DebridItaliaCom] Updated --- module/plugins/hooks/DebridItaliaCom.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/DebridItaliaCom.py b/module/plugins/hooks/DebridItaliaCom.py index 86d37b3bd..b7f0ef1c7 100644 --- a/module/plugins/hooks/DebridItaliaCom.py +++ b/module/plugins/hooks/DebridItaliaCom.py @@ -1,12 +1,15 @@ # -*- coding: utf-8 -*- +import re + +from module.network.RequestFactory import getURL from module.plugins.internal.MultiHoster import MultiHoster class DebridItaliaCom(MultiHoster): __name__ = "DebridItaliaCom" __type__ = "hook" - __version__ = "0.07" + __version__ = "0.08" __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("hosterList", "str", "Hoster list (comma separated)", ""), @@ -15,14 +18,10 @@ class DebridItaliaCom(MultiHoster): __description__ = """Debriditalia.com hook plugin""" __license__ = "GPLv3" - __authors__ = [("stickell", "l.stickell@yahoo.it")] + __authors__ = [("stickell", "l.stickell@yahoo.it"), + ("Walter Purcaro", "vuolter@gmail.com")] def getHoster(self): - return ["netload.in", "hotfile.com", "rapidshare.com", "multiupload.com", - "uploading.com", "megashares.com", "crocko.com", "filepost.com", - "bitshare.com", "share-links.biz", "putlocker.com", "uploaded.to", - "speedload.org", "rapidgator.net", "likeupload.net", "cyberlocker.ch", - "depositfiles.com", "extabit.com", "filefactory.com", "sharefiles.co", - "ryushare.com", "tusfiles.net", "nowvideo.co", "cloudzer.net", "letitbit.net", - "easybytez.com", "uptobox.com", "ddlstorage.com"] + html = getURL("http://www.debriditalia.com/status.php") + return re.findall(r'title="(.+?)"> \1</td><td><img src="/images/(?:attivo|testing)', html) -- cgit v1.2.3 From f000404049d065b36eeede90dbdfda6e81b604e6 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sat, 6 Dec 2014 11:03:17 +0100 Subject: [XFileSharingPro] Improve regexp --- module/plugins/hooks/XFileSharingPro.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index ab5086664..fe955beb9 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,11 +8,11 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.24" + __version__ = "0.25" __config__ = [("activated", "bool", "Activated", True), ("use_hoster_list", "bool", "Load listed hosters only", True), - ("use_crypter_list", "bool", "Load listed crypters only", True), + ("use_crypter_list", "bool", "Load listed crypters only", False), ("use_builtin_list", "bool", "Load built-in plugin list", True), ("hoster_list", "str", "Hoster list (comma separated)", ""), ("crypter_list", "str", "Crypter list (comma separated)", "")] @@ -23,9 +23,9 @@ class XFileSharingPro(Hook): # event_list = ["pluginConfigChanged"] - regexp = {'hoster' : (r'https?://(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:embed-)?\w{12}(?:\W|$)', + regexp = {'hoster' : (r'https?://(?:www\.)?([\w.^_]+(?:\.[a-zA-Z]{2,})(?:\:\d+)?)/(?:embed-)?\w{12}(?:\W|$)', r'https?://(?:[^/]+\.)?(%s)/(?:embed-)?\w+'), - 'crypter': (r'https?://(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:user|folder)s?/\w+', + 'crypter': (r'https?://(?:www\.)?([\w.^_]+(?:\.[a-zA-Z]{2,})(?:\:\d+)?)/(?:user|folder)s?/\w+', r'https?://(?:[^/]+\.)?(%s)/(?:user|folder)s?/\w+')} HOSTER_LIST = [#WORKING HOSTERS: -- cgit v1.2.3 From 88ad8e28d9405992bcf31732e5fc38bd0e88f3b4 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sat, 6 Dec 2014 17:09:51 +0100 Subject: [RestartSlow] Temp removed --- module/plugins/hooks/RestartSlow.py | 39 ------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 module/plugins/hooks/RestartSlow.py (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/RestartSlow.py b/module/plugins/hooks/RestartSlow.py deleted file mode 100644 index 0e9e213de..000000000 --- a/module/plugins/hooks/RestartSlow.py +++ /dev/null @@ -1,39 +0,0 @@ -# -*- coding: utf-8 -*- - -from pycurl import LOW_SPEED_LIMIT, LOW_SPEED_TIME - -from module.plugins.Hook import Hook - - -class RestartSlow(Hook): - __name__ = "RestartSlow" - __type__ = "hook" - __version__ = "0.01" - - __config__ = [("free_limit" , "int", "Transfer speed threshold in kilobytes" , 100 ), - ("free_time" , "int", "Sample interval in minutes" , 5 ), - ("premium_limit", "int", "Transfer speed threshold for premium download in kilobytes", 300 ), - ("premium_time" , "int", "Sample interval for premium download in minutes" , 2 ), - ("safe" , "bool", "Restart if download is resumable" , True)] - - __description__ = """Restart slow downloads""" - __license__ = "GPLv3" - __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - - - event_list = ["downloadStarts"] - - - def downloadStarts(self, pyfile, url, filename): - if self.getConfig("safe") and not pyfile.plugin.resumeDownload: - return - - type = "premium" if pyfile.plugin.premium else "free" - - pyfile.plugin.req.http.c.setopt(LOW_SPEED_TIME, max(30, self.getConfig("%s_time" % type) * 60)) - pyfile.plugin.req.http.c.setopt(LOW_SPEED_LIMIT, max(5, self.getConfig("%s_limit" % type) * 1024)) - - - def downloadFailed(self, pyfile): - pyfile.plugin.req.http.c.setopt(LOW_SPEED_TIME, 30) - pyfile.plugin.req.http.c.setopt(LOW_SPEED_LIMIT, 5) -- cgit v1.2.3 From 7c4c7d4d124b790843ccf6e8150866016e9847a9 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sat, 6 Dec 2014 18:11:58 +0100 Subject: [SkipRev] Update --- module/plugins/hooks/SkipRev.py | 42 ++++++++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 9 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py index feed16a2b..a44d20a3e 100644 --- a/module/plugins/hooks/SkipRev.py +++ b/module/plugins/hooks/SkipRev.py @@ -2,6 +2,9 @@ import re +from urllib import unquote +from urlparse import urljoin, urlparse + from module.plugins.Hook import Hook from module.plugins.Plugin import SkipDownload @@ -9,7 +12,7 @@ from module.plugins.Plugin import SkipDownload class SkipRev(Hook): __name__ = "SkipRev" __type__ = "hook" - __version__ = "0.11" + __version__ = "0.12" __config__ = [("auto", "bool", "Automatically keep all rev files needed by package", True), ("tokeep", "int" , "Min number of rev files to keep for package" , 1), @@ -20,25 +23,46 @@ class SkipRev(Hook): __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - event_list = ["downloadStarts"] + def _setup(self): + super(self.pyfile.plugin, self).setup() + if self.pyfile.hasStatus("skipped"): + raise SkipDownload(self.pyfile.getStatusName()) + + + def pyname(self, pyfile): + plugin = pyfile.plugin + + if hasattr(plugin, "info") and 'name' in plugin.info and plugin.info['name']: + name = plugin.info['name'] + + elif hasattr(plugin, "parseInfo"): + name = next(plugin.parseInfo([pyfile.url]))['name'] + + elif hasattr(plugin, "getInfo"): #@NOTE: if parseInfo was not found, getInfo should be missing too + name = plugin.getInfo(pyfile.url)['name'] + + else: + self.logWarning("Unable to grab file name") + name = urlparse(unquote(pyfile.url)).path.split('/')[-1]) - REV = re.compile(r'\.part(\d+)\.rev$') + return name - def downloadStarts(self, pyfile, url, filename): - if self.REV.search(pyfile.name) is None or pyfile.getStatusName() is "unskipped": + def downloadPreparing(self, pyfile): + if pyfile.getStatusName() is "unskipped" or not pyname(pyfile).endswith(".rev"): return tokeep = self.getConfig("tokeep") if tokeep > 0: saved = [True for link in pyfile.package().getChildren() \ - if link.hasStatus("finished") or link.hasStatus("downloading") and self.REV.search(link.name)].count(True) + if link.name.endswith(".rev") and (link.hasStatus("finished") or link.hasStatus("downloading"))].count(True) if saved < tokeep: return - raise SkipDownload("SkipRev") + pyfile.setCustomStatus("SkipRev", "skipped") + pyfile.plugin.setup = _setup #: work-around: inject status checker inside the preprocessing routine of the plugin def downloadFailed(self, pyfile): @@ -47,10 +71,10 @@ class SkipRev(Hook): if self.getConfig("unskip") is False: return - if self.REV.search(pyfile.name) is None: + if not pyfile.name.endswith(".rev"): return for link in pyfile.package().getChildren(): - if link.hasStatus("skipped") and self.REV.search(link.name): + if link.hasStatus("skipped") and link.name.endswith(".rev"): link.setCustomStatus("unskipped", "queued") return -- cgit v1.2.3 From 67587fbe0335cacfde28a86ba729b9d567ce1da7 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sun, 7 Dec 2014 00:27:18 +0100 Subject: Plugin code cosmetics (3) --- module/plugins/hooks/AlldebridCom.py | 2 +- module/plugins/hooks/EasybytezCom.py | 17 ++++++++++------- module/plugins/hooks/FastixRu.py | 5 +++-- module/plugins/hooks/FreeWayMe.py | 2 +- module/plugins/hooks/LinksnappyCom.py | 2 +- module/plugins/hooks/MegaDebridEu.py | 2 +- module/plugins/hooks/MyfastfileCom.py | 2 +- module/plugins/hooks/OverLoadMe.py | 3 +-- module/plugins/hooks/PremiumizeMe.py | 4 ++-- module/plugins/hooks/RPNetBiz.py | 2 +- module/plugins/hooks/RehostTo.py | 3 ++- module/plugins/hooks/SimplyPremiumCom.py | 2 +- module/plugins/hooks/SimplydebridCom.py | 2 +- module/plugins/hooks/UnrestrictLi.py | 2 +- module/plugins/hooks/ZeveraCom.py | 2 +- 15 files changed, 28 insertions(+), 24 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/AlldebridCom.py b/module/plugins/hooks/AlldebridCom.py index c06607a28..2d3c8aad7 100644 --- a/module/plugins/hooks/AlldebridCom.py +++ b/module/plugins/hooks/AlldebridCom.py @@ -22,6 +22,6 @@ class AlldebridCom(MultiHoster): def getHoster(self): https = "https" if self.getConfig("https") else "http" - page = getURL(https + "://www.alldebrid.com/api.php?action=get_host").replace("\"", "").strip() + page = getURL(https + "://www.alldebrid.com/api.php", get={'action': "get_host"}).replace("\"", "").strip() return [x.strip() for x in page.split(",") if x.strip()] diff --git a/module/plugins/hooks/EasybytezCom.py b/module/plugins/hooks/EasybytezCom.py index 89deaed2b..3faa4fa1a 100644 --- a/module/plugins/hooks/EasybytezCom.py +++ b/module/plugins/hooks/EasybytezCom.py @@ -23,14 +23,17 @@ class EasybytezCom(MultiHoster): user = self.account.selectAccount()[0] try: - req = self.account.getAccountRequest(user) + req = self.account.getAccountRequest(user) page = req.load("http://www.easybytez.com") - m = re.search(r'</textarea>\s*Supported sites:(.*)', page) - return m.group(1).split(',') + hosters = re.search(r'</textarea>\s*Supported sites:(.*)', page).group(1).split(',') + except Exception, e: - self.logDebug(e) self.logWarning(_("Unable to load supported hoster list, using last known")) - return ["bitshare.com", "crocko.com", "ddlstorage.com", "depositfiles.com", "extabit.com", "hotfile.com", - "mediafire.com", "netload.in", "rapidgator.net", "rapidshare.com", "uploading.com", "uload.to", - "uploaded.to"] + self.logDebug(e) + + hosters = ["bitshare.com", "crocko.com", "ddlstorage.com", "depositfiles.com", "extabit.com", "hotfile.com", + "mediafire.com", "netload.in", "rapidgator.net", "rapidshare.com", "uploading.com", "uload.to", + "uploaded.to"] + finally: + return hosters diff --git a/module/plugins/hooks/FastixRu.py b/module/plugins/hooks/FastixRu.py index fe89a190c..cec6c6f1f 100644 --- a/module/plugins/hooks/FastixRu.py +++ b/module/plugins/hooks/FastixRu.py @@ -20,8 +20,9 @@ class FastixRu(MultiHoster): def getHoster(self): - page = getURL( - "http://fastix.ru/api_v2/?apikey=5182964c3f8f9a7f0b00000a_kelmFB4n1IrnCDYuIFn2y&sub=allowed_sources") + page = getURL("http://fastix.ru/api_v2", + get={'apikey': "5182964c3f8f9a7f0b00000a_kelmFB4n1IrnCDYuIFn2y", + 'sub' : "allowed_sources"}) host_list = json_loads(page) host_list = host_list['allow'] return host_list diff --git a/module/plugins/hooks/FreeWayMe.py b/module/plugins/hooks/FreeWayMe.py index 1d7dd369e..5abec29ba 100644 --- a/module/plugins/hooks/FreeWayMe.py +++ b/module/plugins/hooks/FreeWayMe.py @@ -20,6 +20,6 @@ class FreeWayMe(MultiHoster): def getHoster(self): - hostis = getURL("https://www.free-way.me/ajax/jd.php", get={"id": 3}).replace("\"", "").strip() + hostis = getURL("https://www.free-way.me/ajax/jd.php", get={'id': 3}).replace("\"", "").strip() self.logDebug("Hosters", hostis) return [x.strip() for x in hostis.split(",") if x.strip()] diff --git a/module/plugins/hooks/LinksnappyCom.py b/module/plugins/hooks/LinksnappyCom.py index aa130f416..82edc30fd 100644 --- a/module/plugins/hooks/LinksnappyCom.py +++ b/module/plugins/hooks/LinksnappyCom.py @@ -21,7 +21,7 @@ class LinksnappyCom(MultiHoster): def getHoster(self): - json_data = getURL('http://gen.linksnappy.com/lseAPI.php?act=FILEHOSTS') + json_data = getURL("http://gen.linksnappy.com/lseAPI.php", get={'act': "FILEHOSTS"}) json_data = json_loads(json_data) return json_data['return'].keys() diff --git a/module/plugins/hooks/MegaDebridEu.py b/module/plugins/hooks/MegaDebridEu.py index d8e338aec..4f627b7e9 100644 --- a/module/plugins/hooks/MegaDebridEu.py +++ b/module/plugins/hooks/MegaDebridEu.py @@ -18,7 +18,7 @@ class MegaDebridEu(MultiHoster): def getHoster(self): - reponse = getURL('http://www.mega-debrid.eu/api.php?action=getHosters') + reponse = getURL("http://www.mega-debrid.eu/api.php", get={'action': "getHosters"}) json_data = json_loads(reponse) if json_data['response_code'] == "ok": diff --git a/module/plugins/hooks/MyfastfileCom.py b/module/plugins/hooks/MyfastfileCom.py index 07731f1c2..0cf2c6c22 100644 --- a/module/plugins/hooks/MyfastfileCom.py +++ b/module/plugins/hooks/MyfastfileCom.py @@ -21,7 +21,7 @@ class MyfastfileCom(MultiHoster): def getHoster(self): - json_data = getURL('http://myfastfile.com/api.php?hosts', decode=True) + json_data = getURL("http://myfastfile.com/api.php", get={'hosts': ""}, decode=True) self.logDebug("JSON data", json_data) json_data = json_loads(json_data) diff --git a/module/plugins/hooks/OverLoadMe.py b/module/plugins/hooks/OverLoadMe.py index f4cbdd7fe..baa9b0e0a 100644 --- a/module/plugins/hooks/OverLoadMe.py +++ b/module/plugins/hooks/OverLoadMe.py @@ -23,8 +23,7 @@ class OverLoadMe(MultiHoster): def getHoster(self): https = "https" if self.getConfig("https") else "http" page = getURL(https + "://api.over-load.me/hoster.php", - get={"auth": "0001-cb1f24dadb3aa487bda5afd3b76298935329be7700cd7-5329be77-00cf-1ca0135f"} - ).replace("\"", "").strip() + get={'auth': "0001-cb1f24dadb3aa487bda5afd3b76298935329be7700cd7-5329be77-00cf-1ca0135f"}).replace("\"", "").strip() self.logDebug("Hosterlist", page) return [x.strip() for x in page.split(",") if x.strip()] diff --git a/module/plugins/hooks/PremiumizeMe.py b/module/plugins/hooks/PremiumizeMe.py index ec21fbcb4..c18e8cf8e 100644 --- a/module/plugins/hooks/PremiumizeMe.py +++ b/module/plugins/hooks/PremiumizeMe.py @@ -30,8 +30,8 @@ class PremiumizeMe(MultiHoster): # Get supported hosters list from premiumize.me using the # json API v1 (see https://secure.premiumize.me/?show=api) - answer = getURL("https://api.premiumize.me/pm-api/v1.php?method=hosterlist¶ms[login]=%s¶ms[pass]=%s" % ( - user, data['password'])) + answer = getURL("https://api.premiumize.me/pm-api/v1.php" + get={'method': "hosterlist", 'params[login]': user, 'params[pass]': data['password']}) data = json_loads(answer) # If account is not valid thera are no hosters available diff --git a/module/plugins/hooks/RPNetBiz.py b/module/plugins/hooks/RPNetBiz.py index 01591354d..e38aa8ea0 100644 --- a/module/plugins/hooks/RPNetBiz.py +++ b/module/plugins/hooks/RPNetBiz.py @@ -29,7 +29,7 @@ class RPNetBiz(MultiHoster): (user, data) = self.account.selectAccount() res = getURL("https://premium.rpnet.biz/client_api.php", - get={"username": user, "password": data['password'], "action": "showHosterList"}) + get={'username': user, 'password': data['password'], 'action': "showHosterList"}) hoster_list = json_loads(res) # If account is not valid thera are no hosters available diff --git a/module/plugins/hooks/RehostTo.py b/module/plugins/hooks/RehostTo.py index c58abf3f3..1bf7d2555 100644 --- a/module/plugins/hooks/RehostTo.py +++ b/module/plugins/hooks/RehostTo.py @@ -20,7 +20,8 @@ class RehostTo(MultiHoster): def getHoster(self): - page = getURL("http://rehost.to/api.php?cmd=get_supported_och_dl&long_ses=%s" % self.long_ses) + page = getURL("http://rehost.to/api.php", + get={'cmd': "get_supported_och_dl", 'long_ses': self.long_ses}) return [x.strip() for x in page.replace("\"", "").split(",")] diff --git a/module/plugins/hooks/SimplyPremiumCom.py b/module/plugins/hooks/SimplyPremiumCom.py index ba0543691..cc7e9183c 100644 --- a/module/plugins/hooks/SimplyPremiumCom.py +++ b/module/plugins/hooks/SimplyPremiumCom.py @@ -22,7 +22,7 @@ class SimplyPremiumCom(MultiHoster): def getHoster(self): - json_data = getURL('http://www.simply-premium.com/api/hosts.php?format=json&online=1') + json_data = getURL("http://www.simply-premium.com/api/hosts.php", get={'format': "json", 'online': 1}) json_data = json_loads(json_data) host_list = [element['regex'] for element in json_data['result']] diff --git a/module/plugins/hooks/SimplydebridCom.py b/module/plugins/hooks/SimplydebridCom.py index 3fbc0459c..173206e75 100644 --- a/module/plugins/hooks/SimplydebridCom.py +++ b/module/plugins/hooks/SimplydebridCom.py @@ -18,5 +18,5 @@ class SimplydebridCom(MultiHoster): def getHoster(self): - page = getURL("http://simply-debrid.com/api.php?list=1") + page = getURL("http://simply-debrid.com/api.php", get={'list': 1}) return [x.strip() for x in page.rstrip(';').replace("\"", "").split(";")] diff --git a/module/plugins/hooks/UnrestrictLi.py b/module/plugins/hooks/UnrestrictLi.py index 295cfaf5a..d87265ef4 100644 --- a/module/plugins/hooks/UnrestrictLi.py +++ b/module/plugins/hooks/UnrestrictLi.py @@ -22,7 +22,7 @@ class UnrestrictLi(MultiHoster): def getHoster(self): - json_data = getURL('http://unrestrict.li/api/jdownloader/hosts.php?format=json') + json_data = getURL("http://unrestrict.li/api/jdownloader/hosts.php", get={'format': "json"}) json_data = json_loads(json_data) host_list = [element['host'] for element in json_data['result']] diff --git a/module/plugins/hooks/ZeveraCom.py b/module/plugins/hooks/ZeveraCom.py index 6ea05de4f..6fafb9666 100644 --- a/module/plugins/hooks/ZeveraCom.py +++ b/module/plugins/hooks/ZeveraCom.py @@ -18,5 +18,5 @@ class ZeveraCom(MultiHoster): def getHoster(self): - page = getURL("http://www.zevera.com/jDownloader.ashx?cmd=gethosters") + page = getURL("http://www.zevera.com/jDownloader.ashx", get={'cmd': "gethosters"}) return [x.strip() for x in page.replace("\"", "").split(",")] -- cgit v1.2.3 From 2e35201317a88f87b7a0e0ff448f3f55eb1861a9 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sun, 7 Dec 2014 14:54:27 +0100 Subject: [SkipRev] Tiny fixup --- module/plugins/hooks/SkipRev.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py index a44d20a3e..76a48a255 100644 --- a/module/plugins/hooks/SkipRev.py +++ b/module/plugins/hooks/SkipRev.py @@ -12,7 +12,7 @@ from module.plugins.Plugin import SkipDownload class SkipRev(Hook): __name__ = "SkipRev" __type__ = "hook" - __version__ = "0.12" + __version__ = "0.13" __config__ = [("auto", "bool", "Automatically keep all rev files needed by package", True), ("tokeep", "int" , "Min number of rev files to keep for package" , 1), @@ -26,24 +26,25 @@ class SkipRev(Hook): def _setup(self): super(self.pyfile.plugin, self).setup() if self.pyfile.hasStatus("skipped"): - raise SkipDownload(self.pyfile.getStatusName()) + raise SkipDownload(self.pyfile.getStatusName() or self.pyfile.pluginname) def pyname(self, pyfile): + url = pyfile.url plugin = pyfile.plugin if hasattr(plugin, "info") and 'name' in plugin.info and plugin.info['name']: name = plugin.info['name'] elif hasattr(plugin, "parseInfo"): - name = next(plugin.parseInfo([pyfile.url]))['name'] + name = next(plugin.parseInfo([url]))['name'] elif hasattr(plugin, "getInfo"): #@NOTE: if parseInfo was not found, getInfo should be missing too - name = plugin.getInfo(pyfile.url)['name'] + name = plugin.getInfo(url)['name'] else: self.logWarning("Unable to grab file name") - name = urlparse(unquote(pyfile.url)).path.split('/')[-1]) + name = urlparse(unquote(url)).path.split('/')[-1]) return name -- cgit v1.2.3 From c6a54414f340efe1d649c72786ec25c505e94172 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Mon, 8 Dec 2014 19:03:23 +0100 Subject: [RestartSlow] New fixed version re-added --- module/plugins/hooks/RestartSlow.py | 61 +++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 module/plugins/hooks/RestartSlow.py (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/RestartSlow.py b/module/plugins/hooks/RestartSlow.py new file mode 100644 index 000000000..587799235 --- /dev/null +++ b/module/plugins/hooks/RestartSlow.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- + +import pycurl + +from module.plugins.Hook import Hook + + +class RestartSlow(Hook): + __name__ = "RestartSlow" + __type__ = "hook" + __version__ = "0.02" + + __config__ = [("free_limit" , "int" , "Transfer speed threshold in kilobytes" , 100 ), + ("free_time" , "int" , "Sample interval in minutes" , 5 ), + ("premium_limit", "int" , "Transfer speed threshold for premium download in kilobytes", 300 ), + ("premium_time" , "int" , "Sample interval for premium download in minutes" , 2 ), + ("safe_mode" , "bool", "Don't restart if download is not resumable" , True)] + + __description__ = """Restart slow downloads""" + __license__ = "GPLv3" + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + + + event_list = ["downloadStarts"] + + + def setup(self): + self.info = {'chunk': {}} + + + def initPeriodical(self): + pass + + + def periodical(self): + if not self.pyfile.req.dl: + return + + if self.getConfig("safe_mode") and not self.pyfile.plugin.resumeDownload: + time = 30 + limit = 5 + else: + type = "premium" if self.pyfile.plugin.premium else "free" + time = max(30, self.getConfig("%s_time" % type) * 60) + limit = max(5, self.getConfig("%s_limit" % type) * 1024) + + chunks = [chunk for chunk in self.pyfile.req.dl.chunks \ + if chunk.id not in self.info['chunk'] or self.info['chunk'][chunk.id] not is (time, limit)] + + for chunk in chunks: + chunk.c.setopt(pycurl.LOW_SPEED_TIME , time) + chunk.c.setopt(pycurl.LOW_SPEED_LIMIT, limit) + + self.info['chunk'][chunk.id] = (time, limit) + + + def downloadStarts(self, pyfile, url, filename): + if self.cb or (self.getConfig("safe_mode") and not pyfile.plugin.resumeDownload): + return + + super(RestartSlow, self).initPeriodical() -- cgit v1.2.3 From 78e26bfd3b940034748256e4d0237e0ae5d33d60 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Mon, 8 Dec 2014 23:19:08 +0100 Subject: [SkipRev] Update (2) --- module/plugins/hooks/SkipRev.py | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py index 76a48a255..f3edcc9dc 100644 --- a/module/plugins/hooks/SkipRev.py +++ b/module/plugins/hooks/SkipRev.py @@ -1,9 +1,7 @@ # -*- coding: utf-8 -*- -import re - from urllib import unquote -from urlparse import urljoin, urlparse +from urlparse import urlparse from module.plugins.Hook import Hook from module.plugins.Plugin import SkipDownload @@ -12,11 +10,9 @@ from module.plugins.Plugin import SkipDownload class SkipRev(Hook): __name__ = "SkipRev" __type__ = "hook" - __version__ = "0.13" + __version__ = "0.14" - __config__ = [("auto", "bool", "Automatically keep all rev files needed by package", True), - ("tokeep", "int" , "Min number of rev files to keep for package" , 1), - ("unskip", "bool", "Restart a skipped rev when download fails" , True)] + __config__ = [("tokeep", "int", "Number of rev files to keep for package (-1 to auto)", -1)] __description__ = """Skip files ending with extension rev""" __license__ = "GPLv3" @@ -55,11 +51,11 @@ class SkipRev(Hook): tokeep = self.getConfig("tokeep") - if tokeep > 0: + if tokeep: saved = [True for link in pyfile.package().getChildren() \ if link.name.endswith(".rev") and (link.hasStatus("finished") or link.hasStatus("downloading"))].count(True) - if saved < tokeep: + if not saved or saved < tokeep: #: keep one rev at least in auto mode return pyfile.setCustomStatus("SkipRev", "skipped") @@ -67,15 +63,15 @@ class SkipRev(Hook): def downloadFailed(self, pyfile): - if self.getConfig("auto") is False: - - if self.getConfig("unskip") is False: - return + tokeep = self.getConfig("tokeep") - if not pyfile.name.endswith(".rev"): - return + if not tokeep: + return for link in pyfile.package().getChildren(): if link.hasStatus("skipped") and link.name.endswith(".rev"): - link.setCustomStatus("unskipped", "queued") + if tokeep > -1 or pyfile.name.endswith(".rev"): + link.setStatus("queued") + else: + link.setCustomStatus("unskipped", "queued") return -- cgit v1.2.3 From e4c9e4ffc9e3f6bd6b16ce83796dc3d275d544f7 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 9 Dec 2014 01:13:05 +0100 Subject: Don't start unused periodical in some addons --- module/plugins/hooks/BypassCaptcha.py | 7 ++++++- module/plugins/hooks/Captcha9kw.py | 7 ++++++- module/plugins/hooks/CaptchaBrotherhood.py | 7 ++++++- module/plugins/hooks/Checksum.py | 7 ++++++- module/plugins/hooks/ClickAndLoad.py | 7 ++++++- module/plugins/hooks/DeathByCaptcha.py | 7 ++++++- module/plugins/hooks/DownloadScheduler.py | 7 ++++++- module/plugins/hooks/ExpertDecoders.py | 7 ++++++- module/plugins/hooks/ExternalScripts.py | 7 ++++++- module/plugins/hooks/ExtractArchive.py | 7 ++++++- module/plugins/hooks/IRCInterface.py | 7 ++++++- module/plugins/hooks/ImageTyperz.py | 7 ++++++- module/plugins/hooks/LinkdecrypterCom.py | 7 ++++++- module/plugins/hooks/MergeFiles.py | 7 ++++++- module/plugins/hooks/MultiHome.py | 7 ++++++- module/plugins/hooks/SkipRev.py | 5 +++++ module/plugins/hooks/UnSkipOnFail.py | 7 ++++++- module/plugins/hooks/WindowsPhoneToastNotify.py | 7 ++++++- module/plugins/hooks/XFileSharingPro.py | 7 ++++++- 19 files changed, 113 insertions(+), 18 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index 7e1ea6424..a32de7f42 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -29,7 +29,7 @@ class BypassCaptchaException(Exception): class BypassCaptcha(Hook): __name__ = "BypassCaptcha" __type__ = "hook" - __version__ = "0.04" + __version__ = "0.05" __config__ = [("force", "bool", "Force BC even if client is connected", False), ("passkey", "password", "Passkey", "")] @@ -48,6 +48,11 @@ class BypassCaptcha(Hook): GETCREDITS_URL = "http://bypasscaptcha.com/ex_left.php" + #@TODO: Remove in 0.4.10 + def initPeriodical(self): + pass + + def setup(self): self.info = {} #@TODO: Remove in 0.4.10 diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index ead8aec9a..33ad00c49 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -17,7 +17,7 @@ from module.plugins.Hook import Hook class Captcha9kw(Hook): __name__ = "Captcha9kw" __type__ = "hook" - __version__ = "0.25" + __version__ = "0.26" __config__ = [("activated" , "bool" , "Activated" , True ), ("ssl" , "bool" , "Use HTTPS" , True ), @@ -41,6 +41,11 @@ class Captcha9kw(Hook): API_URL = "http://www.9kw.eu/index.cgi" + #@TODO: Remove in 0.4.10 + def initPeriodical(self): + pass + + def setup(self): self.info = {} #@TODO: Remove in 0.4.10 if self.getConfig("ssl"): diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py index 2ebeb1734..b6e38d8bb 100644 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ b/module/plugins/hooks/CaptchaBrotherhood.py @@ -39,7 +39,7 @@ class CaptchaBrotherhoodException(Exception): class CaptchaBrotherhood(Hook): __name__ = "CaptchaBrotherhood" __type__ = "hook" - __version__ = "0.05" + __version__ = "0.06" __config__ = [("username", "str", "Username", ""), ("force", "bool", "Force CT even if client is connected", False), @@ -54,6 +54,11 @@ class CaptchaBrotherhood(Hook): API_URL = "http://www.captchabrotherhood.com/" + #@TODO: Remove in 0.4.10 + def initPeriodical(self): + pass + + def setup(self): self.info = {} #@TODO: Remove in 0.4.10 diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index eeda2d849..18036e020 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -40,7 +40,7 @@ def computeChecksum(local_file, algorithm): class Checksum(Hook): __name__ = "Checksum" __type__ = "hook" - __version__ = "0.14" + __version__ = "0.15" __config__ = [("check_checksum", "bool", "Check checksum? (If False only size will be verified)", True), ("check_action", "fail;retry;nothing", "What to do if check fails?", "retry"), @@ -62,6 +62,11 @@ class Checksum(Hook): 'default': r'^(?P<hash>[0-9A-Fa-f]+)\s+\*?(?P<name>.+)$'} + #@TODO: Remove in 0.4.10 + def initPeriodical(self): + pass + + def coreReady(self): if not self.getConfig("check_checksum"): self.logInfo(_("Checksum validation is disabled in plugin configuration")) diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py index c9c0f60c0..27d99c71c 100644 --- a/module/plugins/hooks/ClickAndLoad.py +++ b/module/plugins/hooks/ClickAndLoad.py @@ -52,7 +52,7 @@ def forward(source, destination): class ClickAndLoad(Hook): __name__ = "ClickAndLoad" __type__ = "hook" - __version__ = "0.22" + __version__ = "0.23" __config__ = [("activated", "bool", "Activated", True), ("extern", "bool", "Allow external link adding", False)] @@ -63,6 +63,11 @@ class ClickAndLoad(Hook): ("mkaay", "mkaay@mkaay.de")] + #@TODO: Remove in 0.4.10 + def initPeriodical(self): + pass + + def coreReady(self): self.port = int(self.config['webinterface']['port']) if self.config['webinterface']['activated']: diff --git a/module/plugins/hooks/DeathByCaptcha.py b/module/plugins/hooks/DeathByCaptcha.py index df09769ce..f03ac4567 100644 --- a/module/plugins/hooks/DeathByCaptcha.py +++ b/module/plugins/hooks/DeathByCaptcha.py @@ -52,7 +52,7 @@ class DeathByCaptchaException(Exception): class DeathByCaptcha(Hook): __name__ = "DeathByCaptcha" __type__ = "hook" - __version__ = "0.03" + __version__ = "0.04" __config__ = [("username", "str", "Username", ""), ("passkey", "password", "Password", ""), @@ -67,6 +67,11 @@ class DeathByCaptcha(Hook): API_URL = "http://api.dbcapi.me/api/" + #@TODO: Remove in 0.4.10 + def initPeriodical(self): + pass + + def setup(self): self.info = {} #@TODO: Remove in 0.4.10 diff --git a/module/plugins/hooks/DownloadScheduler.py b/module/plugins/hooks/DownloadScheduler.py index 14884426f..4996e212d 100644 --- a/module/plugins/hooks/DownloadScheduler.py +++ b/module/plugins/hooks/DownloadScheduler.py @@ -10,7 +10,7 @@ from module.plugins.Hook import Hook class DownloadScheduler(Hook): __name__ = "DownloadScheduler" __type__ = "hook" - __version__ = "0.21" + __version__ = "0.22" __config__ = [("timetable", "str", "List time periods as hh:mm full or number(kB/s)", "0:00 full, 7:00 250, 10:00 0, 17:00 150"), @@ -22,6 +22,11 @@ class DownloadScheduler(Hook): ("stickell", "l.stickell@yahoo.it")] + #@TODO: Remove in 0.4.10 + def initPeriodical(self): + pass + + def setup(self): self.cb = None # callback to scheduler job; will be by removed hookmanager when hook unloaded diff --git a/module/plugins/hooks/ExpertDecoders.py b/module/plugins/hooks/ExpertDecoders.py index 1b9459eb6..1784a270c 100644 --- a/module/plugins/hooks/ExpertDecoders.py +++ b/module/plugins/hooks/ExpertDecoders.py @@ -15,7 +15,7 @@ from module.plugins.Hook import Hook class ExpertDecoders(Hook): __name__ = "ExpertDecoders" __type__ = "hook" - __version__ = "0.01" + __version__ = "0.02" __config__ = [("force", "bool", "Force CT even if client is connected", False), ("passkey", "password", "Access key", "")] @@ -29,6 +29,11 @@ class ExpertDecoders(Hook): API_URL = "http://www.fasttypers.org/imagepost.ashx" + #@TODO: Remove in 0.4.10 + def initPeriodical(self): + pass + + def setup(self): self.info = {} #@TODO: Remove in 0.4.10 diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index 5db2037fa..a35e47c03 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -13,7 +13,7 @@ from module.utils import save_join class ExternalScripts(Hook): __name__ = "ExternalScripts" __type__ = "hook" - __version__ = "0.24" + __version__ = "0.25" __config__ = [("activated", "bool", "Activated", True)] @@ -29,6 +29,11 @@ class ExternalScripts(Hook): "allDownloadsFinished", "allDownloadsProcessed"] + #@TODO: Remove in 0.4.10 + def initPeriodical(self): + pass + + def setup(self): self.scripts = {} diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 07db13aa1..fc77dbdf6 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -59,7 +59,7 @@ from module.utils import save_join, fs_encode class ExtractArchive(Hook): __name__ = "ExtractArchive" __type__ = "hook" - __version__ = "0.18" + __version__ = "0.19" __config__ = [("activated", "bool", "Activated", True), ("fullpath", "bool", "Extract full path", True), @@ -83,6 +83,11 @@ class ExtractArchive(Hook): event_list = ["allDownloadsProcessed"] + #@TODO: Remove in 0.4.10 + def initPeriodical(self): + pass + + def setup(self): self.plugins = [] self.passwords = [] diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index 98edc2f7f..efd4e411d 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -20,7 +20,7 @@ from module.utils import formatSize class IRCInterface(Thread, Hook): __name__ = "IRCInterface" __type__ = "hook" - __version__ = "0.12" + __version__ = "0.13" __config__ = [("host", "str", "IRC-Server Address", "Enter your server here!"), ("port", "int", "IRC-Server Port", 6667), @@ -44,6 +44,11 @@ class IRCInterface(Thread, Hook): self.setDaemon(True) + #@TODO: Remove in 0.4.10 + def initPeriodical(self): + pass + + def coreReady(self): self.abort = False self.more = [] diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py index b00c5118f..f89d64c37 100644 --- a/module/plugins/hooks/ImageTyperz.py +++ b/module/plugins/hooks/ImageTyperz.py @@ -33,7 +33,7 @@ class ImageTyperzException(Exception): class ImageTyperz(Hook): __name__ = "ImageTyperz" __type__ = "hook" - __version__ = "0.04" + __version__ = "0.05" __config__ = [("username", "str", "Username", ""), ("passkey", "password", "Password", ""), @@ -50,6 +50,11 @@ class ImageTyperz(Hook): GETCREDITS_URL = "http://captchatypers.com/Forms/RequestBalance.ashx" + #@TODO: Remove in 0.4.10 + def initPeriodical(self): + pass + + def setup(self): self.info = {} #@TODO: Remove in 0.4.10 diff --git a/module/plugins/hooks/LinkdecrypterCom.py b/module/plugins/hooks/LinkdecrypterCom.py index 0c5f6e754..b0ce335d0 100644 --- a/module/plugins/hooks/LinkdecrypterCom.py +++ b/module/plugins/hooks/LinkdecrypterCom.py @@ -10,13 +10,18 @@ from module.utils import remove_chars class LinkdecrypterCom(Hook): __name__ = "LinkdecrypterCom" __type__ = "hook" - __version__ = "0.20" + __version__ = "0.21" __description__ = """Linkdecrypter.com hook plugin""" __license__ = "GPLv3" __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] + #@TODO: Remove in 0.4.10 + def initPeriodical(self): + pass + + def coreReady(self): try: self.loadPatterns() diff --git a/module/plugins/hooks/MergeFiles.py b/module/plugins/hooks/MergeFiles.py index e6f8bb26f..767209d21 100644 --- a/module/plugins/hooks/MergeFiles.py +++ b/module/plugins/hooks/MergeFiles.py @@ -12,7 +12,7 @@ from module.utils import save_join, fs_encode class MergeFiles(Hook): __name__ = "MergeFiles" __type__ = "hook" - __version__ = "0.12" + __version__ = "0.13" __config__ = [("activated", "bool", "Activated", True)] @@ -24,6 +24,11 @@ class MergeFiles(Hook): BUFFER_SIZE = 4096 + #@TODO: Remove in 0.4.10 + def initPeriodical(self): + pass + + def setup(self): # nothing to do pass diff --git a/module/plugins/hooks/MultiHome.py b/module/plugins/hooks/MultiHome.py index 228e6027d..105a42abd 100644 --- a/module/plugins/hooks/MultiHome.py +++ b/module/plugins/hooks/MultiHome.py @@ -8,7 +8,7 @@ from module.plugins.Hook import Hook class MultiHome(Hook): __name__ = "MultiHome" __type__ = "hook" - __version__ = "0.11" + __version__ = "0.12" __config__ = [("interfaces", "str", "Interfaces", "None")] @@ -17,6 +17,11 @@ class MultiHome(Hook): __authors__ = [("mkaay", "mkaay@mkaay.de")] + #@TODO: Remove in 0.4.10 + def initPeriodical(self): + pass + + def setup(self): self.register = {} self.interfaces = [] diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py index f3edcc9dc..609bb4197 100644 --- a/module/plugins/hooks/SkipRev.py +++ b/module/plugins/hooks/SkipRev.py @@ -19,6 +19,11 @@ class SkipRev(Hook): __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + #@TODO: Remove in 0.4.10 + def initPeriodical(self): + pass + + def _setup(self): super(self.pyfile.plugin, self).setup() if self.pyfile.hasStatus("skipped"): diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index f97d12431..d3baccfc2 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -10,7 +10,7 @@ from module.utils import fs_encode class UnSkipOnFail(Hook): __name__ = "UnSkipOnFail" __type__ = "hook" - __version__ = "0.01" + __version__ = "0.02" __config__ = [("activated", "bool", "Activated", True)] @@ -19,6 +19,11 @@ class UnSkipOnFail(Hook): __authors__ = [("hagg", None)] + #@TODO: Remove in 0.4.10 + def initPeriodical(self): + pass + + def downloadFailed(self, pyfile): pyfile_name = basename(pyfile.name) pid = pyfile.package().id diff --git a/module/plugins/hooks/WindowsPhoneToastNotify.py b/module/plugins/hooks/WindowsPhoneToastNotify.py index 053ea47d0..ed305778c 100644 --- a/module/plugins/hooks/WindowsPhoneToastNotify.py +++ b/module/plugins/hooks/WindowsPhoneToastNotify.py @@ -9,7 +9,7 @@ from module.plugins.Hook import Hook class WindowsPhoneToastNotify(Hook): __name__ = "WindowsPhoneToastNotify" __type__ = "hook" - __version__ = "0.02" + __version__ = "0.03" __config__ = [("force", "bool", "Force even if client is connected", False), ("pushId", "str", "pushId", ""), @@ -21,6 +21,11 @@ class WindowsPhoneToastNotify(Hook): __authors__ = [("Andy Voigt", "phone-support@hotmail.de")] + #@TODO: Remove in 0.4.10 + def initPeriodical(self): + pass + + def setup(self): self.info = {} #@TODO: Remove in 0.4.10 diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index fe955beb9..e9b1b454e 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.25" + __version__ = "0.26" __config__ = [("activated", "bool", "Activated", True), ("use_hoster_list", "bool", "Load listed hosters only", True), @@ -44,6 +44,11 @@ class XFileSharingPro(Hook): # self.loadPattern() + #@TODO: Remove in 0.4.10 + def initPeriodical(self): + pass + + def coreReady(self): self.loadPattern() -- cgit v1.2.3 From 6151e81fa0b325dffda3da4228d5821e73db3ef3 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 9 Dec 2014 01:19:46 +0100 Subject: Fix __version__ format in some plugins --- module/plugins/hooks/RPNetBiz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/RPNetBiz.py b/module/plugins/hooks/RPNetBiz.py index e38aa8ea0..917cd02de 100644 --- a/module/plugins/hooks/RPNetBiz.py +++ b/module/plugins/hooks/RPNetBiz.py @@ -8,7 +8,7 @@ from module.plugins.internal.MultiHoster import MultiHoster class RPNetBiz(MultiHoster): __name__ = "RPNetBiz" __type__ = "hook" - __version__ = "0.1" + __version__ = "0.10" __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), ("hosterList", "str", "Hoster list (comma separated)", ""), -- cgit v1.2.3 From 4d578cb15f3d6edd036e438e504739b97660f93e Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 9 Dec 2014 16:58:35 +0100 Subject: Spare code cosmetics --- module/plugins/hooks/MergeFiles.py | 61 +++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 28 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/MergeFiles.py b/module/plugins/hooks/MergeFiles.py index 767209d21..4de45f958 100644 --- a/module/plugins/hooks/MergeFiles.py +++ b/module/plugins/hooks/MergeFiles.py @@ -1,5 +1,7 @@ # -*- coding: utf-8 -*- +from __future__ import with_statement + import os import re @@ -53,32 +55,35 @@ class MergeFiles(Hook): for name, file_list in files.iteritems(): self.logInfo(_("Starting merging of"), name) - final_file = open(save_join(download_folder, name), "wb") - - for splitted_file in file_list: - self.logDebug("Merging part", splitted_file) - pyfile = self.core.files.getFile(fid_dict[splitted_file]) - pyfile.setStatus("processing") - try: - s_file = open(os.path.join(download_folder, splitted_file), "rb") - size_written = 0 - s_file_size = int(os.path.getsize(os.path.join(download_folder, splitted_file))) - while True: - f_buffer = s_file.read(self.BUFFER_SIZE) - if f_buffer: - final_file.write(f_buffer) - size_written += self.BUFFER_SIZE - pyfile.setProgress((size_written * 100) / s_file_size) - else: - break - s_file.close() - self.logDebug("Finished merging part", splitted_file) - except Exception, e: - print_exc() - finally: - pyfile.setProgress(100) - pyfile.setStatus("finished") - pyfile.release() - - final_file.close() + + with open(save_join(download_folder, name), "wb") as final_file: + for splitted_file in file_list: + self.logDebug("Merging part", splitted_file) + + pyfile = self.core.files.getFile(fid_dict[splitted_file]) + + pyfile.setStatus("processing") + + try: + with open(os.path.join(download_folder, splitted_file), "rb") as s_file: + size_written = 0 + s_file_size = int(os.path.getsize(os.path.join(download_folder, splitted_file))) + while True: + f_buffer = s_file.read(self.BUFFER_SIZE) + if f_buffer: + final_file.write(f_buffer) + size_written += self.BUFFER_SIZE + pyfile.setProgress((size_written * 100) / s_file_size) + else: + break + self.logDebug("Finished merging part", splitted_file) + + except Exception, e: + print_exc() + + finally: + pyfile.setProgress(100) + pyfile.setStatus("finished") + pyfile.release() + self.logInfo(_("Finished merging of"), name) -- cgit v1.2.3 From 430092f0ba67e4bb2dd75433b08340d0afca0fa9 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Fri, 12 Dec 2014 20:34:42 +0100 Subject: Update plugins after SimpleHoster changes --- module/plugins/hooks/SkipRev.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py index 609bb4197..107740a3d 100644 --- a/module/plugins/hooks/SkipRev.py +++ b/module/plugins/hooks/SkipRev.py @@ -10,7 +10,7 @@ from module.plugins.Plugin import SkipDownload class SkipRev(Hook): __name__ = "SkipRev" __type__ = "hook" - __version__ = "0.14" + __version__ = "0.15" __config__ = [("tokeep", "int", "Number of rev files to keep for package (-1 to auto)", -1)] @@ -37,10 +37,10 @@ class SkipRev(Hook): if hasattr(plugin, "info") and 'name' in plugin.info and plugin.info['name']: name = plugin.info['name'] - elif hasattr(plugin, "parseInfo"): - name = next(plugin.parseInfo([url]))['name'] + elif hasattr(plugin, "parseInfos"): + name = next(plugin.parseInfos([url]))['name'] - elif hasattr(plugin, "getInfo"): #@NOTE: if parseInfo was not found, getInfo should be missing too + elif hasattr(plugin, "getInfo"): #@NOTE: if parseInfos was not found, getInfo should be missing too name = plugin.getInfo(url)['name'] else: -- cgit v1.2.3 From 3d27f5ccee412d38102873a5b02e3f236375eb97 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 16 Dec 2014 03:44:15 +0100 Subject: Update plugins (2) --- module/plugins/hooks/RestartSlow.py | 4 ++-- module/plugins/hooks/SkipRev.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/RestartSlow.py b/module/plugins/hooks/RestartSlow.py index 587799235..c2fdf6f95 100644 --- a/module/plugins/hooks/RestartSlow.py +++ b/module/plugins/hooks/RestartSlow.py @@ -8,7 +8,7 @@ from module.plugins.Hook import Hook class RestartSlow(Hook): __name__ = "RestartSlow" __type__ = "hook" - __version__ = "0.02" + __version__ = "0.03" __config__ = [("free_limit" , "int" , "Transfer speed threshold in kilobytes" , 100 ), ("free_time" , "int" , "Sample interval in minutes" , 5 ), @@ -45,7 +45,7 @@ class RestartSlow(Hook): limit = max(5, self.getConfig("%s_limit" % type) * 1024) chunks = [chunk for chunk in self.pyfile.req.dl.chunks \ - if chunk.id not in self.info['chunk'] or self.info['chunk'][chunk.id] not is (time, limit)] + if chunk.id not in self.info['chunk'] or self.info['chunk'][chunk.id] is not (time, limit)] for chunk in chunks: chunk.c.setopt(pycurl.LOW_SPEED_TIME , time) diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py index 107740a3d..d21aa0f6d 100644 --- a/module/plugins/hooks/SkipRev.py +++ b/module/plugins/hooks/SkipRev.py @@ -10,7 +10,7 @@ from module.plugins.Plugin import SkipDownload class SkipRev(Hook): __name__ = "SkipRev" __type__ = "hook" - __version__ = "0.15" + __version__ = "0.16" __config__ = [("tokeep", "int", "Number of rev files to keep for package (-1 to auto)", -1)] @@ -45,13 +45,13 @@ class SkipRev(Hook): else: self.logWarning("Unable to grab file name") - name = urlparse(unquote(url)).path.split('/')[-1]) + name = urlparse(unquote(url)).path.split('/')[-1] return name def downloadPreparing(self, pyfile): - if pyfile.getStatusName() is "unskipped" or not pyname(pyfile).endswith(".rev"): + if pyfile.getStatusName() is "unskipped" or not self.pyname(pyfile).endswith(".rev"): return tokeep = self.getConfig("tokeep") -- cgit v1.2.3 From bc47c7282b093eabe70d7a04bb481789e4cebf65 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 16 Dec 2014 23:03:48 +0100 Subject: [SkipRev] Another fix --- module/plugins/hooks/SkipRev.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py index d21aa0f6d..0c38ac9af 100644 --- a/module/plugins/hooks/SkipRev.py +++ b/module/plugins/hooks/SkipRev.py @@ -10,7 +10,7 @@ from module.plugins.Plugin import SkipDownload class SkipRev(Hook): __name__ = "SkipRev" __type__ = "hook" - __version__ = "0.16" + __version__ = "0.17" __config__ = [("tokeep", "int", "Number of rev files to keep for package (-1 to auto)", -1)] @@ -57,7 +57,7 @@ class SkipRev(Hook): tokeep = self.getConfig("tokeep") if tokeep: - saved = [True for link in pyfile.package().getChildren() \ + saved = [True for link in self.core.api.getPackageData(pyfile.packageid).links \ if link.name.endswith(".rev") and (link.hasStatus("finished") or link.hasStatus("downloading"))].count(True) if not saved or saved < tokeep: #: keep one rev at least in auto mode @@ -73,7 +73,7 @@ class SkipRev(Hook): if not tokeep: return - for link in pyfile.package().getChildren(): + for link in self.core.api.getPackageData(pyfile.packageid).links: if link.hasStatus("skipped") and link.name.endswith(".rev"): if tokeep > -1 or pyfile.name.endswith(".rev"): link.setStatus("queued") -- cgit v1.2.3 From 8bb189cf5495b293cf574e5049c34a64ae36ffe1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 16 Dec 2014 23:04:15 +0100 Subject: Spare code cosmetics --- module/plugins/hooks/ExtractArchive.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index fc77dbdf6..895aee51f 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -195,6 +195,7 @@ class ExtractArchive(Hook): if targets: self.logDebug("Targets for %s: %s" % (plugin.__name__, targets)) matched = True + for target, fid in targets: if target in processed: self.logDebug(basename(target), "skipped") @@ -206,8 +207,10 @@ class ExtractArchive(Hook): try: klass = plugin(self, target, out, fullpath, overwrite, excludefiles, renice) klass.init() - password = p.password.strip().splitlines() - new_files = self._extract(klass, fid, password, thread) + + passwords = p.password.strip().splitlines() + new_files = self._extract(klass, fid, passwords, thread) + except Exception, e: self.logError(basename(target), e) success = False @@ -256,13 +259,7 @@ class ExtractArchive(Hook): self.logInfo(basename(plugin.file), _("Password protected")) self.logDebug("Passwords", passwords) - pwlist = copy(self.getPasswords()) - # remove already supplied pws from list (only local) - for pw in passwords: - if pw in pwlist: - pwlist.remove(pw) - - for pw in passwords + pwlist: + for pw in set(passwords) + set(self.getPasswords()): try: self.logDebug("Try password", pw) if plugin.checkPassword(pw): @@ -270,6 +267,7 @@ class ExtractArchive(Hook): self.addPassword(pw) success = True break + except WrongPassword: self.logDebug("Password was wrong") @@ -297,8 +295,10 @@ class ExtractArchive(Hook): except ArchiveError, e: self.logError(basename(plugin.file), _("Archive Error"), e) + except CRCError: self.logError(basename(plugin.file), _("CRC Mismatch")) + except Exception, e: if self.core.debug: print_exc() -- cgit v1.2.3 From ad0483adfd5dcb931392cd26eb4961f74ce91122 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Wed, 17 Dec 2014 20:03:05 +0100 Subject: [DebridItaliaCom] Fix hook getHoster --- module/plugins/hooks/DebridItaliaCom.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/DebridItaliaCom.py b/module/plugins/hooks/DebridItaliaCom.py index b7f0ef1c7..43e910a4b 100644 --- a/module/plugins/hooks/DebridItaliaCom.py +++ b/module/plugins/hooks/DebridItaliaCom.py @@ -9,7 +9,7 @@ from module.plugins.internal.MultiHoster import MultiHoster class DebridItaliaCom(MultiHoster): __name__ = "DebridItaliaCom" __type__ = "hook" - __version__ = "0.08" + __version__ = "0.09" __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("hosterList", "str", "Hoster list (comma separated)", ""), @@ -23,5 +23,4 @@ class DebridItaliaCom(MultiHoster): def getHoster(self): - html = getURL("http://www.debriditalia.com/status.php") - return re.findall(r'title="(.+?)"> \1</td><td><img src="/images/(?:attivo|testing)', html) + return getURL("http://debriditalia.com/api.php", get={'hosts': ""}).replace('"', '').split(',') -- cgit v1.2.3 From d799ef7a401149591b747e18197ce54017f96f1b Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Wed, 17 Dec 2014 23:47:33 +0100 Subject: [LinestorageCom] Added hoster plugin --- module/plugins/hooks/XFileSharingPro.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index e9b1b454e..10de43cc0 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.26" + __version__ = "0.27" __config__ = [("activated", "bool", "Activated", True), ("use_hoster_list", "bool", "Load listed hosters only", True), @@ -30,7 +30,7 @@ class XFileSharingPro(Hook): HOSTER_LIST = [#WORKING HOSTERS: "eyesfile.ca", "file4safe.com", "fileband.com", "filedwon.com", "filevice.com", "hostingbulk.com", - "linestorage.com", "ravishare.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", + "ravishare.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", #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", -- cgit v1.2.3 From da9e6c949243613f4d5e100cac6ff192449b4718 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Thu, 18 Dec 2014 18:45:17 +0100 Subject: Update extractor plugins --- module/plugins/hooks/ExtractArchive.py | 37 +++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 16 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 895aee51f..ddec8319b 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -16,7 +16,6 @@ if sys.version_info < (2, 7) and os.name != "nt": import errno from subprocess import Popen - def _eintr_retry_call(func, *args): while True: try: @@ -59,7 +58,7 @@ from module.utils import save_join, fs_encode class ExtractArchive(Hook): __name__ = "ExtractArchive" __type__ = "hook" - __version__ = "0.19" + __version__ = "0.20" __config__ = [("activated", "bool", "Activated", True), ("fullpath", "bool", "Extract full path", True), @@ -89,7 +88,7 @@ class ExtractArchive(Hook): def setup(self): - self.plugins = [] + self.plugins = [] self.passwords = [] names = [] @@ -141,24 +140,27 @@ class ExtractArchive(Hook): @threaded def allDownloadsProcessed(self, thread): local = copy(self.queue) + del self.queue[:] + if self.extract(local, thread): #: check only if all gone fine, no failed reporting for now self.manager.dispatchEvent("all_archives_extracted") + self.manager.dispatchEvent("all_archives_processed") def extract(self, ids, thread=None): processed = [] extracted = [] - failed = [] + failed = [] - destination = self.getConfig("destination") - subfolder = self.getConfig("subfolder") - fullpath = self.getConfig("fullpath") - overwrite = self.getConfig("overwrite") + destination = self.getConfig("destination") + subfolder = self.getConfig("subfolder") + fullpath = self.getConfig("fullpath") + overwrite = self.getConfig("overwrite") excludefiles = self.getConfig("excludefiles") - renice = self.getConfig("renice") - recursive = self.getConfig("recursive") + renice = self.getConfig("renice") + recursive = self.getConfig("recursive") # reload from txt file self.reloadPasswords() @@ -208,8 +210,7 @@ class ExtractArchive(Hook): klass = plugin(self, target, out, fullpath, overwrite, excludefiles, renice) klass.init() - passwords = p.password.strip().splitlines() - new_files = self._extract(klass, fid, passwords, thread) + new_files = self._extract(klass, fid, [p.password.strip()], thread) except Exception, e: self.logError(basename(target), e) @@ -253,15 +254,15 @@ class ExtractArchive(Hook): success = False if not plugin.checkArchive(): - plugin.extract(progress) + plugin.extract(progress, pw) success = True else: self.logInfo(basename(plugin.file), _("Password protected")) - self.logDebug("Passwords", passwords) + self.logDebug("Passwords: %s" % passwords if passwords else "No password provided") - for pw in set(passwords) + set(self.getPasswords()): + for pw in set(passwords) | set(self.getPasswords()): try: - self.logDebug("Try password", pw) + self.logDebug("Try password: %s" % pw) if plugin.checkPassword(pw): plugin.extract(progress, pw) self.addPassword(pw) @@ -305,6 +306,7 @@ class ExtractArchive(Hook): self.logError(basename(plugin.file), _("Unknown Error"), e) self.manager.dispatchEvent("archive_extract_failed", pyfile) + raise Exception(_("Extract failed")) @@ -344,6 +346,7 @@ class ExtractArchive(Hook): with open(passwordfile, "wb") as f: for pw in self.passwords: f.write(pw + "\n") + except IOError, e: self.logError(e) @@ -352,6 +355,7 @@ class ExtractArchive(Hook): for f in files: if not exists(f): continue + try: if self.config['permission']['change_file']: if isfile(f): @@ -363,5 +367,6 @@ class ExtractArchive(Hook): uid = getpwnam(self.config['permission']['user'])[2] gid = getgrnam(self.config['permission']['group'])[2] chown(f, uid, gid) + except Exception, e: self.logWarning(_("Setting User and Group failed"), e) -- cgit v1.2.3 From 854efeb463bd98cb8e22f1f78f5ce97e6c0ab49f Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Mon, 22 Dec 2014 16:45:04 +0100 Subject: Spare code cosmetics --- module/plugins/hooks/Checksum.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index 18036e020..8d9f8f981 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -56,10 +56,10 @@ class Checksum(Hook): methods = {'sfv': 'crc32', 'crc': 'crc32', 'hash': 'md5'} - regexps = {'sfv': r'^(?P<name>[^;].+)\s+(?P<hash>[0-9A-Fa-f]{8})$', - 'md5': r'^(?P<name>[0-9A-Fa-f]{32}) (?P<file>.+)$', - 'crc': r'filename=(?P<name>.+)\nsize=(?P<size>\d+)\ncrc32=(?P<hash>[0-9A-Fa-f]{8})$', - 'default': r'^(?P<hash>[0-9A-Fa-f]+)\s+\*?(?P<name>.+)$'} + regexps = {'sfv': r'^(?P<NAME>[^;].+)\s+(?P<HASH>[0-9A-Fa-f]{8})$', + 'md5': r'^(?P<NAME>[0-9A-Fa-f]{32}) (?P<FILE>.+)$', + 'crc': r'filename=(?P<NAME>.+)\nsize=(?P<SIZE>\d+)\ncrc32=(?P<HASH>[0-9A-Fa-f]{8})$', + 'default': r'^(?P<HASH>[0-9A-Fa-f]+)\s+\*?(?P<NAME>.+)$'} #@TODO: Remove in 0.4.10 @@ -179,12 +179,12 @@ class Checksum(Hook): data = m.groupdict() self.logDebug(link['name'], data) - local_file = fs_encode(save_join(download_folder, data['name'])) + local_file = fs_encode(save_join(download_folder, data['NAME'])) algorithm = self.methods.get(file_type, file_type) checksum = computeChecksum(local_file, algorithm) - if checksum == data['hash']: + if checksum == data['HASH']: self.logInfo(_('File integrity of "%s" verified by %s checksum (%s)') % - (data['name'], algorithm, checksum)) + (data['NAME'], algorithm, checksum)) else: self.logWarning(_("%s checksum for file %s does not match (%s != %s)") % - (algorithm, data['name'], checksum, data['hash'])) + (algorithm, data['NAME'], checksum, data['HASH'])) -- cgit v1.2.3 From c10f5af761319b239381a24e2cf2f418e20d8744 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Mon, 22 Dec 2014 16:56:35 +0100 Subject: [XFileSharingPro] Support salefiles.com --- module/plugins/hooks/XFileSharingPro.py | 36 +++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 10de43cc0..946838e47 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,10 +8,10 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.27" + __version__ = "0.28" __config__ = [("activated", "bool", "Activated", True), - ("use_hoster_list", "bool", "Load listed hosters only", True), + ("use_hoster_list", "bool", "Load listed hosters only", False), ("use_crypter_list", "bool", "Load listed crypters only", False), ("use_builtin_list", "bool", "Load built-in plugin list", True), ("hoster_list", "str", "Hoster list (comma separated)", ""), @@ -30,7 +30,7 @@ class XFileSharingPro(Hook): HOSTER_LIST = [#WORKING HOSTERS: "eyesfile.ca", "file4safe.com", "fileband.com", "filedwon.com", "filevice.com", "hostingbulk.com", - "ravishare.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", + "ravishare.com", "salefiles.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", #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", @@ -80,7 +80,10 @@ class XFileSharingPro(Hook): match_list = '|'.join(sorted(plugin_list)) len_match_list = len(plugin_list) - self.logInfo(_("Handling %d %s%s: %s") % (len_match_list, type, "" if len_match_list is 1 else "s", match_list.replace('|', ', '))) + self.logInfo(_("Handling %d %s%s: %s") % (len_match_list, + type, + "" if len_match_list is 1 else "s", + match_list.replace('|', ', '))) pattern = self.regexp[type][1] % match_list.replace('.', '\.') @@ -98,6 +101,31 @@ class XFileSharingPro(Hook): def unload(self): + # self.unloadHoster("BasePlugin") for type, plugin in (("hoster", "XFileSharingPro"), ("crypter", "XFileSharingProFolder")): self._unload(type, plugin) + + + def unloadHoster(self, hoster): + hdict = self.core.pluginManager.hosterPlugins[hoster] + if "new_name" in hdict and hdict['new_name'] is "XFileSharingPro": + if "module" in hdict: + del hdict['module'] + + if "new_module" in hdict: + del hdict['new_module'] + del hdict['new_name'] + + return True + else: + return False + + + # def downloadFailed(self, pyfile): + # if pyfile.pluginname is "BasePlugin" \ + # and pyfile.hasStatus("failed") \ + # and not self.getConfig("use_hoster_list") \ + # and self.unloadHoster("BasePlugin"): + # self.logDebug("Unloaded XFileSharingPro from BasePlugin") + # pyfile.setStatus("queued") -- cgit v1.2.3 From b9b9301f6e4db89d174bd6bdabbbf7746ae21b53 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 23 Dec 2014 12:32:49 +0100 Subject: [ExpertDecoders] Fix typo (thx DKeppi) --- module/plugins/hooks/ExpertDecoders.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/ExpertDecoders.py b/module/plugins/hooks/ExpertDecoders.py index 1784a270c..54de8eb53 100644 --- a/module/plugins/hooks/ExpertDecoders.py +++ b/module/plugins/hooks/ExpertDecoders.py @@ -15,7 +15,7 @@ from module.plugins.Hook import Hook class ExpertDecoders(Hook): __name__ = "ExpertDecoders" __type__ = "hook" - __version__ = "0.02" + __version__ = "0.03" __config__ = [("force", "bool", "Force CT even if client is connected", False), ("passkey", "password", "Access key", "")] @@ -97,7 +97,7 @@ class ExpertDecoders(Hook): try: res = getURL(self.API_URL, post={'action': "refund", 'key': self.getConfig("passkey"), 'gen_task_id': task.data['ticket']}) - self.logInfo(_("Request refund", res) + self.logInfo(_("Request refund"), res) except BadHeader, e: self.logError(_("Could not send refund request"), e) -- cgit v1.2.3 From 57a319563651a07bf8265ab52da0d7375191319c Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 23 Dec 2014 13:13:42 +0100 Subject: Rename MultiHoster plugin to MultiHook --- module/plugins/hooks/AlldebridCom.py | 6 +++--- module/plugins/hooks/DebridItaliaCom.py | 6 +++--- module/plugins/hooks/EasybytezCom.py | 6 +++--- module/plugins/hooks/FastixRu.py | 6 +++--- module/plugins/hooks/FreeWayMe.py | 6 +++--- module/plugins/hooks/LinksnappyCom.py | 6 +++--- module/plugins/hooks/MegaDebridEu.py | 6 +++--- module/plugins/hooks/MultishareCz.py | 6 +++--- module/plugins/hooks/MyfastfileCom.py | 6 +++--- module/plugins/hooks/OverLoadMe.py | 6 +++--- module/plugins/hooks/PremiumTo.py | 8 ++++---- module/plugins/hooks/PremiumizeMe.py | 8 ++++---- module/plugins/hooks/RPNetBiz.py | 8 ++++---- module/plugins/hooks/RealdebridCom.py | 6 +++--- module/plugins/hooks/RehostTo.py | 8 ++++---- module/plugins/hooks/SimplyPremiumCom.py | 6 +++--- module/plugins/hooks/SimplydebridCom.py | 6 +++--- module/plugins/hooks/UnrestrictLi.py | 6 +++--- module/plugins/hooks/XFileSharingPro.py | 12 ++++++------ module/plugins/hooks/ZeveraCom.py | 4 ++-- 20 files changed, 66 insertions(+), 66 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/AlldebridCom.py b/module/plugins/hooks/AlldebridCom.py index 2d3c8aad7..d5986053f 100644 --- a/module/plugins/hooks/AlldebridCom.py +++ b/module/plugins/hooks/AlldebridCom.py @@ -1,13 +1,13 @@ # -*- coding: utf-8 -*- from module.network.RequestFactory import getURL -from module.plugins.internal.MultiHoster import MultiHoster +from module.plugins.internal.MultiHook import MultiHook -class AlldebridCom(MultiHoster): +class AlldebridCom(MultiHook): __name__ = "AlldebridCom" __type__ = "hook" - __version__ = "0.13" + __version__ = "0.14" __config__ = [("https", "bool", "Enable HTTPS", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), diff --git a/module/plugins/hooks/DebridItaliaCom.py b/module/plugins/hooks/DebridItaliaCom.py index 43e910a4b..e31bc98d7 100644 --- a/module/plugins/hooks/DebridItaliaCom.py +++ b/module/plugins/hooks/DebridItaliaCom.py @@ -3,13 +3,13 @@ import re from module.network.RequestFactory import getURL -from module.plugins.internal.MultiHoster import MultiHoster +from module.plugins.internal.MultiHook import MultiHook -class DebridItaliaCom(MultiHoster): +class DebridItaliaCom(MultiHook): __name__ = "DebridItaliaCom" __type__ = "hook" - __version__ = "0.09" + __version__ = "0.10" __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("hosterList", "str", "Hoster list (comma separated)", ""), diff --git a/module/plugins/hooks/EasybytezCom.py b/module/plugins/hooks/EasybytezCom.py index 3faa4fa1a..0dab2a7fe 100644 --- a/module/plugins/hooks/EasybytezCom.py +++ b/module/plugins/hooks/EasybytezCom.py @@ -2,13 +2,13 @@ import re -from module.plugins.internal.MultiHoster import MultiHoster +from module.plugins.internal.MultiHook import MultiHook -class EasybytezCom(MultiHoster): +class EasybytezCom(MultiHook): __name__ = "EasybytezCom" __type__ = "hook" - __version__ = "0.03" + __version__ = "0.04" __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("hosterList", "str", "Hoster list (comma separated)", "")] diff --git a/module/plugins/hooks/FastixRu.py b/module/plugins/hooks/FastixRu.py index cec6c6f1f..73297eb23 100644 --- a/module/plugins/hooks/FastixRu.py +++ b/module/plugins/hooks/FastixRu.py @@ -2,13 +2,13 @@ from module.common.json_layer import json_loads from module.network.RequestFactory import getURL -from module.plugins.internal.MultiHoster import MultiHoster +from module.plugins.internal.MultiHook import MultiHook -class FastixRu(MultiHoster): +class FastixRu(MultiHook): __name__ = "FastixRu" __type__ = "hook" - __version__ = "0.02" + __version__ = "0.03" __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("unloadFailing", "bool", "Revert to standard download if download fails", False), diff --git a/module/plugins/hooks/FreeWayMe.py b/module/plugins/hooks/FreeWayMe.py index 5abec29ba..0b71fc35b 100644 --- a/module/plugins/hooks/FreeWayMe.py +++ b/module/plugins/hooks/FreeWayMe.py @@ -1,13 +1,13 @@ # -*- coding: utf-8 -*- from module.network.RequestFactory import getURL -from module.plugins.internal.MultiHoster import MultiHoster +from module.plugins.internal.MultiHook import MultiHook -class FreeWayMe(MultiHoster): +class FreeWayMe(MultiHook): __name__ = "FreeWayMe" __type__ = "hook" - __version__ = "0.11" + __version__ = "0.12" __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), ("hosterList", "str", "Hoster list (comma separated)", ""), diff --git a/module/plugins/hooks/LinksnappyCom.py b/module/plugins/hooks/LinksnappyCom.py index 82edc30fd..96bf1c0d1 100644 --- a/module/plugins/hooks/LinksnappyCom.py +++ b/module/plugins/hooks/LinksnappyCom.py @@ -2,13 +2,13 @@ from module.common.json_layer import json_loads from module.network.RequestFactory import getURL -from module.plugins.internal.MultiHoster import MultiHoster +from module.plugins.internal.MultiHook import MultiHook -class LinksnappyCom(MultiHoster): +class LinksnappyCom(MultiHook): __name__ = "LinksnappyCom" __type__ = "hook" - __version__ = "0.01" + __version__ = "0.02" __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("hosterList", "str", "Hoster list (comma separated)", ""), diff --git a/module/plugins/hooks/MegaDebridEu.py b/module/plugins/hooks/MegaDebridEu.py index 4f627b7e9..f3a0c31ea 100644 --- a/module/plugins/hooks/MegaDebridEu.py +++ b/module/plugins/hooks/MegaDebridEu.py @@ -2,13 +2,13 @@ from module.common.json_layer import json_loads from module.network.RequestFactory import getURL -from module.plugins.internal.MultiHoster import MultiHoster +from module.plugins.internal.MultiHook import MultiHook -class MegaDebridEu(MultiHoster): +class MegaDebridEu(MultiHook): __name__ = "MegaDebridEu" __type__ = "hook" - __version__ = "0.02" + __version__ = "0.03" __config__ = [("unloadFailing", "bool", "Revert to standard download if download fails", False)] diff --git a/module/plugins/hooks/MultishareCz.py b/module/plugins/hooks/MultishareCz.py index 0e651393d..5ec5b63b6 100644 --- a/module/plugins/hooks/MultishareCz.py +++ b/module/plugins/hooks/MultishareCz.py @@ -3,13 +3,13 @@ import re from module.network.RequestFactory import getURL -from module.plugins.internal.MultiHoster import MultiHoster +from module.plugins.internal.MultiHook import MultiHook -class MultishareCz(MultiHoster): +class MultishareCz(MultiHook): __name__ = "MultishareCz" __type__ = "hook" - __version__ = "0.04" + __version__ = "0.05" __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("hosterList", "str", "Hoster list (comma separated)", "uloz.to")] diff --git a/module/plugins/hooks/MyfastfileCom.py b/module/plugins/hooks/MyfastfileCom.py index 0cf2c6c22..ec7c4e55b 100644 --- a/module/plugins/hooks/MyfastfileCom.py +++ b/module/plugins/hooks/MyfastfileCom.py @@ -2,13 +2,13 @@ from module.common.json_layer import json_loads from module.network.RequestFactory import getURL -from module.plugins.internal.MultiHoster import MultiHoster +from module.plugins.internal.MultiHook import MultiHook -class MyfastfileCom(MultiHoster): +class MyfastfileCom(MultiHook): __name__ = "MyfastfileCom" __type__ = "hook" - __version__ = "0.02" + __version__ = "0.03" __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("hosterList", "str", "Hoster list (comma separated)", ""), diff --git a/module/plugins/hooks/OverLoadMe.py b/module/plugins/hooks/OverLoadMe.py index baa9b0e0a..378ce0a65 100644 --- a/module/plugins/hooks/OverLoadMe.py +++ b/module/plugins/hooks/OverLoadMe.py @@ -1,13 +1,13 @@ # -*- coding: utf-8 -*- from module.network.RequestFactory import getURL -from module.plugins.internal.MultiHoster import MultiHoster +from module.plugins.internal.MultiHook import MultiHook -class OverLoadMe(MultiHoster): +class OverLoadMe(MultiHook): __name__ = "OverLoadMe" __type__ = "hook" - __version__ = "0.01" + __version__ = "0.02" __config__ = [("https", "bool", "Enable HTTPS", True), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), diff --git a/module/plugins/hooks/PremiumTo.py b/module/plugins/hooks/PremiumTo.py index 7be46945f..3087db552 100644 --- a/module/plugins/hooks/PremiumTo.py +++ b/module/plugins/hooks/PremiumTo.py @@ -1,13 +1,13 @@ # -*- coding: utf-8 -*- from module.network.RequestFactory import getURL -from module.plugins.internal.MultiHoster import MultiHoster +from module.plugins.internal.MultiHook import MultiHook -class PremiumTo(MultiHoster): +class PremiumTo(MultiHook): __name__ = "PremiumTo" __type__ = "hook" - __version__ = "0.04" + __version__ = "0.05" __config__ = [("hosterListMode", "all;listed;unlisted", "Use for downloads from supported hosters:", "all"), ("hosterList", "str", "Hoster list (comma separated)", "")] @@ -34,4 +34,4 @@ class PremiumTo(MultiHoster): self.logError(_("Please add your premium.to account first and restart pyLoad")) return - return MultiHoster.coreReady(self) + return MultiHook.coreReady(self) diff --git a/module/plugins/hooks/PremiumizeMe.py b/module/plugins/hooks/PremiumizeMe.py index c18e8cf8e..4ebf96451 100644 --- a/module/plugins/hooks/PremiumizeMe.py +++ b/module/plugins/hooks/PremiumizeMe.py @@ -2,13 +2,13 @@ from module.common.json_layer import json_loads from module.network.RequestFactory import getURL -from module.plugins.internal.MultiHoster import MultiHoster +from module.plugins.internal.MultiHook import MultiHook -class PremiumizeMe(MultiHoster): +class PremiumizeMe(MultiHook): __name__ = "PremiumizeMe" __type__ = "hook" - __version__ = "0.12" + __version__ = "0.13" __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), ("hosterList", "str", "Hoster list (comma separated)", ""), @@ -51,4 +51,4 @@ class PremiumizeMe(MultiHoster): return # Run the overwriten core ready which actually enables the multihoster hook - return MultiHoster.coreReady(self) + return MultiHook.coreReady(self) diff --git a/module/plugins/hooks/RPNetBiz.py b/module/plugins/hooks/RPNetBiz.py index 917cd02de..c54f7d445 100644 --- a/module/plugins/hooks/RPNetBiz.py +++ b/module/plugins/hooks/RPNetBiz.py @@ -2,13 +2,13 @@ from module.common.json_layer import json_loads from module.network.RequestFactory import getURL -from module.plugins.internal.MultiHoster import MultiHoster +from module.plugins.internal.MultiHook import MultiHook -class RPNetBiz(MultiHoster): +class RPNetBiz(MultiHook): __name__ = "RPNetBiz" __type__ = "hook" - __version__ = "0.10" + __version__ = "0.11" __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), ("hosterList", "str", "Hoster list (comma separated)", ""), @@ -49,4 +49,4 @@ class RPNetBiz(MultiHoster): return # Run the overwriten core ready which actually enables the multihoster hook - return MultiHoster.coreReady(self) + return MultiHook.coreReady(self) diff --git a/module/plugins/hooks/RealdebridCom.py b/module/plugins/hooks/RealdebridCom.py index 50cc81f0c..066aa52c4 100644 --- a/module/plugins/hooks/RealdebridCom.py +++ b/module/plugins/hooks/RealdebridCom.py @@ -1,13 +1,13 @@ # -*- coding: utf-8 -*- from module.network.RequestFactory import getURL -from module.plugins.internal.MultiHoster import MultiHoster +from module.plugins.internal.MultiHook import MultiHook -class RealdebridCom(MultiHoster): +class RealdebridCom(MultiHook): __name__ = "RealdebridCom" __type__ = "hook" - __version__ = "0.43" + __version__ = "0.44" __config__ = [("https", "bool", "Enable HTTPS", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), diff --git a/module/plugins/hooks/RehostTo.py b/module/plugins/hooks/RehostTo.py index 1bf7d2555..48afa2342 100644 --- a/module/plugins/hooks/RehostTo.py +++ b/module/plugins/hooks/RehostTo.py @@ -1,13 +1,13 @@ # -*- coding: utf-8 -*- from module.network.RequestFactory import getURL -from module.plugins.internal.MultiHoster import MultiHoster +from module.plugins.internal.MultiHook import MultiHook -class RehostTo(MultiHoster): +class RehostTo(MultiHook): __name__ = "RehostTo" __type__ = "hook" - __version__ = "0.43" + __version__ = "0.44" __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("hosterList", "str", "Hoster list (comma separated)", ""), @@ -38,4 +38,4 @@ class RehostTo(MultiHoster): self.ses = data['ses'] self.long_ses = data['long_ses'] - return MultiHoster.coreReady(self) + return MultiHook.coreReady(self) diff --git a/module/plugins/hooks/SimplyPremiumCom.py b/module/plugins/hooks/SimplyPremiumCom.py index cc7e9183c..10a1655c2 100644 --- a/module/plugins/hooks/SimplyPremiumCom.py +++ b/module/plugins/hooks/SimplyPremiumCom.py @@ -2,13 +2,13 @@ from module.common.json_layer import json_loads from module.network.RequestFactory import getURL -from module.plugins.internal.MultiHoster import MultiHoster +from module.plugins.internal.MultiHook import MultiHook -class SimplyPremiumCom(MultiHoster): +class SimplyPremiumCom(MultiHook): __name__ = "SimplyPremiumCom" __type__ = "hook" - __version__ = "0.02" + __version__ = "0.03" __config__ = [("activated", "bool", "Activated", "False"), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), diff --git a/module/plugins/hooks/SimplydebridCom.py b/module/plugins/hooks/SimplydebridCom.py index 173206e75..48568f870 100644 --- a/module/plugins/hooks/SimplydebridCom.py +++ b/module/plugins/hooks/SimplydebridCom.py @@ -1,13 +1,13 @@ # -*- coding: utf-8 -*- from module.network.RequestFactory import getURL -from module.plugins.internal.MultiHoster import MultiHoster +from module.plugins.internal.MultiHook import MultiHook -class SimplydebridCom(MultiHoster): +class SimplydebridCom(MultiHook): __name__ = "SimplydebridCom" __type__ = "hook" - __version__ = "0.01" + __version__ = "0.02" __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("hosterList", "str", "Hoster list (comma separated)", "")] diff --git a/module/plugins/hooks/UnrestrictLi.py b/module/plugins/hooks/UnrestrictLi.py index d87265ef4..245264d44 100644 --- a/module/plugins/hooks/UnrestrictLi.py +++ b/module/plugins/hooks/UnrestrictLi.py @@ -2,13 +2,13 @@ from module.common.json_layer import json_loads from module.network.RequestFactory import getURL -from module.plugins.internal.MultiHoster import MultiHoster +from module.plugins.internal.MultiHook import MultiHook -class UnrestrictLi(MultiHoster): +class UnrestrictLi(MultiHook): __name__ = "UnrestrictLi" __type__ = "hook" - __version__ = "0.02" + __version__ = "0.03" __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("hosterList", "str", "Hoster list (comma separated)", ""), diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 946838e47..589143547 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -10,12 +10,12 @@ class XFileSharingPro(Hook): __type__ = "hook" __version__ = "0.28" - __config__ = [("activated", "bool", "Activated", True), - ("use_hoster_list", "bool", "Load listed hosters only", False), - ("use_crypter_list", "bool", "Load listed crypters only", False), - ("use_builtin_list", "bool", "Load built-in plugin list", True), - ("hoster_list", "str", "Hoster list (comma separated)", ""), - ("crypter_list", "str", "Crypter list (comma separated)", "")] + __config__ = [("activated" , "bool", "Activated" , True ), + ("use_hoster_list" , "bool", "Load listed hosters only" , False), + ("use_crypter_list", "bool", "Load listed crypters only" , False), + ("use_builtin_list", "bool", "Load built-in plugin list" , True ), + ("hoster_list" , "str" , "Hoster list (comma separated)" , "" ), + ("crypter_list" , "str" , "Crypter list (comma separated)", "" )] __description__ = """Load XFileSharingPro based hosters and crypter which don't need a own plugin to run""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/ZeveraCom.py b/module/plugins/hooks/ZeveraCom.py index 6fafb9666..ef1c128f3 100644 --- a/module/plugins/hooks/ZeveraCom.py +++ b/module/plugins/hooks/ZeveraCom.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- from module.network.RequestFactory import getURL -from module.plugins.internal.MultiHoster import MultiHoster +from module.plugins.internal.MultiHook import MultiHook -class ZeveraCom(MultiHoster): +class ZeveraCom(MultiHook): __name__ = "ZeveraCom" __type__ = "hook" __version__ = "0.02" -- cgit v1.2.3 From 87203e996fb42c172b15e29f0e394d5b328d9ac2 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 23 Dec 2014 13:20:53 +0100 Subject: New plugin: MultiHoster --- module/plugins/hooks/ZeveraCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/ZeveraCom.py b/module/plugins/hooks/ZeveraCom.py index ef1c128f3..6ca696f38 100644 --- a/module/plugins/hooks/ZeveraCom.py +++ b/module/plugins/hooks/ZeveraCom.py @@ -7,7 +7,7 @@ from module.plugins.internal.MultiHook import MultiHook class ZeveraCom(MultiHook): __name__ = "ZeveraCom" __type__ = "hook" - __version__ = "0.02" + __version__ = "0.03" __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("hosterList", "str", "Hoster list (comma separated)", "")] -- cgit v1.2.3 From 87ffa4185db663bfc796a678415a49f8dbbab535 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 23 Dec 2014 17:41:57 +0100 Subject: [PremiumizeMe] Fix typo --- module/plugins/hooks/PremiumizeMe.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/PremiumizeMe.py b/module/plugins/hooks/PremiumizeMe.py index 4ebf96451..b37728e06 100644 --- a/module/plugins/hooks/PremiumizeMe.py +++ b/module/plugins/hooks/PremiumizeMe.py @@ -8,7 +8,7 @@ from module.plugins.internal.MultiHook import MultiHook class PremiumizeMe(MultiHook): __name__ = "PremiumizeMe" __type__ = "hook" - __version__ = "0.13" + __version__ = "0.14" __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), ("hosterList", "str", "Hoster list (comma separated)", ""), @@ -30,7 +30,7 @@ class PremiumizeMe(MultiHook): # Get supported hosters list from premiumize.me using the # json API v1 (see https://secure.premiumize.me/?show=api) - answer = getURL("https://api.premiumize.me/pm-api/v1.php" + answer = getURL("https://api.premiumize.me/pm-api/v1.php", get={'method': "hosterlist", 'params[login]': user, 'params[pass]': data['password']}) data = json_loads(answer) -- cgit v1.2.3 From d18ae2d67b9aaf3725c6004e4a83efd2774de397 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 23 Dec 2014 22:13:11 +0100 Subject: [SkipRev] Now should work fine... --- module/plugins/hooks/SkipRev.py | 49 +++++++++++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 14 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py index 0c38ac9af..2a971bb7c 100644 --- a/module/plugins/hooks/SkipRev.py +++ b/module/plugins/hooks/SkipRev.py @@ -1,16 +1,24 @@ # -*- coding: utf-8 -*- +from types import MethodType from urllib import unquote from urlparse import urlparse +from module.PyFile import PyFile from module.plugins.Hook import Hook from module.plugins.Plugin import SkipDownload +def _setup(self): + self.pyfile.plugin._setup() + if self.pyfile.hasStatus("skipped"): + raise SkipDownload(self.pyfile.self.statusname or self.pyfile.pluginname) + + class SkipRev(Hook): __name__ = "SkipRev" __type__ = "hook" - __version__ = "0.17" + __version__ = "0.20" __config__ = [("tokeep", "int", "Number of rev files to keep for package (-1 to auto)", -1)] @@ -24,13 +32,7 @@ class SkipRev(Hook): pass - def _setup(self): - super(self.pyfile.plugin, self).setup() - if self.pyfile.hasStatus("skipped"): - raise SkipDownload(self.pyfile.getStatusName() or self.pyfile.pluginname) - - - def pyname(self, pyfile): + def _pyname(self, pyfile): url = pyfile.url plugin = pyfile.plugin @@ -50,21 +52,35 @@ class SkipRev(Hook): return name + def _pyfile(self, link): + return PyFile(self.core.files, + link.fid, + link.url, + link.name, + link.size, + link.status, + link.error, + link.plugin, + link.packageID, + link.order) + + def downloadPreparing(self, pyfile): - if pyfile.getStatusName() is "unskipped" or not self.pyname(pyfile).endswith(".rev"): + if pyfile.statusname is "unskipped" or not self._pyname(pyfile).endswith(".rev"): return tokeep = self.getConfig("tokeep") if tokeep: saved = [True for link in self.core.api.getPackageData(pyfile.packageid).links \ - if link.name.endswith(".rev") and (link.hasStatus("finished") or link.hasStatus("downloading"))].count(True) + if link.name.endswith(".rev") and link.status in (0, 12)].count(True) if not saved or saved < tokeep: #: keep one rev at least in auto mode return pyfile.setCustomStatus("SkipRev", "skipped") - pyfile.plugin.setup = _setup #: work-around: inject status checker inside the preprocessing routine of the plugin + pyfile.plugin._setup = pyfile.plugin.setup + pyfile.plugin.setup = MethodType(_setup, pyfile.plugin) #: work-around: inject status checker inside the preprocessing routine of the plugin def downloadFailed(self, pyfile): @@ -74,9 +90,14 @@ class SkipRev(Hook): return for link in self.core.api.getPackageData(pyfile.packageid).links: - if link.hasStatus("skipped") and link.name.endswith(".rev"): + if link.status is 4 and link.name.endswith(".rev"): + pylink = self._pyfile(link) + if tokeep > -1 or pyfile.name.endswith(".rev"): - link.setStatus("queued") + pylink.setStatus("queued") else: - link.setCustomStatus("unskipped", "queued") + pylink.setCustomStatus("unskipped", "queued") + + self.core.files.save() + pylink.release() return -- cgit v1.2.3 From a165fce9fdcba70158e3e980b2c0ecf13698c65c Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 23 Dec 2014 22:54:26 +0100 Subject: [SkipRev] Typo --- module/plugins/hooks/SkipRev.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py index 2a971bb7c..1eaee0118 100644 --- a/module/plugins/hooks/SkipRev.py +++ b/module/plugins/hooks/SkipRev.py @@ -12,7 +12,7 @@ from module.plugins.Plugin import SkipDownload def _setup(self): self.pyfile.plugin._setup() if self.pyfile.hasStatus("skipped"): - raise SkipDownload(self.pyfile.self.statusname or self.pyfile.pluginname) + raise SkipDownload(self.pyfile.statusname or self.pyfile.pluginname) class SkipRev(Hook): -- cgit v1.2.3 From 29df1397bbbe80eced4674b6fa39e16540c80901 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Wed, 24 Dec 2014 01:11:44 +0100 Subject: Extractor rewritten --- module/plugins/hooks/ExtractArchive.py | 168 ++++++++++++++++++++++----------- 1 file changed, 115 insertions(+), 53 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index ddec8319b..16942bef0 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -51,32 +51,33 @@ if os.name != "nt": from pwd import getpwnam from module.plugins.Hook import Hook, threaded, Expose -from module.plugins.internal.AbstractExtractor import ArchiveError, CRCError, WrongPassword -from module.utils import save_join, fs_encode +from module.plugins.internal.AbstractExtractor import ArchiveError, CRCError, PasswordError +from module.utils import save_join, uniqify class ExtractArchive(Hook): __name__ = "ExtractArchive" __type__ = "hook" - __version__ = "0.20" - - __config__ = [("activated", "bool", "Activated", True), - ("fullpath", "bool", "Extract full path", True), - ("overwrite", "bool", "Overwrite files", True), - ("passwordfile", "file", "password file", "archive_password.txt"), - ("deletearchive", "bool", "Delete archives when done", False), - ("subfolder", "bool", "Create subfolder for each package", False), - ("destination", "folder", "Extract files to", ""), - ("excludefiles", "str", "Exclude files from unpacking (seperated by ;)", ""), - ("recursive", "bool", "Extract archives in archvies", True), - ("queue", "bool", "Wait for all downloads to be finished", True), - ("renice", "int", "CPU Priority", 0)] + __version__ = "1.00" + + __config__ = [("activated" , "bool" , "Activated" , True ), + ("fullpath" , "bool" , "Extract full path" , True ), + ("overwrite" , "bool" , "Overwrite files" , False ), + ("keepbroken" , "bool" , "Extract broken archives" , False ), + ("repair" , "bool" , "Repair broken archives" , True ), + ("passwordfile" , "file" , "Store passwords in file" , "archive_password.txt" ), + ("delete" , "bool" , "Delete archive when successfully extracted", False ), + ("subfolder" , "bool" , "Create subfolder for each package" , False ), + ("destination" , "folder", "Extract files to" , "" ), + ("extensions" , "str" , "Extract the following extensions" , "7z,bz2,bzip2,gz,gzip,lha,lzh,lzma,rar,tar,taz,tbz,tbz2,tgz,xar,xz,z,zip"), + ("excludefiles" , "str" , "Don't extract the following files" , "*.nfo,*.DS_Store,index.dat,thumb.db" ), + ("recursive" , "bool" , "Extract archives in archives" , True ), + ("queue" , "bool" , "Wait for all downloads to be finished" , True ), + ("renice" , "int" , "CPU Priority" , 0 )] __description__ = """Extract different kind of archives""" __license__ = "GPLv3" - __authors__ = [("RaNaN", "ranan@pyload.org"), - ("AndroKev", None), - ("Walter Purcaro", "vuolter@gmail.com")] + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] event_list = ["allDownloadsProcessed"] @@ -92,7 +93,7 @@ class ExtractArchive(Hook): self.passwords = [] names = [] - for p in ("UnRar", "UnZip"): + for p in ("UnRar", "SevenZip", "UnZip"): try: module = self.core.pluginManager.loadModule("internal", p) klass = getattr(module, p) @@ -154,13 +155,21 @@ class ExtractArchive(Hook): extracted = [] failed = [] + clearlist = lambda string: [x.lstrip('.') for x in string.replace(' ', '').replace(',', '|').replace(';', '|').split('|')] + destination = self.getConfig("destination") subfolder = self.getConfig("subfolder") fullpath = self.getConfig("fullpath") overwrite = self.getConfig("overwrite") - excludefiles = self.getConfig("excludefiles") + extensions = clearlist(self.getConfig("extensions")) + excludefiles = clearlist(self.getConfig("excludefiles")) renice = self.getConfig("renice") recursive = self.getConfig("recursive") + delete = self.getConfig("delete") + keepbroken = self.getConfig("keepbroken") + + if extensions: + self.logDebug("Extensions allowed: %s" % "|.".join(extensions)) # reload from txt file self.reloadPasswords() @@ -171,7 +180,7 @@ class ExtractArchive(Hook): #iterate packages -> plugins -> targets for pid in ids: p = self.core.files.getPackage(pid) - self.logInfo(_("Check package %s") % p.name) + self.logInfo(_("Check package: %s") % p.name) if not p: continue @@ -179,21 +188,25 @@ class ExtractArchive(Hook): out = save_join(dl, p.folder, destination, "") #: force trailing slash if subfolder: - out = save_join(out, fs_encode(p.folder)) + out = save_join(out, p.folder) if not exists(out): makedirs(out) files_ids = [(save_join(dl, p.folder, x['name']), x['id']) for x in p.getChildren().itervalues()] - matched = False - success = True + matched = False + success = True # check as long there are unseen files while files_ids: new_files_ids = [] + if extensions: + files_ids = [(file, id) for file, id in files_ids if filter(lambda ext: file.endswith(ext), extensions)] + for plugin in self.plugins: targets = plugin.getTargets(files_ids) + if targets: self.logDebug("Targets for %s: %s" % (plugin.__name__, targets)) matched = True @@ -205,19 +218,31 @@ class ExtractArchive(Hook): processed.append(target) # prevent extracting same file twice - self.logInfo(basename(target), _("Extract to %s") % out) + self.logInfo(basename(target), _("Extract to: %s") % out) try: - klass = plugin(self, target, out, fullpath, overwrite, excludefiles, renice) + klass = plugin(self, + target, + out, + p.password, + fullpath, + overwrite, + excludefiles, + renice, + delete, + keepbroken) klass.init() - new_files = self._extract(klass, fid, [p.password.strip()], thread) + new_files = self._extract(klass, fid, thread) except Exception, e: self.logError(basename(target), e) + new_files = None + + if new_files is None: success = False continue - self.logDebug("Extracted", new_files) + self.logDebug("Extracted files: %s" % new_files) self.setPermissions(new_files) for file in new_files: @@ -242,43 +267,78 @@ class ExtractArchive(Hook): return True if not failed else False - def _extract(self, plugin, fid, passwords, thread): + def _extract(self, plugin, fid, thread): pyfile = self.core.files.getFile(fid) - deletearchive = self.getConfig("deletearchive") pyfile.setCustomStatus(_("extracting")) thread.addActive(pyfile) # keep this file until everything is done try: - progress = lambda x: pyfile.setProgress(x) - success = False + progress = lambda x: pyfile.setProgress(x) + encrypted = False + passwords = self.getPasswords() + + try: + self.logInfo(basename(plugin.file), "Verifying...") + + tmp_password = plugin.password + plugin.password = "" #: Force verifying without password + + plugin.verify() + + except PasswordError: + encrypted = True + + except CRCError: + self.logWarning(basename(plugin.file), _("Archive damaged")) + + if not self.getConfig("repair"): + raise CRCError + + elif plugin.repair(): + self.logInfo(basename(plugin.file), _("Successfully repaired")) + + elif not self.getConfig("keepbroken"): + raise ArchiveError(_("Broken archive")) + + else: + self.logInfo(basename(plugin.file), _("All OK")) + + plugin.password = tmp_password + + if not encrypted: + plugin.extract(progress) - if not plugin.checkArchive(): - plugin.extract(progress, pw) - success = True else: self.logInfo(basename(plugin.file), _("Password protected")) - self.logDebug("Passwords: %s" % passwords if passwords else "No password provided") - for pw in set(passwords) | set(self.getPasswords()): + if plugin.password: + passwords.insert(0, plugin.password) + passwords = uniqify(self.passwords) + self.logDebug("Password: %s" % plugin.password) + else: + self.logDebug("No package password provided") + + for pw in passwords: try: self.logDebug("Try password: %s" % pw) - if plugin.checkPassword(pw): - plugin.extract(progress, pw) + + if plugin.setPassword(pw): + plugin.extract(progress) self.addPassword(pw) - success = True break + else: + raise PasswordError - except WrongPassword: + except PasswordError: self.logDebug("Password was wrong") - - if not success: - raise Exception(_("Wrong password")) + else: + raise PasswordError if self.core.debug: - self.logDebug("Would delete", ", ".join(plugin.getDeleteFiles())) + self.logDebug("Would delete: %s" % ", ".join(plugin.getDeleteFiles())) - if deletearchive: + if self.getConfig("delete"): files = plugin.getDeleteFiles() self.logInfo(_("Deleting %s files") % len(files)) for f in files: @@ -294,12 +354,16 @@ class ExtractArchive(Hook): return extracted_files - except ArchiveError, e: - self.logError(basename(plugin.file), _("Archive Error"), e) + except PasswordError: + self.logError(basename(plugin.file), _("Wrong password" if passwords else "No password found")) + plugin.password = "" except CRCError: self.logError(basename(plugin.file), _("CRC Mismatch")) + except ArchiveError, e: + self.logError(basename(plugin.file), _("Archive Error"), e) + except Exception, e: if self.core.debug: print_exc() @@ -307,7 +371,7 @@ class ExtractArchive(Hook): self.manager.dispatchEvent("archive_extract_failed", pyfile) - raise Exception(_("Extract failed")) + self.logError(basename(plugin.file), _("Extract failed")) @Expose @@ -337,15 +401,13 @@ class ExtractArchive(Hook): """ Adds a password to saved list""" passwordfile = self.getConfig("passwordfile") - if pw in self.passwords: - self.passwords.remove(pw) - self.passwords.insert(0, pw) + self.passwords = uniqify(self.passwords) try: with open(passwordfile, "wb") as f: for pw in self.passwords: - f.write(pw + "\n") + f.write(pw + '\n') except IOError, e: self.logError(e) -- cgit v1.2.3 From f71c1ef70a199e42e8a519364d9924e138ffd37c Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Wed, 24 Dec 2014 15:48:08 +0100 Subject: [ExtractArchive] Remove empty directory --- module/plugins/hooks/ExtractArchive.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 16942bef0..8b3b4e310 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -58,7 +58,7 @@ from module.utils import save_join, uniqify class ExtractArchive(Hook): __name__ = "ExtractArchive" __type__ = "hook" - __version__ = "1.00" + __version__ = "1.01" __config__ = [("activated" , "bool" , "Activated" , True ), ("fullpath" , "bool" , "Extract full path" , True ), @@ -135,7 +135,7 @@ class ExtractArchive(Hook): self.logInfo(_("Package %s queued for later extracting") % pypack.name) self.queue.append(pid) else: - self.manager.startThread(self.extract, [pid]) + self.extractPackage(pid) @threaded @@ -239,6 +239,7 @@ class ExtractArchive(Hook): new_files = None if new_files is None: + self.logWarning(basename(target), _("No files extracted")) success = False continue @@ -264,6 +265,12 @@ class ExtractArchive(Hook): else: self.logInfo(_("No files found to extract")) + if not matched or not success and subfolder: + try: + os.rmdir(out) + except OSError: + pass + return True if not failed else False -- cgit v1.2.3 From 3a7839e3c8f78c729adde099f071c31abf64ea1b Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Wed, 24 Dec 2014 16:48:08 +0100 Subject: [SkipRev] Improve downloadFailed routine --- module/plugins/hooks/SkipRev.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py index 1eaee0118..cc32c365e 100644 --- a/module/plugins/hooks/SkipRev.py +++ b/module/plugins/hooks/SkipRev.py @@ -18,7 +18,7 @@ def _setup(self): class SkipRev(Hook): __name__ = "SkipRev" __type__ = "hook" - __version__ = "0.20" + __version__ = "0.21" __config__ = [("tokeep", "int", "Number of rev files to keep for package (-1 to auto)", -1)] @@ -72,7 +72,7 @@ class SkipRev(Hook): tokeep = self.getConfig("tokeep") if tokeep: - saved = [True for link in self.core.api.getPackageData(pyfile.packageid).links \ + saved = [True for link in self.core.api.getPackageData(pyfile.package().id).links \ if link.name.endswith(".rev") and link.status in (0, 12)].count(True) if not saved or saved < tokeep: #: keep one rev at least in auto mode @@ -84,12 +84,17 @@ class SkipRev(Hook): def downloadFailed(self, pyfile): + #: Check if pyfile is still "failed", + # maybe might has been restarted in meantime + if pyfile.status != 8: + return + tokeep = self.getConfig("tokeep") if not tokeep: return - for link in self.core.api.getPackageData(pyfile.packageid).links: + for link in self.core.api.getPackageData(pyfile.package().id).links: if link.status is 4 and link.name.endswith(".rev"): pylink = self._pyfile(link) -- cgit v1.2.3 From 429f8b54b11b1df9d99aa8f3fe222e47d98a5faf Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Wed, 24 Dec 2014 16:49:01 +0100 Subject: [UnSkipOnFail] Rewritten --- module/plugins/hooks/UnSkipOnFail.py | 127 ++++++++++++++++++----------------- 1 file changed, 65 insertions(+), 62 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index d3baccfc2..87c21dda7 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -1,22 +1,19 @@ # -*- coding: utf-8 -*- -from os.path import basename - from module.PyFile import PyFile from module.plugins.Hook import Hook -from module.utils import fs_encode class UnSkipOnFail(Hook): __name__ = "UnSkipOnFail" __type__ = "hook" - __version__ = "0.02" + __version__ = "0.03" __config__ = [("activated", "bool", "Activated", True)] - __description__ = """When a download fails, restart skipped duplicates""" + __description__ = """Queue skipped duplicates""" __license__ = "GPLv3" - __authors__ = [("hagg", None)] + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] #@TODO: Remove in 0.4.10 @@ -25,68 +22,74 @@ class UnSkipOnFail(Hook): def downloadFailed(self, pyfile): - pyfile_name = basename(pyfile.name) - pid = pyfile.package().id - msg = _('look for skipped duplicates for %s (pid:%s)') - self.logInfo(msg % (pyfile_name, pid)) - dups = self.findDuplicates(pyfile) - for link in dups: - # check if link is "skipped"(=4) - if link.status == 4: - lpid = link.packageID - self.logInfo(_('restart "%s" (pid:%s)') % (pyfile_name, lpid)) - self.setLinkStatus(link, "queued") - - - def findDuplicates(self, pyfile): + #: Check if pyfile is still "failed", + # maybe might has been restarted in meantime + if pyfile.status != 8: + return + + msg = _("Looking for skipped duplicates of: %s (pid:%s)") + self.logInfo(msg % (pyfile.name, pyfile.package().id)) + + dup = self.findDuplicate(pyfile) + if dup: + self.logInfo(_("Queue found duplicate: %s (pid:%s)") % (dup.name, dup.packageID)) + + #: Change status of "link" to "new_status". + # "link" has to be a valid FileData object, + # "new_status" has to be a valid status name + # (i.e. "queued" for this Plugin) + # It creates a temporary PyFile object using + # "link" data, changes its status, and tells + # the core.files-manager to save its data. + pylink = _pyfile(link) + + pylink.setCustomStatus("UnSkipOnFail", "queued") + + self.core.files.save() + pylink.release() + + else: + self.logInfo(_("No duplicates found")) + + + def findDuplicate(self, pyfile): """ Search all packages for duplicate links to "pyfile". Duplicates are links that would overwrite "pyfile". To test on duplicity the package-folder and link-name - of twolinks are compared (basename(link.name)). + of twolinks are compared (link.name). So this method returns a list of all links with equal package-folders and filenames as "pyfile", but except the data for "pyfile" iotselöf. It does MOT check the link's status. """ - dups = [] - pyfile_name = fs_encode(basename(pyfile.name)) - # get packages (w/o files, as most file data is useless here) - queue = self.core.api.getQueue() + queue = self.api.getQueue() #: get packages (w/o files, as most file data is useless here) + for package in queue: - # check if package-folder equals pyfile's package folder - if fs_encode(package.folder) == fs_encode(pyfile.package().folder): - # now get packaged data w/ files/links - pdata = self.core.api.getPackageData(package.pid) - if pdata.links: - for link in pdata.links: - link_name = fs_encode(basename(link.name)) - # check if link name collides with pdata's name - if link_name == pyfile_name: - # at last check if it is not pyfile itself - if link.fid != pyfile.id: - dups.append(link) - return dups - - - def setLinkStatus(self, link, new_status): - """ Change status of "link" to "new_status". - "link" has to be a valid FileData object, - "new_status" has to be a valid status name - (i.e. "queued" for this Plugin) - It creates a temporary PyFile object using - "link" data, changes its status, and tells - the core.files-manager to save its data. - """ - pyfile = PyFile(self.core.files, - link.fid, - link.url, - link.name, - link.size, - link.status, - link.error, - link.plugin, - link.packageID, - link.order) - pyfile.setStatus(new_status) - self.core.files.save() - pyfile.release() + #: check if package-folder equals pyfile's package folder + if package.folder != pyfile.package().folder: + continue + + #: now get packaged data w/ files/links + pdata = self.api.getPackageData(package.pid) + for link in pdata.links: + #: check if link is "skipped" + if link.status != 4: + continue + + #: check if link name collides with pdata's name + #: AND at last check if it is not pyfile itself + if link.name == pyfile.name and link.fid != pyfile.id: + return link + + + def _pyfile(self, link): + return PyFile(self.core.files, + link.fid, + link.url, + link.name, + link.size, + link.status, + link.error, + link.plugin, + link.packageID, + link.order) -- cgit v1.2.3 From 22285c54c80b59ac17dd6a74dcb2044729258f43 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Wed, 24 Dec 2014 16:50:22 +0100 Subject: [UnSkipOnFail] Rewritten (2) --- module/plugins/hooks/UnSkipOnFail.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index 87c21dda7..fad29b17b 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -11,7 +11,7 @@ class UnSkipOnFail(Hook): __config__ = [("activated", "bool", "Activated", True)] - __description__ = """Queue skipped duplicates""" + __description__ = """Queue skipped duplicates when download fails""" __license__ = "GPLv3" __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] -- cgit v1.2.3 From 8930bf1dc4e3915c46b413d5d61868dabf7d24d3 Mon Sep 17 00:00:00 2001 From: pbr85at <pbr@busical.me> Date: Thu, 25 Dec 2014 12:46:13 +0100 Subject: Update UnSkipOnFail.py indent error --- module/plugins/hooks/UnSkipOnFail.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index fad29b17b..37f193f5d 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -52,7 +52,7 @@ class UnSkipOnFail(Hook): self.logInfo(_("No duplicates found")) - def findDuplicate(self, pyfile): + def findDuplicate(self, pyfile): """ Search all packages for duplicate links to "pyfile". Duplicates are links that would overwrite "pyfile". To test on duplicity the package-folder and link-name -- cgit v1.2.3 From d442ce97a7ba66d90527cfbee313dc5640975def Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Thu, 25 Dec 2014 16:07:09 +0100 Subject: [ClickAndLoad] Revert initPeriodical --- module/plugins/hooks/ClickAndLoad.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py index 27d99c71c..04aac2f10 100644 --- a/module/plugins/hooks/ClickAndLoad.py +++ b/module/plugins/hooks/ClickAndLoad.py @@ -52,7 +52,7 @@ def forward(source, destination): class ClickAndLoad(Hook): __name__ = "ClickAndLoad" __type__ = "hook" - __version__ = "0.23" + __version__ = "0.24" __config__ = [("activated", "bool", "Activated", True), ("extern", "bool", "Allow external link adding", False)] @@ -63,11 +63,6 @@ class ClickAndLoad(Hook): ("mkaay", "mkaay@mkaay.de")] - #@TODO: Remove in 0.4.10 - def initPeriodical(self): - pass - - def coreReady(self): self.port = int(self.config['webinterface']['port']) if self.config['webinterface']['activated']: -- cgit v1.2.3 From 37c4fdbe85bd193ec69e222330f05b7adf742145 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Thu, 25 Dec 2014 16:08:32 +0100 Subject: [UnSkipOnFail] Bump up version --- module/plugins/hooks/UnSkipOnFail.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index 37f193f5d..88557e831 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -7,7 +7,7 @@ from module.plugins.Hook import Hook class UnSkipOnFail(Hook): __name__ = "UnSkipOnFail" __type__ = "hook" - __version__ = "0.03" + __version__ = "0.04" __config__ = [("activated", "bool", "Activated", True)] -- cgit v1.2.3 From 4c63928557398891c30d3e2b7c962a07b3483315 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Fri, 26 Dec 2014 04:18:41 +0100 Subject: Rename AbstractExtractor to Extractor --- module/plugins/hooks/ExtractArchive.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 8b3b4e310..af78ffc93 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -51,14 +51,14 @@ if os.name != "nt": from pwd import getpwnam from module.plugins.Hook import Hook, threaded, Expose -from module.plugins.internal.AbstractExtractor import ArchiveError, CRCError, PasswordError +from module.plugins.internal.Extractor import ArchiveError, CRCError, PasswordError from module.utils import save_join, uniqify class ExtractArchive(Hook): __name__ = "ExtractArchive" __type__ = "hook" - __version__ = "1.01" + __version__ = "1.02" __config__ = [("activated" , "bool" , "Activated" , True ), ("fullpath" , "bool" , "Extract full path" , True ), -- cgit v1.2.3 From 60c4c83ed84f5bf7f638f99d21e74af314935280 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Fri, 26 Dec 2014 04:20:27 +0100 Subject: [UnSkipOnFail] Fixup --- module/plugins/hooks/UnSkipOnFail.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index 88557e831..1becb937a 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -7,7 +7,7 @@ from module.plugins.Hook import Hook class UnSkipOnFail(Hook): __name__ = "UnSkipOnFail" __type__ = "hook" - __version__ = "0.04" + __version__ = "0.05" __config__ = [("activated", "bool", "Activated", True)] @@ -62,7 +62,7 @@ class UnSkipOnFail(Hook): the data for "pyfile" iotselöf. It does MOT check the link's status. """ - queue = self.api.getQueue() #: get packages (w/o files, as most file data is useless here) + queue = self.core.api.getQueue() #: get packages (w/o files, as most file data is useless here) for package in queue: #: check if package-folder equals pyfile's package folder @@ -70,7 +70,7 @@ class UnSkipOnFail(Hook): continue #: now get packaged data w/ files/links - pdata = self.api.getPackageData(package.pid) + pdata = self.core.api.getPackageData(package.pid) for link in pdata.links: #: check if link is "skipped" if link.status != 4: -- cgit v1.2.3 From 575ce629081995766a231f0a9f3e97e3b79d23b1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sat, 27 Dec 2014 21:20:59 +0100 Subject: Update MultiHook based hooks --- module/plugins/hooks/AlldebridCom.py | 11 +++++------ module/plugins/hooks/DebridItaliaCom.py | 13 ++++++------- module/plugins/hooks/EasybytezCom.py | 8 ++++---- module/plugins/hooks/FastixRu.py | 11 +++++------ module/plugins/hooks/FreeWayMe.py | 13 ++++++------- module/plugins/hooks/LinksnappyCom.py | 13 ++++++------- module/plugins/hooks/MegaDebridEu.py | 9 ++++----- module/plugins/hooks/MultishareCz.py | 11 +++++------ module/plugins/hooks/MyfastfileCom.py | 13 ++++++------- module/plugins/hooks/NoPremiumPl.py | 2 +- module/plugins/hooks/OverLoadMe.py | 13 ++++++------- module/plugins/hooks/PremiumTo.py | 11 +++++------ module/plugins/hooks/PremiumizeMe.py | 13 ++++++------- module/plugins/hooks/RPNetBiz.py | 13 ++++++------- module/plugins/hooks/RealdebridCom.py | 13 ++++++------- module/plugins/hooks/RehostTo.py | 13 ++++++------- module/plugins/hooks/SimplyPremiumCom.py | 13 ++++++------- module/plugins/hooks/SimplydebridCom.py | 11 +++++------ module/plugins/hooks/UnrestrictLi.py | 13 ++++++------- module/plugins/hooks/XFileSharingPro.py | 22 +++++++++++----------- module/plugins/hooks/ZeveraCom.py | 11 +++++------ 21 files changed, 116 insertions(+), 134 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/AlldebridCom.py b/module/plugins/hooks/AlldebridCom.py index d5986053f..88a637de7 100644 --- a/module/plugins/hooks/AlldebridCom.py +++ b/module/plugins/hooks/AlldebridCom.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- -from module.network.RequestFactory import getURL from module.plugins.internal.MultiHook import MultiHook @@ -10,9 +9,9 @@ class AlldebridCom(MultiHook): __version__ = "0.14" __config__ = [("https", "bool", "Enable HTTPS", False), - ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), - ("hosterList", "str", "Hoster list (comma separated)", ""), - ("unloadFailing", "bool", "Revert to stanard download if download fails", False), + ("mode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), + ("pluginlist", "str", "Hoster list (comma separated)", ""), + ("revertfailed", "bool", "Revert to stanard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 24)] __description__ = """Alldebrid.com hook plugin""" @@ -20,8 +19,8 @@ class AlldebridCom(MultiHook): __authors__ = [("Andy Voigt", "spamsales@online.de")] - def getHoster(self): + def getHosters(self): https = "https" if self.getConfig("https") else "http" - page = getURL(https + "://www.alldebrid.com/api.php", get={'action': "get_host"}).replace("\"", "").strip() + page = self.getURL(https + "://www.alldebrid.com/api.php", get={'action': "get_host"}).replace("\"", "").strip() return [x.strip() for x in page.split(",") if x.strip()] diff --git a/module/plugins/hooks/DebridItaliaCom.py b/module/plugins/hooks/DebridItaliaCom.py index e31bc98d7..d18be5384 100644 --- a/module/plugins/hooks/DebridItaliaCom.py +++ b/module/plugins/hooks/DebridItaliaCom.py @@ -2,18 +2,17 @@ import re -from module.network.RequestFactory import getURL from module.plugins.internal.MultiHook import MultiHook class DebridItaliaCom(MultiHook): __name__ = "DebridItaliaCom" __type__ = "hook" - __version__ = "0.10" + __version__ = "0.11" - __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), - ("hosterList", "str", "Hoster list (comma separated)", ""), - ("unloadFailing", "bool", "Revert to standard download if download fails", False), + __config__ = [("mode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), + ("pluginlist", "str", "Hoster list (comma separated)", ""), + ("revertfailed", "bool", "Revert to standard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 24)] __description__ = """Debriditalia.com hook plugin""" @@ -22,5 +21,5 @@ class DebridItaliaCom(MultiHook): ("Walter Purcaro", "vuolter@gmail.com")] - def getHoster(self): - return getURL("http://debriditalia.com/api.php", get={'hosts': ""}).replace('"', '').split(',') + def getHosters(self): + return self.getURL("http://debriditalia.com/api.php", get={'hosts': ""}).replace('"', '').split(',') diff --git a/module/plugins/hooks/EasybytezCom.py b/module/plugins/hooks/EasybytezCom.py index 0dab2a7fe..16149580c 100644 --- a/module/plugins/hooks/EasybytezCom.py +++ b/module/plugins/hooks/EasybytezCom.py @@ -8,17 +8,17 @@ from module.plugins.internal.MultiHook import MultiHook class EasybytezCom(MultiHook): __name__ = "EasybytezCom" __type__ = "hook" - __version__ = "0.04" + __version__ = "0.05" - __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), - ("hosterList", "str", "Hoster list (comma separated)", "")] + __config__ = [("mode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), + ("pluginlist", "str", "Hoster list (comma separated)", "")] __description__ = """EasyBytez.com hook plugin""" __license__ = "GPLv3" __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - def getHoster(self): + def getHosters(self): self.account = self.core.accountManager.getAccountPlugin(self.__name__) user = self.account.selectAccount()[0] diff --git a/module/plugins/hooks/FastixRu.py b/module/plugins/hooks/FastixRu.py index 73297eb23..a4b423fb7 100644 --- a/module/plugins/hooks/FastixRu.py +++ b/module/plugins/hooks/FastixRu.py @@ -1,17 +1,16 @@ # -*- coding: utf-8 -*- from module.common.json_layer import json_loads -from module.network.RequestFactory import getURL from module.plugins.internal.MultiHook import MultiHook class FastixRu(MultiHook): __name__ = "FastixRu" __type__ = "hook" - __version__ = "0.03" + __version__ = "0.04" - __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), - ("unloadFailing", "bool", "Revert to standard download if download fails", False), + __config__ = [("mode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), + ("revertfailed", "bool", "Revert to standard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 24)] __description__ = """Fastix.ru hook plugin""" @@ -19,8 +18,8 @@ class FastixRu(MultiHook): __authors__ = [("Massimo Rosamilia", "max@spiritix.eu")] - def getHoster(self): - page = getURL("http://fastix.ru/api_v2", + def getHosters(self): + page = self.getURL("http://fastix.ru/api_v2", get={'apikey': "5182964c3f8f9a7f0b00000a_kelmFB4n1IrnCDYuIFn2y", 'sub' : "allowed_sources"}) host_list = json_loads(page) diff --git a/module/plugins/hooks/FreeWayMe.py b/module/plugins/hooks/FreeWayMe.py index 0b71fc35b..f2a4f2d34 100644 --- a/module/plugins/hooks/FreeWayMe.py +++ b/module/plugins/hooks/FreeWayMe.py @@ -1,17 +1,16 @@ # -*- coding: utf-8 -*- -from module.network.RequestFactory import getURL from module.plugins.internal.MultiHook import MultiHook class FreeWayMe(MultiHook): __name__ = "FreeWayMe" __type__ = "hook" - __version__ = "0.12" + __version__ = "0.13" - __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), - ("hosterList", "str", "Hoster list (comma separated)", ""), - ("unloadFailing", "bool", "Revert to stanard download if download fails", False), + __config__ = [("mode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), + ("pluginlist", "str", "Hoster list (comma separated)", ""), + ("revertfailed", "bool", "Revert to stanard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 24)] __description__ = """FreeWay.me hook plugin""" @@ -19,7 +18,7 @@ class FreeWayMe(MultiHook): __authors__ = [("Nicolas Giese", "james@free-way.me")] - def getHoster(self): - hostis = getURL("https://www.free-way.me/ajax/jd.php", get={'id': 3}).replace("\"", "").strip() + def getHosters(self): + hostis = self.getURL("https://www.free-way.me/ajax/jd.php", get={'id': 3}).replace("\"", "").strip() self.logDebug("Hosters", hostis) return [x.strip() for x in hostis.split(",") if x.strip()] diff --git a/module/plugins/hooks/LinksnappyCom.py b/module/plugins/hooks/LinksnappyCom.py index 96bf1c0d1..a1c4b90f7 100644 --- a/module/plugins/hooks/LinksnappyCom.py +++ b/module/plugins/hooks/LinksnappyCom.py @@ -1,18 +1,17 @@ # -*- coding: utf-8 -*- from module.common.json_layer import json_loads -from module.network.RequestFactory import getURL from module.plugins.internal.MultiHook import MultiHook class LinksnappyCom(MultiHook): __name__ = "LinksnappyCom" __type__ = "hook" - __version__ = "0.02" + __version__ = "0.03" - __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), - ("hosterList", "str", "Hoster list (comma separated)", ""), - ("unloadFailing", "bool", "Revert to standard download if download fails", False), + __config__ = [("mode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), + ("pluginlist", "str", "Hoster list (comma separated)", ""), + ("revertfailed", "bool", "Revert to standard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 24)] __description__ = """Linksnappy.com hook plugin""" @@ -20,8 +19,8 @@ class LinksnappyCom(MultiHook): __authors__ = [("stickell", "l.stickell@yahoo.it")] - def getHoster(self): - json_data = getURL("http://gen.linksnappy.com/lseAPI.php", get={'act': "FILEHOSTS"}) + def getHosters(self): + json_data = self.getURL("http://gen.linksnappy.com/lseAPI.php", get={'act': "FILEHOSTS"}) json_data = json_loads(json_data) return json_data['return'].keys() diff --git a/module/plugins/hooks/MegaDebridEu.py b/module/plugins/hooks/MegaDebridEu.py index f3a0c31ea..5fb7e1ea6 100644 --- a/module/plugins/hooks/MegaDebridEu.py +++ b/module/plugins/hooks/MegaDebridEu.py @@ -1,24 +1,23 @@ # -*- coding: utf-8 -*- from module.common.json_layer import json_loads -from module.network.RequestFactory import getURL from module.plugins.internal.MultiHook import MultiHook class MegaDebridEu(MultiHook): __name__ = "MegaDebridEu" __type__ = "hook" - __version__ = "0.03" + __version__ = "0.04" - __config__ = [("unloadFailing", "bool", "Revert to standard download if download fails", False)] + __config__ = [("revertfailed", "bool", "Revert to standard download if download fails", False)] __description__ = """mega-debrid.eu hook plugin""" __license__ = "GPLv3" __authors__ = [("D.Ducatel", "dducatel@je-geek.fr")] - def getHoster(self): - reponse = getURL("http://www.mega-debrid.eu/api.php", get={'action': "getHosters"}) + def getHosters(self): + reponse = self.getURL("http://www.mega-debrid.eu/api.php", get={'action': "getHosters"}) json_data = json_loads(reponse) if json_data['response_code'] == "ok": diff --git a/module/plugins/hooks/MultishareCz.py b/module/plugins/hooks/MultishareCz.py index 5ec5b63b6..2dadf5dc1 100644 --- a/module/plugins/hooks/MultishareCz.py +++ b/module/plugins/hooks/MultishareCz.py @@ -2,17 +2,16 @@ import re -from module.network.RequestFactory import getURL from module.plugins.internal.MultiHook import MultiHook class MultishareCz(MultiHook): __name__ = "MultishareCz" __type__ = "hook" - __version__ = "0.05" + __version__ = "0.06" - __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), - ("hosterList", "str", "Hoster list (comma separated)", "uloz.to")] + __config__ = [("mode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), + ("pluginlist", "str", "Hoster list (comma separated)", "uloz.to")] __description__ = """MultiShare.cz hook plugin""" __license__ = "GPLv3" @@ -22,6 +21,6 @@ class MultishareCz(MultiHook): HOSTER_PATTERN = r'<img class="logo-shareserveru"[^>]*?alt="([^"]+)"></td>\s*<td class="stav">[^>]*?alt="OK"' - def getHoster(self): - page = getURL("http://www.multishare.cz/monitoring/") + def getHosters(self): + page = self.getURL("http://www.multishare.cz/monitoring/") return re.findall(self.HOSTER_PATTERN, page) diff --git a/module/plugins/hooks/MyfastfileCom.py b/module/plugins/hooks/MyfastfileCom.py index ec7c4e55b..2fda0d3bf 100644 --- a/module/plugins/hooks/MyfastfileCom.py +++ b/module/plugins/hooks/MyfastfileCom.py @@ -1,18 +1,17 @@ # -*- coding: utf-8 -*- from module.common.json_layer import json_loads -from module.network.RequestFactory import getURL from module.plugins.internal.MultiHook import MultiHook class MyfastfileCom(MultiHook): __name__ = "MyfastfileCom" __type__ = "hook" - __version__ = "0.03" + __version__ = "0.04" - __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), - ("hosterList", "str", "Hoster list (comma separated)", ""), - ("unloadFailing", "bool", "Revert to standard download if download fails", False), + __config__ = [("mode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), + ("pluginlist", "str", "Hoster list (comma separated)", ""), + ("revertfailed", "bool", "Revert to standard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 24)] __description__ = """Myfastfile.com hook plugin""" @@ -20,8 +19,8 @@ class MyfastfileCom(MultiHook): __authors__ = [("stickell", "l.stickell@yahoo.it")] - def getHoster(self): - json_data = getURL("http://myfastfile.com/api.php", get={'hosts': ""}, decode=True) + def getHosters(self): + json_data = self.getURL("http://myfastfile.com/api.php", get={'hosts': ""}, decode=True) self.logDebug("JSON data", json_data) json_data = json_loads(json_data) diff --git a/module/plugins/hooks/NoPremiumPl.py b/module/plugins/hooks/NoPremiumPl.py index f60cb3dd6..84a019b8d 100644 --- a/module/plugins/hooks/NoPremiumPl.py +++ b/module/plugins/hooks/NoPremiumPl.py @@ -3,7 +3,7 @@ from module.plugins.internal.MultiHoster import MultiHoster from module.network.RequestFactory import getURL from module.common.json_layer import json_loads as loads - + class NoPremiumPl(MultiHoster): __name__ = "NoPremiumPl" diff --git a/module/plugins/hooks/OverLoadMe.py b/module/plugins/hooks/OverLoadMe.py index 378ce0a65..eb3da319a 100644 --- a/module/plugins/hooks/OverLoadMe.py +++ b/module/plugins/hooks/OverLoadMe.py @@ -1,18 +1,17 @@ # -*- coding: utf-8 -*- -from module.network.RequestFactory import getURL from module.plugins.internal.MultiHook import MultiHook class OverLoadMe(MultiHook): __name__ = "OverLoadMe" __type__ = "hook" - __version__ = "0.02" + __version__ = "0.03" __config__ = [("https", "bool", "Enable HTTPS", True), - ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), - ("hosterList", "str", "Hoster list (comma separated)", ""), - ("unloadFailing", "bool", "Revert to standard download if download fails", False), + ("mode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), + ("pluginlist", "str", "Hoster list (comma separated)", ""), + ("revertfailed", "bool", "Revert to standard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 12)] __description__ = """Over-Load.me hook plugin""" @@ -20,9 +19,9 @@ class OverLoadMe(MultiHook): __authors__ = [("marley", "marley@over-load.me")] - def getHoster(self): + def getHosters(self): https = "https" if self.getConfig("https") else "http" - page = getURL(https + "://api.over-load.me/hoster.php", + page = self.getURL(https + "://api.over-load.me/hoster.php", get={'auth': "0001-cb1f24dadb3aa487bda5afd3b76298935329be7700cd7-5329be77-00cf-1ca0135f"}).replace("\"", "").strip() self.logDebug("Hosterlist", page) diff --git a/module/plugins/hooks/PremiumTo.py b/module/plugins/hooks/PremiumTo.py index 3087db552..348bb6789 100644 --- a/module/plugins/hooks/PremiumTo.py +++ b/module/plugins/hooks/PremiumTo.py @@ -1,16 +1,15 @@ # -*- coding: utf-8 -*- -from module.network.RequestFactory import getURL from module.plugins.internal.MultiHook import MultiHook class PremiumTo(MultiHook): __name__ = "PremiumTo" __type__ = "hook" - __version__ = "0.05" + __version__ = "0.06" - __config__ = [("hosterListMode", "all;listed;unlisted", "Use for downloads from supported hosters:", "all"), - ("hosterList", "str", "Hoster list (comma separated)", "")] + __config__ = [("mode", "all;listed;unlisted", "Use for downloads from supported hosters:", "all"), + ("pluginlist", "str", "Hoster list (comma separated)", "")] __description__ = """Premium.to hook plugin""" __license__ = "GPLv3" @@ -19,8 +18,8 @@ class PremiumTo(MultiHook): ("stickell", "l.stickell@yahoo.it")] - def getHoster(self): - page = getURL("http://premium.to/api/hosters.php", + def getHosters(self): + page = self.getURL("http://premium.to/api/hosters.php", get={'username': self.account.username, 'password': self.account.password}) return [x.strip() for x in page.replace("\"", "").split(";")] diff --git a/module/plugins/hooks/PremiumizeMe.py b/module/plugins/hooks/PremiumizeMe.py index b37728e06..e23f13895 100644 --- a/module/plugins/hooks/PremiumizeMe.py +++ b/module/plugins/hooks/PremiumizeMe.py @@ -1,18 +1,17 @@ # -*- coding: utf-8 -*- from module.common.json_layer import json_loads -from module.network.RequestFactory import getURL from module.plugins.internal.MultiHook import MultiHook class PremiumizeMe(MultiHook): __name__ = "PremiumizeMe" __type__ = "hook" - __version__ = "0.14" + __version__ = "0.15" - __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), - ("hosterList", "str", "Hoster list (comma separated)", ""), - ("unloadFailing", "bool", "Revert to stanard download if download fails", False), + __config__ = [("mode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), + ("pluginlist", "str", "Hoster list (comma separated)", ""), + ("revertfailed", "bool", "Revert to stanard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 24)] __description__ = """Premiumize.me hook plugin""" @@ -20,7 +19,7 @@ class PremiumizeMe(MultiHook): __authors__ = [("Florian Franzen", "FlorianFranzen@gmail.com")] - def getHoster(self): + def getHosters(self): # If no accounts are available there will be no hosters available if not self.account or not self.account.canUse(): return [] @@ -30,7 +29,7 @@ class PremiumizeMe(MultiHook): # Get supported hosters list from premiumize.me using the # json API v1 (see https://secure.premiumize.me/?show=api) - answer = getURL("https://api.premiumize.me/pm-api/v1.php", + answer = self.getURL("https://api.premiumize.me/pm-api/v1.php", get={'method': "hosterlist", 'params[login]': user, 'params[pass]': data['password']}) data = json_loads(answer) diff --git a/module/plugins/hooks/RPNetBiz.py b/module/plugins/hooks/RPNetBiz.py index c54f7d445..5af355fcc 100644 --- a/module/plugins/hooks/RPNetBiz.py +++ b/module/plugins/hooks/RPNetBiz.py @@ -1,18 +1,17 @@ # -*- coding: utf-8 -*- from module.common.json_layer import json_loads -from module.network.RequestFactory import getURL from module.plugins.internal.MultiHook import MultiHook class RPNetBiz(MultiHook): __name__ = "RPNetBiz" __type__ = "hook" - __version__ = "0.11" + __version__ = "0.12" - __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), - ("hosterList", "str", "Hoster list (comma separated)", ""), - ("unloadFailing", "bool", "Revert to stanard download if download fails", False), + __config__ = [("mode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), + ("pluginlist", "str", "Hoster list (comma separated)", ""), + ("revertfailed", "bool", "Revert to stanard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 24)] __description__ = """RPNet.biz hook plugin""" @@ -20,7 +19,7 @@ class RPNetBiz(MultiHook): __authors__ = [("Dman", "dmanugm@gmail.com")] - def getHoster(self): + def getHosters(self): # No hosts supported if no account if not self.account or not self.account.canUse(): return [] @@ -28,7 +27,7 @@ class RPNetBiz(MultiHook): # Get account data (user, data) = self.account.selectAccount() - res = getURL("https://premium.rpnet.biz/client_api.php", + res = self.getURL("https://premium.rpnet.biz/client_api.php", get={'username': user, 'password': data['password'], 'action': "showHosterList"}) hoster_list = json_loads(res) diff --git a/module/plugins/hooks/RealdebridCom.py b/module/plugins/hooks/RealdebridCom.py index 066aa52c4..05a6df1dd 100644 --- a/module/plugins/hooks/RealdebridCom.py +++ b/module/plugins/hooks/RealdebridCom.py @@ -1,18 +1,17 @@ # -*- coding: utf-8 -*- -from module.network.RequestFactory import getURL from module.plugins.internal.MultiHook import MultiHook class RealdebridCom(MultiHook): __name__ = "RealdebridCom" __type__ = "hook" - __version__ = "0.44" + __version__ = "0.45" __config__ = [("https", "bool", "Enable HTTPS", False), - ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), - ("hosterList", "str", "Hoster list (comma separated)", ""), - ("unloadFailing", "bool", "Revert to stanard download if download fails", False), + ("mode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), + ("pluginlist", "str", "Hoster list (comma separated)", ""), + ("revertfailed", "bool", "Revert to stanard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 24)] __description__ = """Real-Debrid.com hook plugin""" @@ -20,8 +19,8 @@ class RealdebridCom(MultiHook): __authors__ = [("Devirex Hazzard", "naibaf_11@yahoo.de")] - def getHoster(self): + def getHosters(self): https = "https" if self.getConfig("https") else "http" - page = getURL(https + "://real-debrid.com/api/hosters.php").replace("\"", "").strip() + page = self.getURL(https + "://real-debrid.com/api/hosters.php").replace("\"", "").strip() return [x.strip() for x in page.split(",") if x.strip()] diff --git a/module/plugins/hooks/RehostTo.py b/module/plugins/hooks/RehostTo.py index 48afa2342..207449e6a 100644 --- a/module/plugins/hooks/RehostTo.py +++ b/module/plugins/hooks/RehostTo.py @@ -1,17 +1,16 @@ # -*- coding: utf-8 -*- -from module.network.RequestFactory import getURL from module.plugins.internal.MultiHook import MultiHook class RehostTo(MultiHook): __name__ = "RehostTo" __type__ = "hook" - __version__ = "0.44" + __version__ = "0.45" - __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), - ("hosterList", "str", "Hoster list (comma separated)", ""), - ("unloadFailing", "bool", "Revert to stanard download if download fails", False), + __config__ = [("mode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), + ("pluginlist", "str", "Hoster list (comma separated)", ""), + ("revertfailed", "bool", "Revert to stanard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 24)] __description__ = """Rehost.to hook plugin""" @@ -19,8 +18,8 @@ class RehostTo(MultiHook): __authors__ = [("RaNaN", "RaNaN@pyload.org")] - def getHoster(self): - page = getURL("http://rehost.to/api.php", + def getHosters(self): + page = self.getURL("http://rehost.to/api.php", get={'cmd': "get_supported_och_dl", 'long_ses': self.long_ses}) return [x.strip() for x in page.replace("\"", "").split(",")] diff --git a/module/plugins/hooks/SimplyPremiumCom.py b/module/plugins/hooks/SimplyPremiumCom.py index 10a1655c2..5f2d2a42c 100644 --- a/module/plugins/hooks/SimplyPremiumCom.py +++ b/module/plugins/hooks/SimplyPremiumCom.py @@ -1,19 +1,18 @@ # -*- coding: utf-8 -*- from module.common.json_layer import json_loads -from module.network.RequestFactory import getURL from module.plugins.internal.MultiHook import MultiHook class SimplyPremiumCom(MultiHook): __name__ = "SimplyPremiumCom" __type__ = "hook" - __version__ = "0.03" + __version__ = "0.04" __config__ = [("activated", "bool", "Activated", "False"), - ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), - ("hosterList", "str", "Hoster list (comma separated)", ""), - ("unloadFailing", "bool", "Revert to standard download if download fails", "False"), + ("mode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), + ("pluginlist", "str", "Hoster list (comma separated)", ""), + ("revertfailed", "bool", "Revert to standard download if download fails", "False"), ("interval", "int", "Reload interval in hours (0 to disable)", "24")] __description__ = """Simply-Premium.com hook plugin""" @@ -21,8 +20,8 @@ class SimplyPremiumCom(MultiHook): __authors__ = [("EvolutionClip", "evolutionclip@live.de")] - def getHoster(self): - json_data = getURL("http://www.simply-premium.com/api/hosts.php", get={'format': "json", 'online': 1}) + def getHosters(self): + json_data = self.getURL("http://www.simply-premium.com/api/hosts.php", get={'format': "json", 'online': 1}) json_data = json_loads(json_data) host_list = [element['regex'] for element in json_data['result']] diff --git a/module/plugins/hooks/SimplydebridCom.py b/module/plugins/hooks/SimplydebridCom.py index 48568f870..13c957294 100644 --- a/module/plugins/hooks/SimplydebridCom.py +++ b/module/plugins/hooks/SimplydebridCom.py @@ -1,22 +1,21 @@ # -*- coding: utf-8 -*- -from module.network.RequestFactory import getURL from module.plugins.internal.MultiHook import MultiHook class SimplydebridCom(MultiHook): __name__ = "SimplydebridCom" __type__ = "hook" - __version__ = "0.02" + __version__ = "0.03" - __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), - ("hosterList", "str", "Hoster list (comma separated)", "")] + __config__ = [("mode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), + ("pluginlist", "str", "Hoster list (comma separated)", "")] __description__ = """Simply-Debrid.com hook plugin""" __license__ = "GPLv3" __authors__ = [("Kagenoshin", "kagenoshin@gmx.ch")] - def getHoster(self): - page = getURL("http://simply-debrid.com/api.php", get={'list': 1}) + def getHosters(self): + page = self.getURL("http://simply-debrid.com/api.php", get={'list': 1}) return [x.strip() for x in page.rstrip(';').replace("\"", "").split(";")] diff --git a/module/plugins/hooks/UnrestrictLi.py b/module/plugins/hooks/UnrestrictLi.py index 245264d44..e481e8449 100644 --- a/module/plugins/hooks/UnrestrictLi.py +++ b/module/plugins/hooks/UnrestrictLi.py @@ -1,18 +1,17 @@ # -*- coding: utf-8 -*- from module.common.json_layer import json_loads -from module.network.RequestFactory import getURL from module.plugins.internal.MultiHook import MultiHook class UnrestrictLi(MultiHook): __name__ = "UnrestrictLi" __type__ = "hook" - __version__ = "0.03" + __version__ = "0.04" - __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), - ("hosterList", "str", "Hoster list (comma separated)", ""), - ("unloadFailing", "bool", "Revert to standard download if download fails", False), + __config__ = [("mode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), + ("pluginlist", "str", "Hoster list (comma separated)", ""), + ("revertfailed", "bool", "Revert to standard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 24), ("history", "bool", "Delete History", False)] @@ -21,8 +20,8 @@ class UnrestrictLi(MultiHook): __authors__ = [("stickell", "l.stickell@yahoo.it")] - def getHoster(self): - json_data = getURL("http://unrestrict.li/api/jdownloader/hosts.php", get={'format': "json"}) + def getHosters(self): + json_data = self.getURL("http://unrestrict.li/api/jdownloader/hosts.php", get={'format': "json"}) json_data = json_loads(json_data) host_list = [element['host'] for element in json_data['result']] diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 589143547..79e373ad3 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -28,16 +28,16 @@ class XFileSharingPro(Hook): 'crypter': (r'https?://(?:www\.)?([\w.^_]+(?:\.[a-zA-Z]{2,})(?:\:\d+)?)/(?:user|folder)s?/\w+', r'https?://(?:[^/]+\.)?(%s)/(?:user|folder)s?/\w+')} - HOSTER_LIST = [#WORKING HOSTERS: - "eyesfile.ca", "file4safe.com", "fileband.com", "filedwon.com", "filevice.com", "hostingbulk.com", - "ravishare.com", "salefiles.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", - #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: - "amonshare.com", "banicrazy.info", "boosterking.com", "host4desi.com", "laoupload.com", "rd-fs.com"] - CRYPTER_LIST = [] + HOSTER_BUILTIN = [#WORKING HOSTERS: + "eyesfile.ca", "file4safe.com", "fileband.com", "filedwon.com", "filevice.com", "hostingbulk.com", + "ravishare.com", "salefiles.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", + #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: + "amonshare.com", "banicrazy.info", "boosterking.com", "host4desi.com", "laoupload.com", "rd-fs.com"] + CRYPTER_BUILTIN = [] # def pluginConfigChanged(self.__name__, plugin, name, value): @@ -68,7 +68,7 @@ class XFileSharingPro(Hook): plugin_list = set([x.strip() for x in s.split(',')]) if use_builtin_list: - plugin_list |= set([x.lower() for x in getattr(self, "%s_LIST" % type.upper())]) + plugin_list |= set([x.lower() for x in getattr(self, "%s_BUILTIN" % type.upper())]) plugin_list -= set(('', u'')) diff --git a/module/plugins/hooks/ZeveraCom.py b/module/plugins/hooks/ZeveraCom.py index 6ca696f38..51f759b1c 100644 --- a/module/plugins/hooks/ZeveraCom.py +++ b/module/plugins/hooks/ZeveraCom.py @@ -1,22 +1,21 @@ # -*- coding: utf-8 -*- -from module.network.RequestFactory import getURL from module.plugins.internal.MultiHook import MultiHook class ZeveraCom(MultiHook): __name__ = "ZeveraCom" __type__ = "hook" - __version__ = "0.03" + __version__ = "0.04" - __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), - ("hosterList", "str", "Hoster list (comma separated)", "")] + __config__ = [("mode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), + ("pluginlist", "str", "Hoster list (comma separated)", "")] __description__ = """Real-Debrid.com hook plugin""" __license__ = "GPLv3" __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - def getHoster(self): - page = getURL("http://www.zevera.com/jDownloader.ashx", get={'cmd': "gethosters"}) + def getHosters(self): + page = self.getURL("http://www.zevera.com/jDownloader.ashx", get={'cmd': "gethosters"}) return [x.strip() for x in page.replace("\"", "").split(",")] -- cgit v1.2.3 From c0a7430ef5218da41787de001de04d3ded89d8b5 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sat, 27 Dec 2014 21:21:47 +0100 Subject: [LinkdecrypterCom] Extend MultiHook --- module/plugins/hooks/LinkdecrypterCom.py | 64 +++++++------------------------- 1 file changed, 13 insertions(+), 51 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/LinkdecrypterCom.py b/module/plugins/hooks/LinkdecrypterCom.py index b0ce335d0..8592efd3d 100644 --- a/module/plugins/hooks/LinkdecrypterCom.py +++ b/module/plugins/hooks/LinkdecrypterCom.py @@ -2,64 +2,26 @@ import re -from module.network.RequestFactory import getURL -from module.plugins.Hook import Hook -from module.utils import remove_chars +from module.plugins.internal.MultiHook import MultiHook -class LinkdecrypterCom(Hook): +class LinkdecrypterCom(MultiHook): __name__ = "LinkdecrypterCom" __type__ = "hook" - __version__ = "0.21" + __version__ = "1.00" + + __config__ = [("mode" , "all;listed;unlisted", "Use for crypters (if supported)" , "all"), + ("pluginlist" , "str" , "Crypter list (comma separated)" , "" ), + ("interval" , "int" , "Reload interval in hours (0 to disable)" , 12 )] __description__ = """Linkdecrypter.com hook plugin""" __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - #@TODO: Remove in 0.4.10 - def initPeriodical(self): - pass - - def coreReady(self): + def getCrypters(self): try: - self.loadPatterns() - except Exception, e: - self.logError(e) - - - def loadPatterns(self): - html = getURL("http://linkdecrypter.com/") - - m = re.search(r'<title>', html) - if m is None: - self.logError(_("Linkdecrypter site is down")) - return - - m = re.search(r'<b>Supported\(\d+\)</b>: <i>([^+<]*)', html) - if m is None: - self.logError(_("Crypter list not found")) - return - - builtin = [name.lower() for name in self.core.pluginManager.crypterPlugins.keys()] - builtin.append("downloadserienjunkiesorg") - - crypter_pattern = re.compile("(\w[\w.-]+)") - online = [] - for crypter in m.group(1).split(', '): - m = re.match(crypter_pattern, crypter) - if m and remove_chars(m.group(1), "-.") not in builtin: - online.append(m.group(1).replace(".", "\\.")) - - if not online: - self.logError(_("Crypter list is empty")) - return - - regexp = r'https?://([^.]+\.)*?(%s)/.*' % '|'.join(online) - - dict = self.core.pluginManager.crypterPlugins[self.__name__] - dict['pattern'] = regexp - dict['re'] = re.compile(regexp) - - self.logDebug("Loaded pattern: %s" % regexp) + html = self.getURL("http://linkdecrypter.com/") + return re.search(r'>Supported\(\d+\)</b>: <i>(.+?) \+ RSDF', html).group(1).split(', ') + except Exception: + return list() -- cgit v1.2.3 From 9410d10fd0491fcd1b5a073109085f16917ec2aa Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sat, 27 Dec 2014 21:23:59 +0100 Subject: [AlldebridCom] Bump up version --- module/plugins/hooks/AlldebridCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/AlldebridCom.py b/module/plugins/hooks/AlldebridCom.py index 88a637de7..cd279e733 100644 --- a/module/plugins/hooks/AlldebridCom.py +++ b/module/plugins/hooks/AlldebridCom.py @@ -6,7 +6,7 @@ from module.plugins.internal.MultiHook import MultiHook class AlldebridCom(MultiHook): __name__ = "AlldebridCom" __type__ = "hook" - __version__ = "0.14" + __version__ = "0.15" __config__ = [("https", "bool", "Enable HTTPS", False), ("mode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), -- cgit v1.2.3