summaryrefslogtreecommitdiffstats
path: root/module/plugins/hooks
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hooks')
-rw-r--r--module/plugins/hooks/BypassCaptcha.py4
-rwxr-xr-xmodule/plugins/hooks/Captcha9kw.py4
-rw-r--r--module/plugins/hooks/CaptchaTrader.py4
-rw-r--r--module/plugins/hooks/ExtractArchive.py4
-rw-r--r--module/plugins/hooks/ImageTyperz.py4
-rw-r--r--module/plugins/hooks/RestartFailed.py137
6 files changed, 32 insertions, 125 deletions
diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py
index 24ad17dd8..e24a439af 100644
--- a/module/plugins/hooks/BypassCaptcha.py
+++ b/module/plugins/hooks/BypassCaptcha.py
@@ -41,9 +41,9 @@ class BypassCaptchaException(Exception):
class BypassCaptcha(Hook):
__name__ = "BypassCaptcha"
- __version__ = "0.03"
+ __version__ = "0.04"
__description__ = """send captchas to BypassCaptcha.com"""
- __config__ = [("activated", "bool", "Activated", True),
+ __config__ = [("activated", "bool", "Activated", False),
("force", "bool", "Force BC even if client is connected", False),
("passkey", "password", "Passkey", "")]
__author_name__ = ("RaNaN", "Godofdream", "zoidberg")
diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py
index bb2b8c862..f7226fc59 100755
--- a/module/plugins/hooks/Captcha9kw.py
+++ b/module/plugins/hooks/Captcha9kw.py
@@ -30,9 +30,9 @@ from module.plugins.Hook import Hook
class Captcha9kw(Hook):
__name__ = "Captcha9kw"
- __version__ = "0.04"
+ __version__ = "0.05"
__description__ = """send captchas to 9kw.eu"""
- __config__ = [("activated", "bool", "Activated", True),
+ __config__ = [("activated", "bool", "Activated", False),
("force", "bool", "Force CT even if client is connected", True),
("https", "bool", "Enable HTTPS", "False"),
("confirm", "bool", "Confirm Captcha", "False"),
diff --git a/module/plugins/hooks/CaptchaTrader.py b/module/plugins/hooks/CaptchaTrader.py
index 2b8a50a8e..c648c0bd8 100644
--- a/module/plugins/hooks/CaptchaTrader.py
+++ b/module/plugins/hooks/CaptchaTrader.py
@@ -46,9 +46,9 @@ class CaptchaTraderException(Exception):
class CaptchaTrader(Hook):
__name__ = "CaptchaTrader"
- __version__ = "0.14"
+ __version__ = "0.15"
__description__ = """send captchas to captchatrader.com"""
- __config__ = [("activated", "bool", "Activated", True),
+ __config__ = [("activated", "bool", "Activated", False),
("username", "str", "Username", ""),
("force", "bool", "Force CT even if client is connected", False),
("passkey", "password", "Password", ""),]
diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py
index a5a973b7f..f55589fec 100644
--- a/module/plugins/hooks/ExtractArchive.py
+++ b/module/plugins/hooks/ExtractArchive.py
@@ -58,7 +58,7 @@ class ExtractArchive(Hook):
Provides: unrarFinished (folder, filename)
"""
__name__ = "ExtractArchive"
- __version__ = "0.12"
+ __version__ = "0.13"
__description__ = "Extract different kind of archives"
__config__ = [("activated", "bool", "Activated", True),
("fullpath", "bool", "Extract full path", True),
@@ -153,7 +153,7 @@ class ExtractArchive(Hook):
out = save_join(dl, p.folder, self.getConfig("destination"), "")
#relative to package folder if destination is relative, otherwise absolute path overwrites them
- if self.getConf("subfolder"):
+ if self.getConfig("subfolder"):
out = join(out, fs_encode(p.folder))
if not exists(out):
diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py
index 59b6334a7..f8f515113 100644
--- a/module/plugins/hooks/ImageTyperz.py
+++ b/module/plugins/hooks/ImageTyperz.py
@@ -42,9 +42,9 @@ class ImageTyperzException(Exception):
class ImageTyperz(Hook):
__name__ = "ImageTyperz"
- __version__ = "0.03"
+ __version__ = "0.04"
__description__ = """send captchas to ImageTyperz.com"""
- __config__ = [("activated", "bool", "Activated", True),
+ __config__ = [("activated", "bool", "Activated", False),
("username", "str", "Username", ""),
("passkey", "password", "Password", ""),
("force", "bool", "Force IT even if client is connected", False)]
diff --git a/module/plugins/hooks/RestartFailed.py b/module/plugins/hooks/RestartFailed.py
index 7ee53deb9..b8339e9e3 100644
--- a/module/plugins/hooks/RestartFailed.py
+++ b/module/plugins/hooks/RestartFailed.py
@@ -1,124 +1,31 @@
- # -*- 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 <http://www.gnu.org/licenses/>.
-
- @author: Walter Purcaro
-"""
+# -*- coding: utf-8 -*-
from module.plugins.Hook import Hook
-from time import time
-
class RestartFailed(Hook):
__name__ = "RestartFailed"
- __version__ = "1.5"
- __description__ = "Automatically restart failed/aborted downloads"
- __config__ = [
- ("activated", "bool", "Activated", "True"),
- ("dlFail", "bool", "Restart when download fail", "True"),
- ("dlFail_n", "int", "Only when failed downloads are at least", "5"),
- ("dlFail_i", "int", "Only when elapsed time since last restart is (min)", "10"),
- ("dlPrcs", "bool", "Restart after all downloads are processed", "True"),
- ("recnt", "bool", "Restart after reconnecting", "True"),
- ("rsLoad", "bool", "Restart on plugin activation", "False")
- ]
- __author_name__ = ("Walter Purcaro")
- __author_mail__ = ("vuolter@gmail.com")
-
- def restart(self, arg=None):
- # self.logDebug("self.restart")
- self.info["timerflag"] = False
- self.info["dlfailed"] = 0
- self.core.api.restartFailed()
- self.logDebug("self.restart: self.core.api.restartFailed")
- self.info["lastrstime"] = time()
-
- def periodical(self):
- # self.logDebug("self.periodical")
- if self.info["timerflag"]:
- self.restart()
-
- def checkInterval(self, arg=None):
- # self.logDebug("self.checkInterval")
- now = time()
- lastrstime = self.info["lastrstime"]
- interval = self.getConfig("dlFail_i") * 60
- if now < lastrstime + interval:
- self.info["timerflag"] = True
- else:
- self.restart()
-
- def checkFailed(self, pyfile):
- # self.logDebug("self.checkFailed")
- self.info["dlfailed"] += 1
- curr = self.info["dlfailed"]
- max = self.getConfig("dlFail_n")
- if curr >= max:
- self.checkInterval()
-
- def addEvent(self, event, handler):
- if event in self.manager.events:
- if handler not in self.manager.events[event]:
- self.manager.events[event].append(handler)
- # self.logDebug("self.addEvent: " + event + ": added handler")
- else:
- # self.logDebug("self.addEvent: " + event + ": NOT added handler")
- return False
- else:
- self.manager.events[event] = [handler]
- # self.logDebug("self.addEvent: " + event + ": added event and handler")
- return True
+ __version__ = "1.51"
+ __description__ = "restartedFailed Packages after defined time"
+ __config__ = [("activated", "bool", "Activated" , "False"),
+ ("interval", "int", "Interval in Minutes", "15") ]
+
+ __author_name__ = ("bambie")
+ __author_mail__ = ("bambie@gulli.com")
- def removeEvent(self, event, handler):
- if event in self.manager.events and handler in self.manager.events[event]:
- self.manager.events[event].remove(handler)
- # self.logDebug("self.removeEvent: " + event + ": removed handler")
- return True
- else:
- # self.logDebug("self.removeEvent: " + event + ": NOT removed handler")
- return False
+ interval = 300
- def configEvents(self, plugin=None, name=None, value=None):
- # self.logDebug("self.configEvents")
- self.interval = self.getConfig("dlFail_i") * 60
- dlFail = self.getConfig("dlFail")
- dlPrcs = self.getConfig("dlPrcs")
- recnt = self.getConfig("recnt")
- if dlPrcs:
- self.addEvent("allDownloadsProcessed", self.checkInterval)
- else:
- self.removeEvent("allDownloadsProcessed", self.checkInterval)
- if not dlFail:
- self.info["timerflag"] = False
- if recnt:
- self.addEvent("afterReconnecting", self.restart)
- else:
- self.removeEvent("afterReconnecting", self.restart)
-
- def unload(self):
- # self.logDebug("self.unload")
- self.removeEvent("pluginConfigChanged", self.configEvents)
- self.removeEvent("downloadFailed", self.checkFailed)
- self.removeEvent("allDownloadsProcessed", self.checkInterval)
- self.removeEvent("afterReconnecting", self.restart)
+ def setup(self):
+ self.info = {"running": False}
def coreReady(self):
- # self.logDebug("self.coreReady")
- self.info = {"dlfailed": 0, "lastrstime": 0, "timerflag": False}
- if self.getConfig("rsLoad"):
- self.restart()
- self.addEvent("downloadFailed", self.checkFailed)
- self.addEvent("pluginConfigChanged", self.configEvents)
- self.configEvents()
+ self.info["running"] = True
+ self.logInfo("loaded")
+ self.interval = self.getConfig("interval") * 60
+ self.logDebug("interval is set to %s", self.interval)
+
+ def periodical(self):
+ self.logDebug("periodical called")
+ if self.getConfig("interval") * 60 != self.interval:
+ self.interval = self.getConfig("interval") * 60
+ self.logDebug("interval is set to %s", self.interval)
+ self.core.api.restartFailed()