diff options
author | Walter Purcaro <vuolter@gmail.com> | 2015-02-16 21:59:10 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2015-02-16 21:59:10 +0100 |
commit | 8e7d14bae4d3c836f029a1235eb227380acc3f75 (patch) | |
tree | ebd0679642cccb994e70a89a106b394189cb28bc /module/plugins/hooks | |
parent | Merge branch 'stable' into 0.4.10 (diff) | |
download | pyload-8e7d14bae4d3c836f029a1235eb227380acc3f75.tar.xz |
Fix plugins to work on 0.4.10
Diffstat (limited to 'module/plugins/hooks')
37 files changed, 0 insertions, 2204 deletions
diff --git a/module/plugins/hooks/AlldebridCom.py b/module/plugins/hooks/AlldebridCom.py deleted file mode 100644 index fd89571eb..000000000 --- a/module/plugins/hooks/AlldebridCom.py +++ /dev/null @@ -1,29 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.MultiHook import MultiHook - - -class AlldebridCom(MultiHook): - __name__ = "AlldebridCom" - __type__ = "hook" - __version__ = "0.16" - - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("retry" , "int" , "Number of retries before revert" , 10 ), - ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 ), - ("ssl" , "bool" , "Use HTTPS" , True )] - - __description__ = """Alldebrid.com hook plugin""" - __license__ = "GPLv3" - __authors__ = [("Andy Voigt", "spamsales@online.de")] - - - def getHosters(self): - https = "https" if self.getConfig("ssl") else "http" - html = self.getURL(https + "://www.alldebrid.com/api.php", get={'action': "get_host"}).replace("\"", "").strip() - - return [x.strip() for x in html.split(",") if x.strip()] diff --git a/module/plugins/hooks/AndroidPhoneNotify.py b/module/plugins/hooks/AndroidPhoneNotify.py deleted file mode 100644 index a3b24a255..000000000 --- a/module/plugins/hooks/AndroidPhoneNotify.py +++ /dev/null @@ -1,80 +0,0 @@ -# -*- coding: utf-8 -*- - -from time import time - -from module.network.RequestFactory import getURL -from module.plugins.Hook import Hook - - -class AndroidPhoneNotify(Hook): - __name__ = "AndroidPhoneNotify" - __type__ = "hook" - __version__ = "0.05" - - __config__ = [("apikey" , "str" , "API key" , "" ), - ("notifycaptcha" , "bool", "Notify captcha request" , True ), - ("notifypackage" , "bool", "Notify package finished" , True ), - ("notifyprocessed", "bool", "Notify processed packages status" , True ), - ("timeout" , "int" , "Timeout between captchas in seconds" , 5 ), - ("force" , "bool", "Send notifications if client is connected", False)] - - __description__ = """Send push notifications to your Android Phone using notifymyandroid.com""" - __license__ = "GPLv3" - __authors__ = [("Steven Kosyra", "steven.kosyra@gmail.com"), - ("Walter Purcaro", "vuolter@gmail.com")] - - - event_list = ["allDownloadsProcessed"] - - - #@TODO: Remove in 0.4.10 - def initPeriodical(self): - pass - - - def setup(self): - self.info = {} #@TODO: Remove in 0.4.10 - self.last_notify = 0 - - - def newCaptchaTask(self, task): - if not self.getConfig("notifycaptcha"): - return False - - if time() - self.last_notify < self.getConf("timeout"): - return False - - self.notify(_("Captcha"), _("New request waiting user input")) - - - def packageFinished(self, pypack): - if self.getConfig("notifypackage"): - self.notify(_("Package finished"), pypack.name) - - - def allDownloadsProcessed(self): - if not self.getConfig("notifyprocessed"): - return False - - if any(True for pdata in self.core.api.getQueue() if pdata.linksdone < pdata.linkstotal): - self.notify(_("Package failed"), _("One or more packages was not completed successfully")) - else: - self.notify(_("All packages finished")) - - - def notify(self, event, msg=""): - apikey = self.getConfig("apikey") - - if not apikey: - return False - - if self.core.isClientConnected() and not self.getConfig("force"): - return False - - getURL("http://www.notifymyandroid.com/publicapi/notify", - get={'apikey' : apikey, - 'application': "pyLoad", - 'event' : event, - 'description': msg}) - - self.last_notify = time() diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py deleted file mode 100644 index bd19fe953..000000000 --- a/module/plugins/hooks/BypassCaptcha.py +++ /dev/null @@ -1,135 +0,0 @@ -# -*- coding: utf-8 -*- - -from pycurl import FORM_FILE, LOW_SPEED_TIME - -from module.network.HTTPRequest import BadHeader -from module.network.RequestFactory import getURL, getRequest -from module.plugins.Addon import Addon, threaded - - -class BypassCaptchaException(Exception): - - def __init__(self, err): - self.err = err - - - def getCode(self): - return self.err - - - def __str__(self): - return "<BypassCaptchaException %s>" % self.err - - - def __repr__(self): - return "<BypassCaptchaException %s>" % self.err - - -class BypassCaptcha(Addon): - __name__ = "BypassCaptcha" - __type__ = "hook" - __version__ = "0.06" - - __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")] - - - 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" - - - def getCredits(self): - res = getURL(self.GETCREDITS_URL, post={"key": self.getConfig("passkey")}) - - data = dict(x.split(' ', 1) for x in res.splitlines()) - return int(data['Left']) - - - def submit(self, captcha, captchaType="file", match=None): - req = getRequest() - - #raise timeout threshold - req.c.setopt(LOW_SPEED_TIME, 80) - - try: - 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 res.splitlines()) - if not data or "Value" not in data: - raise BypassCaptchaException(res) - - result = data['Value'] - ticket = data['TaskId'] - self.logDebug("Result %s : %s" % (ticket, result)) - - return ticket, result - - - def respond(self, ticket, success): - try: - 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"), e) - - - def captchaTask(self, task): - if "service" in task.data: - return False - - if not task.isTextual(): - return False - - if not self.getConfig("passkey"): - return False - - if self.core.isClientConnected() and not self.getConfig("force"): - return False - - if self.getCredits() > 0: - task.handler.append(self) - task.data['service'] = self.__name__ - task.setWaiting(100) - self._processCaptcha(task) - - 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) - - - @threaded - def _processCaptcha(self, task): - c = task.captchaFile - try: - ticket, result = self.submit(c) - except BypassCaptchaException, e: - task.error = e.getCode() - return - - task.data['ticket'] = ticket - task.setResult(result) diff --git a/module/plugins/hooks/Captcha9Kw.py b/module/plugins/hooks/Captcha9Kw.py deleted file mode 100644 index 04caff345..000000000 --- a/module/plugins/hooks/Captcha9Kw.py +++ /dev/null @@ -1,251 +0,0 @@ -# -*- coding: utf-8 -*- - -from __future__ import with_statement - -import re - -from base64 import b64encode -from time import sleep - -from pyload.network.HTTPRequest import BadHeader -from pyload.network.RequestFactory import getURL - -from module.plugins.Hook import Hook, threaded - - -class Captcha9kw(Hook): - __name__ = "Captcha9Kw" - __type__ = "hook" - __version__ = "0.28" - - __config__ = [("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" - __authors__ = [("RaNaN", "RaNaN@pyload.org"), - ("Walter Purcaro", "vuolter@gmail.com")] - - - API_URL = "http://www.9kw.eu/index.cgi" - - - def activate(self): - if self.getConfig("ssl"): - self.API_URL = self.API_URL.replace("http://", "https://") - - - def getCredits(self): - res = getURL(self.API_URL, - get={'apikey': self.getConfig("passkey"), - 'pyload': "1", - 'source': "pyload", - 'action': "usercaptchaguthaben"}) - - if res.isdigit(): - self.logInfo(_("%s credits left") % res) - credits = self.info['credits'] = int(res) - return credits - else: - self.logError(res) - return 0 - - - @threaded - def _processCaptcha(self, task): - try: - with open(task.captchaFile, 'rb') as f: - data = f.read() - - except IOError, e: - self.logError(e) - return - - pluginname = re.search(r'_([^_]*)_\d+.\w+', task.captchaFile).group(1) - option = {'min' : 2, - 'max' : 50, - 'phrase' : 0, - 'numeric' : 0, - 'case_sensitive': 0, - 'math' : 0, - 'prio' : min(max(self.getConfig("prio"), 0), 10), - 'confirm' : self.getConfig("confirm"), - 'timeout' : min(max(self.getConfig("timeout"), 300), 3999), - 'selfsolve' : self.getConfig("selfsolve"), - 'cph' : self.getConfig("captchaperhour"), - 'cpm' : self.getConfig("captchapermin")} - - for opt in str(self.getConfig("hoster_options").split('|')): - - details = map(str.strip, opt.split(':')) - - if not details or details[0].lower() != pluginname.lower(): - continue - - for d in details: - hosteroption = d.split("=") - - 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'], - 'captchapermin' : option['cpm'], - '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' : 1 if task.isPositional() else 0, - 'file-upload-01': b64encode(data), - 'action' : "usercaptchaupload"} - - for _i in xrange(5): - try: - res = getURL(self.API_URL, post=post_data) - except BadHeader, e: - sleep(3) - else: - if res and res.isdigit(): - break - else: - self.logError(_("Bad upload: %s") % res) - return - - self.logDebug(_("NewCaptchaID ticket: %s") % res, task.captchaFile) - - task.data["ticket"] = res - - for _i 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(_("Captcha result for ticket %s: %s") % (res, result)) - - task.setResult(result) - - - def captchaTask(self, task): - if not task.isTextual() and not task.isPositional(): - return - - if not self.getConfig("passkey"): - return - - 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")) - return - - queue = min(self.getConfig("queue"), 999) - timeout = min(max(self.getConfig("timeout"), 300), 3999) - pluginname = re.search(r'_([^_]*)_\d+.\w+', task.captchaFile).group(1) - - 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 - - sleep(10) - else: - self.fail(_("Too many captchas in queue")) - - for opt in str(self.getConfig("hoster_options").split('|')): - details = map(str.strip, opt.split(':')) - - if not details or details[0].lower() != pluginname.lower(): - continue - - for d in details: - hosteroption = d.split("=") - - if len(hosteroption) > 1 \ - and hosteroption[0].lower() == 'timeout' \ - and hosteroption[1].isdigit(): - timeout = int(hosteroption[1]) - - break - - task.handler.append(self) - - task.setWaiting(timeout) - - self._processCaptcha(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 - - passkey = self.getConfig("passkey") - - for _i 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"]}) - - self.logDebug("Request %s: %s" % (type, res)) - - if res == "OK": - break - - sleep(5) - else: - self.logDebug("Could not send %s request: %s" % (type, res)) - - - def captchaCorrect(self, task): - self._captchaResponse(task, True) - - - def captchaInvalid(self, task): - self._captchaResponse(task, False) diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py deleted file mode 100644 index ba9d3eb8e..000000000 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ /dev/null @@ -1,167 +0,0 @@ -# -*- coding: utf-8 -*- - -from __future__ import with_statement - -import StringIO -import pycurl - -try: - from PIL import Image -except ImportError: - import Image - -from time import sleep -from urllib import urlencode - -from pyload.network.RequestFactory import getURL, getRequest -from module.plugins.Hook import Hook, threaded - - -class CaptchaBrotherhoodException(Exception): - - def __init__(self, err): - self.err = err - - - def getCode(self): - return self.err - - - def __str__(self): - return "<CaptchaBrotherhoodException %s>" % self.err - - - def __repr__(self): - return "<CaptchaBrotherhoodException %s>" % self.err - - -class CaptchaBrotherhood(Addon): - __name__ = "CaptchaBrotherhood" - __type__ = "hook" - __version__ = "0.08" - - __config__ = [("username", "str", "Username", ""), - ("force", "bool", "Force CT even if client is connected", False), - ("passkey", "password", "Password", "")] - - __description__ = """Send captchas to CaptchaBrotherhood.com""" - __license__ = "GPLv3" - __authors__ = [("RaNaN", "RaNaN@pyload.org"), - ("zoidberg", "zoidberg@mujmail.cz")] - - - API_URL = "http://www.captchabrotherhood.com/" - - - def getCredits(self): - 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(res[3:]) - self.logInfo(_("%d credits left") % credits) - self.info['credits'] = credits - return credits - - - def submit(self, captcha, captchaType="file", match=None): - try: - img = Image.open(captcha) - output = StringIO.StringIO() - self.logDebug("CAPTCHA IMAGE", img, img.format, img.mode) - if img.format in ("GIF", "JPEG"): - img.save(output, img.format) - else: - if img.mode != "RGB": - img = img.convert("RGB") - img.save(output, "JPEG") - data = output.getvalue() - output.close() - except Exception, e: - raise CaptchaBrotherhoodException("Reading or converting captcha image failed: %s" % e) - - req = getRequest() - - url = "%ssendNewCaptcha.aspx?%s" % (self.API_URL, - urlencode({'username' : self.getConfig("username"), - 'password' : self.getConfig("passkey"), - 'captchaSource': "pyLoad", - 'timeout' : "80"})) - - req.c.setopt(pycurl.URL, url) - req.c.setopt(pycurl.POST, 1) - req.c.setopt(pycurl.POSTFIELDS, data) - req.c.setopt(pycurl.HTTPHEADER, ["Content-Type: text/html"]) - - try: - req.c.perform() - res = req.getResponse() - except Exception, e: - raise CaptchaBrotherhoodException("Submit captcha image failed") - - req.close() - - if not res.startswith("OK"): - raise CaptchaBrotherhoodException(res[1]) - - ticket = res[3:] - - for _i in xrange(15): - sleep(5) - res = self.api_response("askCaptchaResult", ticket) - if res.startswith("OK-answered"): - return ticket, res[12:] - - raise CaptchaBrotherhoodException("No solution received in time") - - - def api_response(self, api, ticket): - res = getURL("%s%s.aspx" % (self.API_URL, api), - get={"username": self.getConfig("username"), - "password": self.getConfig("passkey"), - "captchaID": ticket}) - if not res.startswith("OK"): - raise CaptchaBrotherhoodException("Unknown response: %s" % res) - - return res - - - def captchaTask(self, task): - if "service" in task.data: - return False - - 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.data['service'] = self.__name__ - task.setWaiting(100) - self._processCaptcha(task) - 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: - res = self.api_response("complainCaptcha", task.data['ticket']) - - - @threaded - def _processCaptcha(self, task): - c = task.captchaFile - try: - ticket, result = self.submit(c) - except CaptchaBrotherhoodException, e: - task.error = e.getCode() - return - - task.data['ticket'] = ticket - task.setResult(result) diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py deleted file mode 100644 index 8b53872e4..000000000 --- a/module/plugins/hooks/ClickAndLoad.py +++ /dev/null @@ -1,124 +0,0 @@ -# -*- coding: utf-8 -*- - -import socket - -from threading import Lock - -from module.plugins.Hook import Hook, threaded - - -def forward(source, destination): - try: - bufsize = 1024 - bufdata = source.recv(bufsize) - while bufdata: - destination.sendall(bufdata) - bufdata = source.recv(bufsize) - finally: - destination.shutdown(socket.SHUT_WR) - - -#: create_connection wrapper for python 2.5 socket module -def create_connection(address, timeout=object(), source_address=None): - if hasattr(socket, 'create_connection'): - if type(timeout) == object: - timeout = socket._GLOBAL_DEFAULT_TIMEOUT - - return socket.create_connection(address, timeout, source_address) - - else: - host, port = address - err = None - for res in getaddrinfo(host, port, 0, SOCK_STREAM): - af, socktype, proto, canonname, sa = res - sock = None - try: - sock = socket(af, socktype, proto) - if type(timeout) != object: - sock.settimeout(timeout) - if source_address: - sock.bind(source_address) - sock.connect(sa) - return sock - - except socket.error, _: - err = _ - if sock is not None: - sock.close() - - if err is not None: - raise err - else: - raise socket.error("getaddrinfo returns an empty list") - - -class ClickAndLoad(Hook): - __name__ = "ClickAndLoad" - __type__ = "hook" - __version__ = "0.35" - - __config__ = [("activated", "bool", "Activated" , True), - ("port" , "int" , "Port" , 9666), - ("extern" , "bool", "Listen on the public network interface", True)] - - __description__ = """Click'N'Load hook plugin""" - __license__ = "GPLv3" - __authors__ = [("RaNaN", "RaNaN@pyload.de"), - ("Walter Purcaro", "vuolter@gmail.com")] - - - #@TODO: Remove in 0.4.10 - def initPeriodical(self): - pass - - - def coreReady(self): - if not self.config['webinterface']['activated']: - return - - ip = socket.gethostbyname(socket.gethostname()) if self.getConfig("extern") else "127.0.0.1" - webport = int(self.config['webinterface']['port']) - cnlport = self.getConfig('port') - - self.proxy(ip, webport, cnlport) - - - @threaded - def proxy(self, ip, webport, cnlport): - self.manager.startThread(self._server, ip, webport, cnlport) - lock = Lock() - lock.acquire() - lock.acquire() - - - def _server(self, ip, webport, cnlport, thread): - try: - server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - server_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) - server_socket.bind((ip, cnlport)) - server_socket.listen(5) - - while True: - client_socket = server_socket.accept()[0] - dock_socket = create_connection(("127.0.0.1", webport)) - - self.manager.startThread(forward, dock_socket, client_socket) - self.manager.startThread(forward, client_socket, dock_socket) - - except socket.error, e: - self.logDebug(e) - self._server(ip, webport, cnlport, thread) - - except Exception, e: - self.logError(e) - - try: - client_socket.close() - dock_socket.close() - except Exception: - pass - - try: - server_socket.close() - except Exception: - pass diff --git a/module/plugins/hooks/DeathByCaptcha.py b/module/plugins/hooks/DeathByCaptcha.py deleted file mode 100644 index 8786df12f..000000000 --- a/module/plugins/hooks/DeathByCaptcha.py +++ /dev/null @@ -1,214 +0,0 @@ -# -*- coding: utf-8 -*- - -from __future__ import with_statement - -import re - -from base64 import b64encode -from pycurl import FORM_FILE, HTTPHEADER -from time import sleep - -from pyload.utils import json_loads -from pyload.network.HTTPRequest import BadHeader -from pyload.network.RequestFactory import getRequest -from module.plugins.Hook import Hook, threaded - - -class DeathByCaptchaException(Exception): - DBC_ERRORS = {'not-logged-in': 'Access denied, check your credentials', - 'invalid-credentials': 'Access denied, check your credentials', - 'banned': 'Access denied, account is suspended', - 'insufficient-funds': 'Insufficient account balance to decrypt CAPTCHA', - 'invalid-captcha': 'CAPTCHA is not a valid image', - 'service-overload': 'CAPTCHA was rejected due to service overload, try again later', - '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 "<DeathByCaptchaException %s>" % self.err - - - def __repr__(self): - return "<DeathByCaptchaException %s>" % self.err - - -class DeathByCaptcha(Addon): - __name__ = "DeathByCaptcha" - __type__ = "hook" - __version__ = "0.06" - - __config__ = [("username", "str", "Username", ""), - ("passkey", "password", "Password", ""), - ("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")] - - - API_URL = "http://api.dbcapi.me/api/" - - - def api_response(self, api="captcha", post=False, multipart=False): - req = getRequest() - req.c.setopt(HTTPHEADER, ["Accept: application/json", "User-Agent: pyLoad %s" % self.core.version]) - - if post: - if not isinstance(post, dict): - post = {} - post.update({"username": self.getConfig("username"), - "password": self.getConfig("passkey")}) - - res = None - try: - json = req.load("%s%s" % (self.API_URL, api), - post=post, - multipart=multipart) - self.logDebug(json) - res = json_loads(json) - - if "error" in res: - raise DeathByCaptchaException(res['error']) - elif "status" not in res: - raise DeathByCaptchaException(str(res)) - - except BadHeader, e: - if 403 == e.code: - raise DeathByCaptchaException('not-logged-in') - elif 413 == e.code: - raise DeathByCaptchaException('invalid-captcha') - elif 503 == e.code: - raise DeathByCaptchaException('service-overload') - elif e.code in (400, 405): - raise DeathByCaptchaException('invalid-request') - else: - raise - - finally: - req.close() - - return res - - - def getCredits(self): - res = self.api_response("user", True) - - if 'is_banned' in res and res['is_banned']: - raise DeathByCaptchaException('banned') - elif 'balance' in res and 'rate' in res: - self.info.update(res) - else: - raise DeathByCaptchaException(res) - - - def getStatus(self): - res = self.api_response("status", False) - - if 'is_service_overloaded' in res and res['is_service_overloaded']: - raise DeathByCaptchaException('service-overload') - - - def submit(self, captcha, captchaType="file", match=None): - #@NOTE: Workaround multipart-post bug in HTTPRequest.py - if re.match("^\w*$", self.getConfig("passkey")): - multipart = True - data = (FORM_FILE, captcha) - else: - multipart = False - with open(captcha, 'rb') as f: - data = f.read() - data = "base64:" + b64encode(data) - - res = self.api_response("captcha", {"captchafile": data}, multipart) - - if "captcha" not in res: - raise DeathByCaptchaException(res) - ticket = res['captcha'] - - for _i in xrange(24): - sleep(5) - res = self.api_response("captcha/%d" % ticket, False) - if res['text'] and res['is_correct']: - break - else: - raise DeathByCaptchaException('timed-out') - - result = res['text'] - self.logDebug("Result %s : %s" % (ticket, result)) - - return ticket, result - - - def captchaTask(self, task): - if "service" in task.data: - return False - - 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 - - try: - self.getStatus() - self.getCredits() - except DeathByCaptchaException, e: - self.logError(e.getDesc()) - 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)) - - if balance > rate: - task.handler.append(self) - task.data['service'] = self.__name__ - task.setWaiting(180) - self._processCaptcha(task) - - - def captchaInvalid(self, task): - if task.data['service'] == self.__name__ and "ticket" in task.data: - try: - res = self.api_response("captcha/%d/report" % task.data['ticket'], True) - - except DeathByCaptchaException, e: - self.logError(e.getDesc()) - - except Exception, e: - self.logError(e) - - - @threaded - def _processCaptcha(self, task): - c = task.captchaFile - try: - ticket, result = self.submit(c) - except DeathByCaptchaException, e: - task.error = e.getCode() - self.logError(e.getDesc()) - return - - task.data['ticket'] = ticket - task.setResult(result) diff --git a/module/plugins/hooks/DebridItaliaCom.py b/module/plugins/hooks/DebridItaliaCom.py deleted file mode 100644 index 719f3dd3a..000000000 --- a/module/plugins/hooks/DebridItaliaCom.py +++ /dev/null @@ -1,28 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from module.plugins.internal.MultiHook import MultiHook - - -class DebridItaliaCom(MultiHook): - __name__ = "DebridItaliaCom" - __type__ = "hook" - __version__ = "0.12" - - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("retry" , "int" , "Number of retries before revert" , 10 ), - ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 )] - - __description__ = """Debriditalia.com hook plugin""" - __license__ = "GPLv3" - __authors__ = [("stickell", "l.stickell@yahoo.it"), - ("Walter Purcaro", "vuolter@gmail.com")] - - - 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 deleted file mode 100644 index 85c616054..000000000 --- a/module/plugins/hooks/EasybytezCom.py +++ /dev/null @@ -1,32 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from module.plugins.internal.MultiHook import MultiHook - - -class EasybytezCom(MultiHook): - __name__ = "EasybytezCom" - __type__ = "hook" - __version__ = "0.07" - - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("retry" , "int" , "Number of retries before revert" , 10 ), - ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 )] - - __description__ = """EasyBytez.com hook plugin""" - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - - - def getHosters(self): - user, data = self.account.selectAccount() - - req = self.account.getAccountRequest(user) - html = req.load("http://www.easybytez.com") - - return re.search(r'</textarea>\s*Supported sites:(.*)', html).group(1).split(',') diff --git a/module/plugins/hooks/ExpertDecoders.py b/module/plugins/hooks/ExpertDecoders.py deleted file mode 100644 index 04f6d0795..000000000 --- a/module/plugins/hooks/ExpertDecoders.py +++ /dev/null @@ -1,96 +0,0 @@ -# -*- coding: utf-8 -*- - -from __future__ import with_statement - -from base64 import b64encode -from pycurl import LOW_SPEED_TIME -from uuid import uuid4 - -from module.network.HTTPRequest import BadHeader -from module.network.RequestFactory import getURL, getRequest -from module.plugins.Hook import Hook, threaded - - -class ExpertDecoders(Addon): - __name__ = "ExpertDecoders" - __type__ = "hook" - __version__ = "0.04" - - __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")] - - - API_URL = "http://www.fasttypers.org/imagepost.ashx" - - - def getCredits(self): - res = getURL(self.API_URL, post={"key": self.getConfig("passkey"), "action": "balance"}) - - if res.isdigit(): - self.logInfo(_("%s credits left") % res) - self.info['credits'] = credits = int(res) - return credits - else: - self.logError(res) - return 0 - - - @threaded - def _processCaptcha(self, task): - task.data['ticket'] = ticket = uuid4() - result = None - - with open(task.captchaFile, 'rb') as f: - data = f.read() - - req = getRequest() - #raise timeout threshold - req.c.setopt(LOW_SPEED_TIME, 80) - - try: - result = req.load(self.API_URL, - post={'action' : "upload", - 'key' : self.getConfig("passkey"), - 'file' : b64encode(data), - 'gen_task_id': ticket}) - finally: - req.close() - - self.logDebug("Result %s : %s" % (ticket, result)) - task.setResult(result) - - - def captchaTask(self, task): - if not task.isTextual(): - return False - - if not self.getConfig("passkey"): - return False - - if self.core.isClientConnected() and not self.getConfig("force"): - return False - - if self.getCredits() > 0: - task.handler.append(self) - task.setWaiting(100) - self._processCaptcha(task) - - else: - self.logInfo(_("Your ExpertDecoders Account has not enough credits")) - - - def captchaInvalid(self, task): - if "ticket" in task.data: - - try: - 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"), e) diff --git a/module/plugins/hooks/FastixRu.py b/module/plugins/hooks/FastixRu.py deleted file mode 100644 index 5f339c4c0..000000000 --- a/module/plugins/hooks/FastixRu.py +++ /dev/null @@ -1,31 +0,0 @@ -# -*- coding: utf-8 -*- - -from pyload.utils import json_loads -from module.plugins.internal.MultiHook import MultiHook - - -class FastixRu(MultiHook): - __name__ = "FastixRu" - __type__ = "hook" - __version__ = "0.05" - - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("retry" , "int" , "Number of retries before revert" , 10 ), - ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 )] - - __description__ = """Fastix.ru hook plugin""" - __license__ = "GPLv3" - __authors__ = [("Massimo Rosamilia", "max@spiritix.eu")] - - - def getHosters(self): - html = self.getURL("http://fastix.ru/api_v2", - get={'apikey': "5182964c3f8f9a7f0b00000a_kelmFB4n1IrnCDYuIFn2y", - 'sub' : "allowed_sources"}) - host_list = json_loads(html) - host_list = host_list['allow'] - return host_list diff --git a/module/plugins/hooks/FreeWayMe.py b/module/plugins/hooks/FreeWayMe.py deleted file mode 100644 index 6fec037d8..000000000 --- a/module/plugins/hooks/FreeWayMe.py +++ /dev/null @@ -1,27 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.MultiHook import MultiHook - - -class FreeWayMe(MultiHook): - __name__ = "FreeWayMe" - __type__ = "hook" - __version__ = "0.14" - - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("retry" , "int" , "Number of retries before revert" , 10 ), - ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 )] - - __description__ = """FreeWay.me hook plugin""" - __license__ = "GPLv3" - __authors__ = [("Nicolas Giese", "james@free-way.me")] - - - 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/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py deleted file mode 100644 index 8bf326f4d..000000000 --- a/module/plugins/hooks/ImageTyperz.py +++ /dev/null @@ -1,153 +0,0 @@ -# -*- coding: utf-8 -*- - -from __future__ import with_statement - -import re - -from base64 import b64encode -from pycurl import FORM_FILE, LOW_SPEED_TIME - -from module.network.RequestFactory import getURL, getRequest -from module.plugins.Hook import Hook, threaded - - -class ImageTyperzException(Exception): - - def __init__(self, err): - self.err = err - - - def getCode(self): - return self.err - - - def __str__(self): - return "<ImageTyperzException %s>" % self.err - - - def __repr__(self): - return "<ImageTyperzException %s>" % self.err - - -class ImageTyperz(Addon): - __name__ = "ImageTyperz" - __type__ = "hook" - __version__ = "0.06" - - __config__ = [("username", "str", "Username", ""), - ("passkey", "password", "Password", ""), - ("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")] - - - SUBMIT_URL = "http://captchatypers.com/Forms/UploadFileAndGetTextNEW.ashx" - RESPOND_URL = "http://captchatypers.com/Forms/SetBadImage.ashx" - GETCREDITS_URL = "http://captchatypers.com/Forms/RequestBalance.ashx" - - - def getCredits(self): - res = getURL(self.GETCREDITS_URL, - post={'action': "REQUESTBALANCE", - 'username': self.getConfig("username"), - 'password': self.getConfig("passkey")}) - - if res.startswith('ERROR'): - raise ImageTyperzException(res) - - try: - balance = float(res) - except Exception: - raise ImageTyperzException("Invalid response") - - self.logInfo(_("Account balance: $%s left") % res) - return balance - - - def submit(self, captcha, captchaType="file", match=None): - req = getRequest() - #raise timeout threshold - req.c.setopt(LOW_SPEED_TIME, 80) - - try: - #@NOTE: Workaround multipart-post bug in HTTPRequest.py - if re.match("^\w*$", self.getConfig("passkey")): - multipart = True - data = (FORM_FILE, captcha) - else: - multipart = False - with open(captcha, 'rb') as f: - data = f.read() - data = b64encode(data) - - 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 res.startswith("ERROR"): - raise ImageTyperzException(res) - else: - data = res.split('|') - if len(data) == 2: - ticket, result = data - else: - raise ImageTyperzException("Unknown response: %s" % res) - - return ticket, result - - - def captchaTask(self, task): - if "service" in task.data: - return False - - 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() > 0: - task.handler.append(self) - task.data['service'] = self.__name__ - task.setWaiting(100) - self._processCaptcha(task) - - 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: - res = getURL(self.RESPOND_URL, - post={'action': "SETBADIMAGE", - 'username': self.getConfig("username"), - 'password': self.getConfig("passkey"), - 'imageid': task.data['ticket']}) - - if res == "SUCCESS": - self.logInfo(_("Bad captcha solution received, requested refund")) - else: - self.logError(_("Bad captcha solution received, refund request failed"), res) - - - @threaded - def _processCaptcha(self, task): - c = task.captchaFile - try: - ticket, result = self.submit(c) - except ImageTyperzException, e: - task.error = e.getCode() - return - - task.data['ticket'] = ticket - task.setResult(result) diff --git a/module/plugins/hooks/JustPremium.py b/module/plugins/hooks/JustPremium.py deleted file mode 100644 index b70d8dd2c..000000000 --- a/module/plugins/hooks/JustPremium.py +++ /dev/null @@ -1,46 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from module.plugins.Hook import Hook - - -class JustPremium(Hook): - __name__ = "JustPremium" - __type__ = "hook" - __version__ = "0.21" - - __config__ = [("excluded", "str", "Exclude hosters (comma separated)", "")] - - __description__ = """Remove all not premium links from urls added""" - __license__ = "GPLv3" - __authors__ = [("mazleu", "mazleica@gmail.com"), - ("Walter Purcaro", "vuolter@gmail.com"), - ("immenz", "immenz@gmx.net")] - - - event_list = ["linksAdded"] - - - def linksAdded(self, links, pid): - hosterdict = self.core.pluginManager.hosterPlugins - linkdict = self.core.api.checkURLs(links) - - premiumplugins = set(account.type for account in self.core.api.getAccounts(False) \ - if account.valid and account.premium) - multihosters = set(hoster for hoster in self.core.pluginManager.hosterPlugins \ - if 'new_name' in hosterdict[hoster] \ - and hosterdict[hoster]['new_name'] in premiumplugins) - - #: Found at least one hoster with account or multihoster - if not any(True for pluginname in linkdict if pluginname in premiumplugins | multihosters): - return - - excluded = map(lambda domain: "".join(part.capitalize() for part in re.split(r'(\.|\d+)', domain) if part != '.'), - self.getConfig('excluded').replace(' ', '').replace(',', '|').replace(';', '|').split('|')) - - for pluginname in set(linkdict.keys()) - (premiumplugins | multihosters).union(excluded): - self.logInfo(_("Remove links of plugin: %s") % pluginname) - for link in linkdict[pluginname]: - self.logDebug("Remove link: %s" % link) - links.remove(link) diff --git a/module/plugins/hooks/LinkdecrypterCom.py b/module/plugins/hooks/LinkdecrypterCom.py deleted file mode 100644 index f85a598bc..000000000 --- a/module/plugins/hooks/LinkdecrypterCom.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from module.plugins.internal.MultiHook import MultiHook - - -class LinkdecrypterCom(MultiHook): - __name__ = "LinkdecrypterCom" - __type__ = "hook" - __version__ = "1.02" - - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 )] - - __description__ = """Linkdecrypter.com hook plugin""" - __license__ = "GPLv3" - __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - - - def getCrypters(self): - return re.search(r'>Supported\(\d+\)</b>: <i>(.[\w.\-, ]+)', - self.getURL("http://linkdecrypter.com/").replace("(g)", "")).group(1).split(', ') diff --git a/module/plugins/hooks/LinksnappyCom.py b/module/plugins/hooks/LinksnappyCom.py deleted file mode 100644 index 7e607a3d3..000000000 --- a/module/plugins/hooks/LinksnappyCom.py +++ /dev/null @@ -1,29 +0,0 @@ -# -*- coding: utf-8 -*- - -from pyload.utils import json_loads -from module.plugins.internal.MultiHook import MultiHook - - -class LinksnappyCom(MultiHook): - __name__ = "LinksnappyCom" - __type__ = "hook" - __version__ = "0.04" - - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("retry" , "int" , "Number of retries before revert" , 10 ), - ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 )] - - __description__ = """Linksnappy.com hook plugin""" - __license__ = "GPLv3" - __authors__ = [("stickell", "l.stickell@yahoo.it")] - - - 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 deleted file mode 100644 index 0711b3546..000000000 --- a/module/plugins/hooks/MegaDebridEu.py +++ /dev/null @@ -1,35 +0,0 @@ -# -*- coding: utf-8 -*- - -from pyload.utils import json_loads -from module.plugins.internal.MultiHook import MultiHook - - -class MegaDebridEu(MultiHook): - __name__ = "MegaDebridEu" - __type__ = "hook" - __version__ = "0.05" - - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("retry" , "int" , "Number of retries before revert" , 10 ), - ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 )] - - __description__ = """Mega-debrid.eu hook plugin""" - __license__ = "GPLv3" - __authors__ = [("D.Ducatel", "dducatel@je-geek.fr")] - - - 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": - host_list = [element[0] for element in json_data['hosters']] - else: - self.logError(_("Unable to retrieve hoster list")) - host_list = list() - - return host_list diff --git a/module/plugins/hooks/MultihostersCom.py b/module/plugins/hooks/MultihostersCom.py deleted file mode 100644 index bf88cfae7..000000000 --- a/module/plugins/hooks/MultihostersCom.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.hooks.ZeveraCom import ZeveraCom - - -class MultihostersCom(ZeveraCom): - __name__ = "MultihostersCom" - __type__ = "hook" - __version__ = "0.02" - - __config__ = [("mode" , "all;listed;unlisted", "Use for plugins (if supported)" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed", "bool" , "Revert to standard download if download fails", False), - ("interval" , "int" , "Reload interval in hours (0 to disable)" , 12 )] - - __description__ = """Multihosters.com hook plugin""" - __license__ = "GPLv3" - __authors__ = [("tjeh", "tjeh@gmx.net")] diff --git a/module/plugins/hooks/MultishareCz.py b/module/plugins/hooks/MultishareCz.py deleted file mode 100644 index d02f4f8e3..000000000 --- a/module/plugins/hooks/MultishareCz.py +++ /dev/null @@ -1,31 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from module.plugins.internal.MultiHook import MultiHook - - -class MultishareCz(MultiHook): - __name__ = "MultishareCz" - __type__ = "hook" - __version__ = "0.07" - - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("retry" , "int" , "Number of retries before revert" , 10 ), - ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 )] - - __description__ = """MultiShare.cz hook plugin""" - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - - - HOSTER_PATTERN = r'<img class="logo-shareserveru"[^>]*?alt="([^"]+)"></td>\s*<td class="stav">[^>]*?alt="OK"' - - - def getHosters(self): - html = self.getURL("http://www.multishare.cz/monitoring/") - return re.findall(self.HOSTER_PATTERN, html) diff --git a/module/plugins/hooks/MyfastfileCom.py b/module/plugins/hooks/MyfastfileCom.py deleted file mode 100644 index a1b5aaba0..000000000 --- a/module/plugins/hooks/MyfastfileCom.py +++ /dev/null @@ -1,30 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.MultiHook import MultiHook -from pyload.utils import json_loads - - -class MyfastfileCom(MultiHook): - __name__ = "MyfastfileCom" - __type__ = "hook" - __version__ = "0.05" - - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("retry" , "int" , "Number of retries before revert" , 10 ), - ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 )] - - __description__ = """Myfastfile.com hook plugin""" - __license__ = "GPLv3" - __authors__ = [("stickell", "l.stickell@yahoo.it")] - - - 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) - - return json_data['hosts'] diff --git a/module/plugins/hooks/NoPremiumPl.py b/module/plugins/hooks/NoPremiumPl.py deleted file mode 100644 index 1727bec70..000000000 --- a/module/plugins/hooks/NoPremiumPl.py +++ /dev/null @@ -1,31 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.common.json_layer import json_loads -from module.plugins.internal.MultiHook import MultiHook - - -class NoPremiumPl(MultiHook): - __name__ = "NoPremiumPl" - __type__ = "hook" - __version__ = "0.03" - - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("retry" , "int" , "Number of retries before revert" , 10 ), - ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 )] - - __description__ = """NoPremium.pl hook plugin""" - __license__ = "GPLv3" - __authors__ = [("goddie", "dev@nopremium.pl")] - - - def getHosters(self): - hostings = json_loads(self.getURL("https://www.nopremium.pl/clipboard.php?json=3").strip()) - hostings_domains = [domain for row in hostings for domain in row["domains"] if row["sdownload"] == "0"] - - self.logDebug(hostings_domains) - - return hostings_domains diff --git a/module/plugins/hooks/OverLoadMe.py b/module/plugins/hooks/OverLoadMe.py deleted file mode 100644 index b15ce2766..000000000 --- a/module/plugins/hooks/OverLoadMe.py +++ /dev/null @@ -1,31 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.MultiHook import MultiHook - - -class OverLoadMe(MultiHook): - __name__ = "OverLoadMe" - __type__ = "hook" - __version__ = "0.04" - - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("retry" , "int" , "Number of retries before revert" , 10 ), - ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 ), - ("ssl" , "bool" , "Use HTTPS" , True )] - - __description__ = """Over-Load.me hook plugin""" - __license__ = "GPLv3" - __authors__ = [("marley", "marley@over-load.me")] - - - def getHosters(self): - https = "https" if self.getConfig("ssl") else "http" - html = self.getURL(https + "://api.over-load.me/hoster.php", - get={'auth': "0001-cb1f24dadb3aa487bda5afd3b76298935329be7700cd7-5329be77-00cf-1ca0135f"}).replace("\"", "").strip() - self.logDebug("Hosterlist", html) - - return [x.strip() for x in html.split(",") if x.strip()] diff --git a/module/plugins/hooks/PremiumTo.py b/module/plugins/hooks/PremiumTo.py deleted file mode 100644 index b629b111e..000000000 --- a/module/plugins/hooks/PremiumTo.py +++ /dev/null @@ -1,29 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.MultiHook import MultiHook - - -class PremiumTo(MultiHook): - __name__ = "PremiumTo" - __type__ = "hook" - __version__ = "0.08" - - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("retry" , "int" , "Number of retries before revert" , 10 ), - ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 )] - - __description__ = """Premium.to hook plugin""" - __license__ = "GPLv3" - __authors__ = [("RaNaN", "RaNaN@pyload.org"), - ("zoidberg", "zoidberg@mujmail.cz"), - ("stickell", "l.stickell@yahoo.it")] - - - def getHosters(self): - html = self.getURL("http://premium.to/api/hosters.php", - get={'username': self.account.username, 'password': self.account.password}) - return [x.strip() for x in html.replace("\"", "").split(";")] diff --git a/module/plugins/hooks/PremiumizeMe.py b/module/plugins/hooks/PremiumizeMe.py deleted file mode 100644 index 18b6187c4..000000000 --- a/module/plugins/hooks/PremiumizeMe.py +++ /dev/null @@ -1,40 +0,0 @@ -# -*- coding: utf-8 -*- - -from pyload.utils import json_loads -from module.plugins.internal.MultiHook import MultiHook - - -class PremiumizeMe(MultiHook): - __name__ = "PremiumizeMe" - __type__ = "hook" - __version__ = "0.17" - - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("retry" , "int" , "Number of retries before revert" , 10 ), - ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 )] - - __description__ = """Premiumize.me hook plugin""" - __license__ = "GPLv3" - __authors__ = [("Florian Franzen", "FlorianFranzen@gmail.com")] - - - def getHosters(self): - # Get account data - user, data = self.account.selectAccount() - - # Get supported hosters list from premiumize.me using the - # json API v1 (see https://secure.premiumize.me/?show=api) - 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) - - # If account is not valid thera are no hosters available - if data['status'] != 200: - return [] - - # Extract hosters from json file - return data['result']['hosterlist'] diff --git a/module/plugins/hooks/PutdriveCom.py b/module/plugins/hooks/PutdriveCom.py deleted file mode 100644 index f665dabee..000000000 --- a/module/plugins/hooks/PutdriveCom.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.hooks.ZeveraCom import ZeveraCom - - -class PutdriveCom(ZeveraCom): - __name__ = "PutdriveCom" - __type__ = "hook" - __version__ = "0.01" - - __config__ = [("mode" , "all;listed;unlisted", "Use for plugins (if supported)" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed", "bool" , "Revert to standard download if download fails", False), - ("interval" , "int" , "Reload interval in hours (0 to disable)" , 12 )] - - __description__ = """Putdrive.com hook plugin""" - __license__ = "GPLv3" - __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] diff --git a/module/plugins/hooks/RPNetBiz.py b/module/plugins/hooks/RPNetBiz.py deleted file mode 100644 index 2277b10ab..000000000 --- a/module/plugins/hooks/RPNetBiz.py +++ /dev/null @@ -1,38 +0,0 @@ -# -*- coding: utf-8 -*- - -from pyload.utils import json_loads -from module.plugins.internal.MultiHook import MultiHook - - -class RPNetBiz(MultiHook): - __name__ = "RPNetBiz" - __type__ = "hook" - __version__ = "0.14" - - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("retry" , "int" , "Number of retries before revert" , 10 ), - ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 )] - - __description__ = """RPNet.biz hook plugin""" - __license__ = "GPLv3" - __authors__ = [("Dman", "dmanugm@gmail.com")] - - - def getHosters(self): - # Get account data - user, data = self.account.selectAccount() - - res = self.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: - return [] - - # Extract hosters from json file - return hoster_list['hosters'] diff --git a/module/plugins/hooks/RapideoPl.py b/module/plugins/hooks/RapideoPl.py deleted file mode 100644 index b605eca17..000000000 --- a/module/plugins/hooks/RapideoPl.py +++ /dev/null @@ -1,31 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.common.json_layer import json_loads -from module.plugins.internal.MultiHook import MultiHook - - -class RapideoPl(MultiHook): - __name__ = "RapideoPl" - __type__ = "hook" - __version__ = "0.03" - - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("retry" , "int" , "Number of retries before revert" , 10 ), - ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 )] - - __description__ = """Rapideo.pl hook plugin""" - __license__ = "GPLv3" - __authors__ = [("goddie", "dev@rapideo.pl")] - - - def getHosters(self): - hostings = json_loads(self.getURL("https://www.rapideo.pl/clipboard.php?json=3").strip()) - hostings_domains = [domain for row in hostings for domain in row["domains"] if row["sdownload"] == "0"] - - self.logDebug(hostings_domains) - - return hostings_domains diff --git a/module/plugins/hooks/RealdebridCom.py b/module/plugins/hooks/RealdebridCom.py deleted file mode 100644 index d9c9407dd..000000000 --- a/module/plugins/hooks/RealdebridCom.py +++ /dev/null @@ -1,29 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.MultiHook import MultiHook - - -class RealdebridCom(MultiHook): - __name__ = "RealdebridCom" - __type__ = "hook" - __version__ = "0.46" - - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("retry" , "int" , "Number of retries before revert" , 10 ), - ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 ), - ("ssl" , "bool" , "Use HTTPS" , True )] - - __description__ = """Real-Debrid.com hook plugin""" - __license__ = "GPLv3" - __authors__ = [("Devirex Hazzard", "naibaf_11@yahoo.de")] - - - def getHosters(self): - https = "https" if self.getConfig("ssl") else "http" - html = self.getURL(https + "://real-debrid.com/api/hosters.php").replace("\"", "").strip() - - return [x.strip() for x in html.split(",") if x.strip()] diff --git a/module/plugins/hooks/RehostTo.py b/module/plugins/hooks/RehostTo.py deleted file mode 100644 index 845601c3f..000000000 --- a/module/plugins/hooks/RehostTo.py +++ /dev/null @@ -1,29 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.MultiHook import MultiHook - - -class RehostTo(MultiHook): - __name__ = "RehostTo" - __type__ = "hook" - __version__ = "0.50" - - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("retry" , "int" , "Number of retries before revert" , 10 ), - ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 )] - - __description__ = """Rehost.to hook plugin""" - __license__ = "GPLv3" - __authors__ = [("RaNaN", "RaNaN@pyload.org")] - - - def getHosters(self): - user, data = self.account.selectAccount() - html = self.getURL("http://rehost.to/api.php", - get={'cmd' : "get_supported_och_dl", - 'long_ses': self.account.getAccountInfo(user)['session']}) - return [x.strip() for x in html.replace("\"", "").split(",")] diff --git a/module/plugins/hooks/SimplyPremiumCom.py b/module/plugins/hooks/SimplyPremiumCom.py deleted file mode 100644 index e51cbd1bc..000000000 --- a/module/plugins/hooks/SimplyPremiumCom.py +++ /dev/null @@ -1,31 +0,0 @@ -# -*- coding: utf-8 -*- - -from pyload.utils import json_loads -from module.plugins.internal.MultiHook import MultiHook - - -class SimplyPremiumCom(MultiHook): - __name__ = "SimplyPremiumCom" - __type__ = "hook" - __version__ = "0.05" - - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("retry" , "int" , "Number of retries before revert" , 10 ), - ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 )] - - __description__ = """Simply-Premium.com hook plugin""" - __license__ = "GPLv3" - __authors__ = [("EvolutionClip", "evolutionclip@live.de")] - - - 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']] - - return host_list diff --git a/module/plugins/hooks/SimplydebridCom.py b/module/plugins/hooks/SimplydebridCom.py deleted file mode 100644 index 4d27f5ae4..000000000 --- a/module/plugins/hooks/SimplydebridCom.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.MultiHook import MultiHook - - -class SimplydebridCom(MultiHook): - __name__ = "SimplydebridCom" - __type__ = "hook" - __version__ = "0.04" - - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("retry" , "int" , "Number of retries before revert" , 10 ), - ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 )] - - __description__ = """Simply-Debrid.com hook plugin""" - __license__ = "GPLv3" - __authors__ = [("Kagenoshin", "kagenoshin@gmx.ch")] - - - def getHosters(self): - html = self.getURL("http://simply-debrid.com/api.php", get={'list': 1}) - return [x.strip() for x in html.rstrip(';').replace("\"", "").split(";")] diff --git a/module/plugins/hooks/SmoozedCom.py b/module/plugins/hooks/SmoozedCom.py deleted file mode 100644 index 9ba2daac9..000000000 --- a/module/plugins/hooks/SmoozedCom.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.MultiHook import MultiHook - - -class SmoozedCom(MultiHook): - __name__ = "SmoozedCom" - __type__ = "hook" - __version__ = "0.03" - - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("retry" , "int" , "Number of retries before revert" , 10 ), - ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 )] - - __description__ = """Smoozed.com hook plugin""" - __license__ = "GPLv3" - __authors__ = [("", "")] - - - def getHosters(self): - user, data = self.account.selectAccount() - return self.account.getAccountInfo(user)["hosters"] diff --git a/module/plugins/hooks/UnrestrictLi.py b/module/plugins/hooks/UnrestrictLi.py deleted file mode 100644 index b4c547883..000000000 --- a/module/plugins/hooks/UnrestrictLi.py +++ /dev/null @@ -1,30 +0,0 @@ -# -*- coding: utf-8 -*- - -from pyload.utils import json_loads -from module.plugins.internal.MultiHook import MultiHook - - -class UnrestrictLi(MultiHook): - __name__ = "UnrestrictLi" - __type__ = "hook" - __version__ = "0.05" - - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("retry" , "int" , "Number of retries before revert" , 10 ), - ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 ), - ("history" , "bool" , "Delete History" , False)] - - __description__ = """Unrestrict.li hook plugin""" - __license__ = "GPLv3" - __authors__ = [("stickell", "l.stickell@yahoo.it")] - - - def getHosters(self): - json_data = self.getURL("http://unrestrict.li/api/jdownloader/hosts.php", get={'format': "json"}) - json_data = json_loads(json_data) - - return [element['host'] for element in json_data['result']] diff --git a/module/plugins/hooks/WindowsPhoneNotify.py b/module/plugins/hooks/WindowsPhoneNotify.py deleted file mode 100644 index e0dd75f92..000000000 --- a/module/plugins/hooks/WindowsPhoneNotify.py +++ /dev/null @@ -1,96 +0,0 @@ -# -*- coding: utf-8 -*- - -import httplib - -from time import time - -from module.plugins.Hook import Hook - - -class WindowsPhoneNotify(Hook): - __name__ = "WindowsPhoneNotify" - __type__ = "hook" - __version__ = "0.07" - - __config__ = [("id" , "str" , "Push ID" , "" ), - ("url" , "str" , "Push url" , "" ), - ("notifycaptcha" , "bool", "Notify captcha request" , True ), - ("notifypackage" , "bool", "Notify package finished" , True ), - ("notifyprocessed", "bool", "Notify processed packages status" , True ), - ("timeout" , "int" , "Timeout between captchas in seconds" , 5 ), - ("force" , "bool", "Send notifications if client is connected", False)] - - __description__ = """Send push notifications to Windows Phone""" - __license__ = "GPLv3" - __authors__ = [("Andy Voigt", "phone-support@hotmail.de"), - ("Walter Purcaro", "vuolter@gmail.com")] - - - event_list = ["allDownloadsProcessed"] - - - #@TODO: Remove in 0.4.10 - def initPeriodical(self): - pass - - - def setup(self): - self.info = {} #@TODO: Remove in 0.4.10 - self.last_notify = 0 - - - def newCaptchaTask(self, task): - if not self.getConfig("notifycaptcha"): - return False - - if time() - self.last_notify < self.getConf("timeout"): - return False - - self.notify(_("Captcha"), _("New request waiting user input")) - - - def packageFinished(self, pypack): - if self.getConfig("notifypackage"): - self.notify(_("Package finished"), pypack.name) - - - def allDownloadsProcessed(self): - if not self.getConfig("notifyprocessed"): - return False - - if any(True for pdata in self.core.api.getQueue() if pdata.linksdone < pdata.linkstotal): - self.notify(_("Package failed"), _("One or more packages was not completed successfully")) - else: - self.notify(_("All packages finished")) - - - def getXmlData(self, msg): - return ("<?xml version='1.0' encoding='utf-8'?> <wp:Notification xmlns:wp='WPNotification'> " - "<wp:Toast> <wp:Text1>pyLoad</wp:Text1> <wp:Text2>%s</wp:Text2> " - "</wp:Toast> </wp:Notification>" % msg) - - - def notify(self, event, msg=""): - id = self.getConfig("id") - url = self.getConfig("url") - - if not id or not url: - return False - - if self.core.isClientConnected() and not self.getConfig("force"): - return False - - request = self.getXmlData("%s: %s" % (event, msg) if msg else event) - webservice = httplib.HTTP(url) - - webservice.putrequest("POST", id) - webservice.putheader("Host", url) - webservice.putheader("Content-type", "text/xml") - webservice.putheader("X-NotificationClass", "2") - webservice.putheader("X-WindowsPhone-Target", "toast") - webservice.putheader("Content-length", "%d" % len(request)) - webservice.endheaders() - webservice.send(request) - webservice.close() - - self.last_notify = time() diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py deleted file mode 100644 index 78e14c179..000000000 --- a/module/plugins/hooks/XFileSharingPro.py +++ /dev/null @@ -1,110 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from pyload.plugin.Addon import Addon - - -class XFileSharingPro(Addon): - __name__ = "XFileSharingPro" - __type__ = "hook" - __version__ = "0.31" - - __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" - __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - - - # event_list = ["pluginConfigChanged"] - regexp = {'hoster' : (r'https?://(?:www\.)?(?P<DOMAIN>[\w.^_]+(?:\.[a-zA-Z]{2,})(?:\:\d+)?)/(?:embed-)?\w{12}(?:\W|$)', - r'https?://(?:[^/]+\.)?(?P<DOMAIN>%s)/(?:embed-)?\w+'), - 'crypter': (r'https?://(?:www\.)?(?P<DOMAIN>[\w.^_]+(?:\.[a-zA-Z]{2,})(?:\:\d+)?)/(?:user|folder)s?/\w+', - r'https?://(?:[^/]+\.)?(?P<DOMAIN>%s)/(?:user|folder)s?/\w+')} - - HOSTER_BUILTIN = [#WORKING HOSTERS: - "180upload.com", "backin.net", "eyesfile.ca", "file4safe.com", "fileband.com", "filedwon.com", - "fileparadox.in", "filevice.com", "hostingbulk.com", "junkyvideo.com", "linestorage.com", "ravishare.com", - "ryushare.com", "salefiles.com", "sendmyway.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 = ["junocloud.me", "rapidfileshare.net"] - - - # def pluginConfigChanged(self.__name__, plugin, name, value): - # self.loadPattern() - - - def activate(self): - self.loadPattern() - - - def loadPattern(self): - use_builtin_list = self.getConfig('use_builtin_list') - - for type in ("hoster", "crypter"): - every_plugin = not self.getConfig("use_%s_list" % type) - - if every_plugin: - self.logInfo(_("Handling any %s I can!") % type) - pattern = self.regexp[type][0] - else: - plugins = self.getConfig('%s_list' % type) - plugin_set = set(plugins.replace(' ', '').replace('\\', '').replace('|', ',').replace(';', ',').lower().split(',')) - - if use_builtin_list: - plugin_set |= set(x.lower() for x in getattr(self, "%s_BUILTIN" % type.upper())) - - plugin_set -= set(('', u'')) - - if not plugin_set: - self.logInfo(_("No %s to handle") % type) - self._unload(type) - return - - match_list = '|'.join(sorted(plugin_set)) - - len_match_list = len(plugin_set) - self.logInfo(_("Handling %d %s%s: %s") % (len_match_list, - type, - "" if len_match_list == 1 else "s", - match_list.replace('|', ', '))) - - pattern = self.regexp[type][1] % match_list.replace('.', '\.') - - dict = self.core.pluginManager.plugins[type]["XFileSharingPro"] - dict['pattern'] = pattern - dict['re'] = re.compile(pattern) - - self.logDebug("Loaded %s pattern: %s" % (type, pattern)) - - - def _unload(self, type): - dict = self.core.pluginManager.plugins[type]["XFileSharingPro"] - dict['pattern'] = r'^unmatchable$' - dict['re'] = re.compile(dict['pattern']) - - - def deactivate(self): - # self.unloadHoster("BasePlugin") - for type in ("hoster", "crypter"): - self._unload(type, "XFileSharingPro") - - - # def downloadFailed(self, pyfile): - # if pyfile.pluginname == "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") diff --git a/module/plugins/hooks/ZeveraCom.py b/module/plugins/hooks/ZeveraCom.py deleted file mode 100644 index 215ec3673..000000000 --- a/module/plugins/hooks/ZeveraCom.py +++ /dev/null @@ -1,27 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.MultiHook import MultiHook - - -class ZeveraCom(MultiHook): - __name__ = "ZeveraCom" - __type__ = "hook" - __version__ = "0.05" - - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("retry" , "int" , "Number of retries before revert" , 10 ), - ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 )] - - __description__ = """Zevera.com hook plugin""" - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), - ("Walter Purcaro", "vuolter@gmail.com")] - - - def getHosters(self): - html = self.account.api_response(pyreq.getHTTPRequest(timeout=120), cmd="gethosters") - return [x.strip() for x in html.split(",")] diff --git a/module/plugins/hooks/__init__.py b/module/plugins/hooks/__init__.py deleted file mode 100644 index 40a96afc6..000000000 --- a/module/plugins/hooks/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# -*- coding: utf-8 -*- |