From b65c4091d5c5e793d8a9df17a46657d45c3a1292 Mon Sep 17 00:00:00 2001 From: zoidberg10 Date: Mon, 24 Sep 2012 23:54:50 +0200 Subject: multihosters - closed #618, store http/ftp accounts, add uptobox.com premium --- module/plugins/hooks/AlldebridCom.py | 17 ++--------- module/plugins/hooks/Checksum.py | 53 ++++++++++++++++++++++++++++++----- module/plugins/hooks/EasybytezCom.py | 24 ++++++++-------- module/plugins/hooks/MultishareCz.py | 16 ++--------- module/plugins/hooks/Premium4Me.py | 15 +--------- module/plugins/hooks/PremiumizeMe.py | 19 ++----------- module/plugins/hooks/RealdebridCom.py | 17 ++--------- module/plugins/hooks/RehostTo.py | 2 -- module/plugins/hooks/ZeveraCom.py | 22 +++------------ 9 files changed, 71 insertions(+), 114 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/AlldebridCom.py b/module/plugins/hooks/AlldebridCom.py index f9657ed8c..91a0a6e5b 100644 --- a/module/plugins/hooks/AlldebridCom.py +++ b/module/plugins/hooks/AlldebridCom.py @@ -7,7 +7,7 @@ from module.plugins.internal.MultiHoster import MultiHoster class AlldebridCom(MultiHoster): __name__ = "AlldebridCom" - __version__ = "0.11" + __version__ = "0.12" __type__ = "hook" __config__ = [("activated", "bool", "Activated", "False"), @@ -19,21 +19,8 @@ class AlldebridCom(MultiHoster): __author_name__ = ("Andy, Voigt") __author_mail__ = ("spamsales@online.de") - replacements = [("freakshare.net", "freakshare.com")] - def getHoster(self): https = "https" if self.getConfig("https") else "http" page = getURL(https + "://www.alldebrid.com/api.php?action=get_host").replace("\"","").strip() - hosters = set([x.strip() for x in page.split(",") if x.strip()]) - - configMode = self.getConfig('hosterListMode') - if configMode in ("listed", "unlisted"): - configList = set(self.getConfig('hosterList').strip().lower().replace('|',',').replace(';',',').split(',')) - configList.discard(u'') - if configMode == "listed": - hosters &= configList - else: - hosters -= configList - - return list(hosters) + return [x.strip() for x in page.split(",") if x.strip()] diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index aec4bd0d7..b290838bb 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -19,7 +19,8 @@ from __future__ import with_statement import hashlib, zlib from os import remove -from os.path import getsize, isfile +from os.path import getsize, isfile, splitext +import re from module.utils import save_join, fs_encode from module.plugins.Hook import Hook @@ -50,7 +51,7 @@ def computeChecksum(local_file, algorithm): class Checksum(Hook): __name__ = "Checksum" - __version__ = "0.06" + __version__ = "0.07" __description__ = "Verify downloaded file size and checksum (enable in general preferences)" __config__ = [("activated", "bool", "Activated", True), ("action", "fail;retry;nothing", "What to do if check fails?", "retry"), @@ -58,12 +59,19 @@ class Checksum(Hook): __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") + methods = { 'sfv':'crc32', 'crc': 'crc32', 'hash': 'md5'} + regexps = { 'sfv': r'^(?P[^;].+)\s+(?P[0-9A-Fa-f]{8})$', + 'md5': r'^(?P[0-9A-Fa-f]{32}) (?P.+)$', + 'crc': r'filename=(?P.+)\nsize=(?P\d+)\ncrc32=(?P[0-9A-Fa-f]{8})$', + 'default': r'^(?P[0-9A-Fa-f]+)\s+\*?(?P.+)$' } + def setup(self): - self.algorithms = sorted(getattr(hashlib, "algorithms", ("md5", "sha1", "sha224", "sha256", "sha384", "sha512")), reverse = True) - self.algorithms.extend(["crc32", "adler32"]) - if not self.config['general']['checksum']: - self.logInfo("Checksum validation is disabled in general configuration") + self.logInfo("Checksum validation is disabled in general configuration") + + 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): """ @@ -127,4 +135,35 @@ class Checksum(Hook): elif action == "retry": if local_file: remove(local_file) - pyfile.plugin.retry(reason = msg, max_tries = self.getConfig("max_tries")) \ No newline at end of file + pyfile.plugin.retry(reason = msg, max_tries = self.getConfig("max_tries")) + + + def packageFinished(self, pypack): + 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() + #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"]) + continue + + with open(hash_file) as f: + text = f.read() + + for m in re.finditer(self.regexps.get(file_type, self.regexps['default']), text): + data = m.groupdict() + self.logDebug(link["name"], data) + + 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"]: + 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)" % (algorithm, data["name"], checksum, data["hash"])) \ No newline at end of file diff --git a/module/plugins/hooks/EasybytezCom.py b/module/plugins/hooks/EasybytezCom.py index 21a988555..22b9050b4 100644 --- a/module/plugins/hooks/EasybytezCom.py +++ b/module/plugins/hooks/EasybytezCom.py @@ -11,7 +11,7 @@ def getConfigSet(option): class EasybytezCom(MultiHoster): __name__ = "EasybytezCom" - __version__ = "0.02" + __version__ = "0.03" __type__ = "hook" __config__ = [("activated", "bool", "Activated", "False"), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), @@ -21,16 +21,16 @@ class EasybytezCom(MultiHoster): __author_mail__ = ("zoidberg@mujmail.cz") def getHoster(self): - - hoster = set(['2shared.com', 'easy-share.com', 'filefactory.com', 'fileserve.com', 'filesonic.com', 'hotfile.com', 'mediafire.com', 'megaupload.com', 'netload.in', 'rapidshare.com', 'uploading.com', 'wupload.com', 'oron.com', 'uploadstation.com', 'ul.to', 'uploaded.to']) + self.account = self.core.accountManager.getAccountPlugin(self.__name__) + user = self.account.selectAccount()[0] - configMode = self.getConfig('hosterListMode') - if configMode in ("listed", "unlisted"): - configList = set(self.getConfig('hosterList').strip().lower().replace('|',',').replace(';',',').split(',')) - configList.discard(u'') - if configMode == "listed": - hoster &= configList - else: - hoster -= configList + try: + req = self.account.getAccountRequest(user) + page = req.load("http://www.easybytez.com") - return list(hoster) \ No newline at end of file + found = re.search(r'\s*Supported sites:(.*)', page) + return found.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'] \ No newline at end of file diff --git a/module/plugins/hooks/MultishareCz.py b/module/plugins/hooks/MultishareCz.py index a00c6cb2b..f8fa9290a 100644 --- a/module/plugins/hooks/MultishareCz.py +++ b/module/plugins/hooks/MultishareCz.py @@ -11,7 +11,7 @@ def getConfigSet(option): class MultishareCz(MultiHoster): __name__ = "MultishareCz" - __version__ = "0.03" + __version__ = "0.04" __type__ = "hook" __config__ = [("activated", "bool", "Activated", "False"), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), @@ -20,21 +20,9 @@ class MultishareCz(MultiHoster): __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") - replacements = [("share-rapid.cz", "sharerapid.com")] HOSTER_PATTERN = r']*?alt="([^"]+)">\s*[^>]*?alt="OK"' def getHoster(self): page = getURL("http://www.multishare.cz/monitoring/") - hosters = set(h.lower().strip() for h in re.findall(self.HOSTER_PATTERN, page)) - - configMode = self.getConfig('hosterListMode') - if configMode in ("listed", "unlisted"): - configList = set(self.getConfig('hosterList').strip().lower().replace('|',',').replace(';',',').split(',')) - configList.discard(u'') - if configMode == "listed": - hosters &= configList - elif configMode == "unlisted": - hosters -= configList - - return list(hosters) \ No newline at end of file + return re.findall(self.HOSTER_PATTERN, page) \ No newline at end of file diff --git a/module/plugins/hooks/Premium4Me.py b/module/plugins/hooks/Premium4Me.py index fc3ce2343..b49eb41a9 100644 --- a/module/plugins/hooks/Premium4Me.py +++ b/module/plugins/hooks/Premium4Me.py @@ -15,23 +15,10 @@ class Premium4Me(MultiHoster): __author_name__ = ("RaNaN", "zoidberg") __author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz") - replacements = [("freakshare.net", "freakshare.com")] - def getHoster(self): page = getURL("http://premium4.me/api/hosters.php?authcode=%s" % self.account.authcode) - hosters = set([x.strip() for x in page.replace("\"", "").split(";")]) - - configMode = self.getConfig('hosterListMode') - if configMode in ("listed", "unlisted"): - configList = set(self.getConfig('hosterList').strip().lower().replace(',','|').split('|')) - configList.discard(u'') - if configMode == "listed": - hosters &= configList - elif configMode == "unlisted": - hosters -= configList - - return list(hosters) + return [x.strip() for x in page.replace("\"", "").split(";")] def coreReady(self): diff --git a/module/plugins/hooks/PremiumizeMe.py b/module/plugins/hooks/PremiumizeMe.py index 3825e9219..37905c23e 100644 --- a/module/plugins/hooks/PremiumizeMe.py +++ b/module/plugins/hooks/PremiumizeMe.py @@ -5,7 +5,7 @@ from module.network.RequestFactory import getURL class PremiumizeMe(MultiHoster): __name__ = "PremiumizeMe" - __version__ = "0.1" + __version__ = "0.11" __type__ = "hook" __description__ = """Premiumize.Me hook plugin""" @@ -16,8 +16,6 @@ class PremiumizeMe(MultiHoster): __author_name__ = ("Florian Franzen") __author_mail__ = ("FlorianFranzen@gmail.com") - replacements = [("freakshare.net", "freakshare.com")] - interval = 0 # Disable periodic calls, we dont use them anyway def getHoster(self): @@ -38,20 +36,7 @@ class PremiumizeMe(MultiHoster): return [] # Extract hosters from json file - hosters = set(data['result']['hosterlist']) - - - # Read config to check if certain hosters should not be handled - configMode = self.getConfig('hosterListMode') - if configMode in ("listed", "unlisted"): - configList = set(self.getConfig('hosterList').strip().lower().replace('|',',').replace(';',',').split(',')) - configList.discard(u'') - if configMode == "listed": - hosters &= configList - else: - hosters -= configList - - return list(hosters) + return data['result']['hosterlist'] def coreReady(self): # Get account plugin and check if there is a valid account available diff --git a/module/plugins/hooks/RealdebridCom.py b/module/plugins/hooks/RealdebridCom.py index bd3179673..0f06d14bc 100644 --- a/module/plugins/hooks/RealdebridCom.py +++ b/module/plugins/hooks/RealdebridCom.py @@ -5,7 +5,7 @@ from module.plugins.internal.MultiHoster import MultiHoster class RealdebridCom(MultiHoster): __name__ = "RealdebridCom" - __version__ = "0.41" + __version__ = "0.42" __type__ = "hook" __config__ = [("activated", "bool", "Activated", "False"), @@ -16,21 +16,8 @@ class RealdebridCom(MultiHoster): __author_name__ = ("Devirex, Hazzard") __author_mail__ = ("naibaf_11@yahoo.de") - replacements = [("freakshare.net", "freakshare.com")] - def getHoster(self): https = "https" if self.getConfig("https") else "http" page = getURL(https + "://real-debrid.com/api/hosters.php").replace("\"","").strip() - hosters = set([x.strip() for x in page.split(",") if x.strip()]) - - configMode = self.getConfig('hosterListMode') - if configMode in ("listed", "unlisted"): - configList = set(self.getConfig('hosterList').strip().lower().replace('|',',').replace(';',',').split(',')) - configList.discard(u'') - if configMode == "listed": - hosters &= configList - else: - hosters -= configList - - return list(hosters) + 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 b16987f5c..8903bd07f 100644 --- a/module/plugins/hooks/RehostTo.py +++ b/module/plugins/hooks/RehostTo.py @@ -14,8 +14,6 @@ class RehostTo(MultiHoster): __author_name__ = ("RaNaN") __author_mail__ = ("RaNaN@pyload.org") - replacements = [("freakshare.net", "freakshare.com")] - def getHoster(self): page = getURL("http://rehost.to/api.php?cmd=get_supported_och_dl&long_ses=%s" % self.long_ses) diff --git a/module/plugins/hooks/ZeveraCom.py b/module/plugins/hooks/ZeveraCom.py index 46c752c21..cadf60069 100644 --- a/module/plugins/hooks/ZeveraCom.py +++ b/module/plugins/hooks/ZeveraCom.py @@ -5,29 +5,15 @@ from module.plugins.internal.MultiHoster import MultiHoster class ZeveraCom(MultiHoster): __name__ = "ZeveraCom" - __version__ = "0.01" + __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__ = ("Devirex, Hazzard") - __author_mail__ = ("naibaf_11@yahoo.de") - - replacements = [("freakshare.net", "freakshare.com"), ("2shared.com", "twoshared.com"), ("4shared.com", "fourshared.com"), - ("easy-share.com", "crocko.com"), ("hellshare.com", "hellshare.cz")] + __author_name__ = ("zoidberg") + __author_mail__ = ("zoidberg@mujmail.cz") def getHoster(self): page = getURL("http://www.zevera.com/jDownloader.ashx?cmd=gethosters") - hosters = set([x.strip() for x in page.replace("\"", "").split(",")]) - - configMode = self.getConfig('hosterListMode') - if configMode in ("listed", "unlisted"): - configList = set(self.getConfig('hosterList').strip().lower().replace('|',',').replace(';',',').split(',')) - configList.discard(u'') - if configMode == "listed": - hosters &= configList - else: - hosters -= configList - - return list(hosters) \ No newline at end of file + return [x.strip() for x in page.replace("\"", "").split(",")] \ No newline at end of file -- cgit v1.2.3 From 233bf90feb2941ecacee56966fdee2cd2f65d7b2 Mon Sep 17 00:00:00 2001 From: zoidberg10 Date: Tue, 25 Sep 2012 19:07:51 +0200 Subject: small plugin fixes --- module/plugins/hooks/EasybytezCom.py | 5 ----- module/plugins/hooks/MultishareCz.py | 5 ----- 2 files changed, 10 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/EasybytezCom.py b/module/plugins/hooks/EasybytezCom.py index 22b9050b4..6a4ded85b 100644 --- a/module/plugins/hooks/EasybytezCom.py +++ b/module/plugins/hooks/EasybytezCom.py @@ -4,11 +4,6 @@ from module.network.RequestFactory import getURL from module.plugins.internal.MultiHoster import MultiHoster import re -def getConfigSet(option): - s = set(option.lower().replace(',','|').split('|')) - s.discard(u'') - return s - class EasybytezCom(MultiHoster): __name__ = "EasybytezCom" __version__ = "0.03" diff --git a/module/plugins/hooks/MultishareCz.py b/module/plugins/hooks/MultishareCz.py index f8fa9290a..7e5a3e007 100644 --- a/module/plugins/hooks/MultishareCz.py +++ b/module/plugins/hooks/MultishareCz.py @@ -4,11 +4,6 @@ from module.network.RequestFactory import getURL from module.plugins.internal.MultiHoster import MultiHoster import re -def getConfigSet(option): - s = set(option.lower().split('|')) - s.discard(u'') - return s - class MultishareCz(MultiHoster): __name__ = "MultishareCz" __version__ = "0.04" -- cgit v1.2.3 From 5abe7f6eb7eb8eeab1849e9da659450bc50b7084 Mon Sep 17 00:00:00 2001 From: zoidberg10 Date: Thu, 4 Oct 2012 21:26:31 +0200 Subject: 9kw.eu captcha service plugin - (see http://9kw.eu/hilfe.html) - closed #691 --- module/plugins/hooks/Captcha9kw.py | 139 +++++++++++++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 module/plugins/hooks/Captcha9kw.py (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py new file mode 100644 index 000000000..b4d23f6e8 --- /dev/null +++ b/module/plugins/hooks/Captcha9kw.py @@ -0,0 +1,139 @@ +# -*- 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, zoidberg +""" +from __future__ import with_statement + +from thread import start_new_thread +from base64 import b64encode +import cStringIO +import pycurl +import time + +from module.network.RequestFactory import getURL, getRequest +from module.network.HTTPRequest import BadHeader + +from module.plugins.Hook import Hook + +class Captcha9kw(Hook): + __name__ = "Captcha9kw" + __version__ = "0.02" + __description__ = """send captchas to 9kw.eu""" + __config__ = [("activated", "bool", "Activated", False), + ("force", "bool", "Force CT even if client is connected", False), + ("passkey", "password", "API key", ""),] + __author_name__ = ("RaNaN") + __author_mail__ = ("RaNaN@pyload.org") + + API_URL = "http://www.9kw.eu/index.cgi" + + def setup(self): + self.info = {} + + def getCredits(self): + response = getURL(self.API_URL, get = { "apikey": self.getConfig("passkey"), "pyload": "1", "action": "usercaptchaguthaben" }) + + if response.isdigit(): + self.logInfo(_("%s credits left") % response) + self.info["credits"] = credits = int(response) + return credits + else: + self.logError(response) + return 0 + + def processCaptcha(self, task): + result = None + + with open(task.captchaFile, 'rb') as f: + data = f.read() + data = b64encode(data) + self.logDebug("%s : %s" % (task.captchaFile, data)) + + response = getURL(self.API_URL, post = { + "apikey": self.getConfig("passkey"), + "pyload": "1", + "base64": "1", + "file-upload-01": data, + "action": "usercaptchaupload" }) + + for i in range(1, 100, 2): + response2 = getURL(self.API_URL, get = { "apikey": self.getConfig("passkey"), "id": response,"pyload": "1", "action": "usercaptchacorrectdata" }) + + if(response2 != ""): + break; + + time.sleep(1) + + result = response2 + task.data["ticket"] = response + self.logDebug("result %s : %s" % (response, result)) + task.setResult(result) + + def newCaptchaTask(self, task): + if "service" in task.data: #captcha already beeing handled + 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) + start_new_thread(self.processCaptcha, (task,)) + + else: + self.logInfo(_("Your Captcha 9kw.eu Account has not enough credits")) + + def captchaCorrect(self, task): + if "ticket" in task.data: + + try: + response = getURL(self.API_URL, + post={ "action": "usercaptchacorrectback", + "apikey": self.getConfig("passkey"), + "api_key": self.getConfig("passkey"), + "correct": "1", + "pyload": "1", + "id": task.data["ticket"] } + ) + self.logInfo("Request correct: %s" % response) + + except BadHeader, e: + self.logError("Could not send correct request.", str(e)) + + def captchaInvalid(self, task): + if "ticket" in task.data: + + try: + response = getURL(self.API_URL, + post={ "action": "usercaptchacorrectback", + "apikey": self.getConfig("passkey"), + "api_key": self.getConfig("passkey"), + "correct": "2", + "pyload": "1", + "id": task.data["ticket"] } + ) + self.logInfo("Request refund: %s" % response) + + except BadHeader, e: + self.logError("Could not send refund request.", str(e)) \ No newline at end of file -- cgit v1.2.3 From 139722a9355947f8e0696f46e3bb97c239514a37 Mon Sep 17 00:00:00 2001 From: zoidberg10 Date: Mon, 8 Oct 2012 22:28:35 +0200 Subject: filebeer workaround, rehost.to chunklimit, multihoster config --- module/plugins/hooks/AlldebridCom.py | 6 ++++-- module/plugins/hooks/PremiumizeMe.py | 8 ++++---- module/plugins/hooks/RealdebridCom.py | 6 ++++-- module/plugins/hooks/RehostTo.py | 10 +++++++--- 4 files changed, 19 insertions(+), 11 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/AlldebridCom.py b/module/plugins/hooks/AlldebridCom.py index 91a0a6e5b..6818b8c43 100644 --- a/module/plugins/hooks/AlldebridCom.py +++ b/module/plugins/hooks/AlldebridCom.py @@ -7,13 +7,15 @@ from module.plugins.internal.MultiHoster import MultiHoster class AlldebridCom(MultiHoster): __name__ = "AlldebridCom" - __version__ = "0.12" + __version__ = "0.13" __type__ = "hook" __config__ = [("activated", "bool", "Activated", "False"), ("https", "bool", "Enable HTTPS", "False"), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), - ("hosterList", "str", "Hoster list (comma separated)", "")] + ("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__ = ("Andy, Voigt") diff --git a/module/plugins/hooks/PremiumizeMe.py b/module/plugins/hooks/PremiumizeMe.py index 37905c23e..a10c24f85 100644 --- a/module/plugins/hooks/PremiumizeMe.py +++ b/module/plugins/hooks/PremiumizeMe.py @@ -5,18 +5,18 @@ from module.network.RequestFactory import getURL class PremiumizeMe(MultiHoster): __name__ = "PremiumizeMe" - __version__ = "0.11" + __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"), - ("hosterList", "str", "Hoster list (comma separated)", "")] + ("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")] __author_name__ = ("Florian Franzen") __author_mail__ = ("FlorianFranzen@gmail.com") - - interval = 0 # Disable periodic calls, we dont use them anyway def getHoster(self): # If no accounts are available there will be no hosters available diff --git a/module/plugins/hooks/RealdebridCom.py b/module/plugins/hooks/RealdebridCom.py index 0f06d14bc..be74b47c3 100644 --- a/module/plugins/hooks/RealdebridCom.py +++ b/module/plugins/hooks/RealdebridCom.py @@ -5,13 +5,15 @@ from module.plugins.internal.MultiHoster import MultiHoster class RealdebridCom(MultiHoster): __name__ = "RealdebridCom" - __version__ = "0.42" + __version__ = "0.43" __type__ = "hook" __config__ = [("activated", "bool", "Activated", "False"), ("https", "bool", "Enable HTTPS", "False"), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), - ("hosterList", "str", "Hoster list (comma separated)", "")] + ("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") diff --git a/module/plugins/hooks/RehostTo.py b/module/plugins/hooks/RehostTo.py index 8903bd07f..7ca5e5cde 100644 --- a/module/plugins/hooks/RehostTo.py +++ b/module/plugins/hooks/RehostTo.py @@ -5,10 +5,14 @@ from module.plugins.internal.MultiHoster import MultiHoster class RehostTo(MultiHoster): __name__ = "RehostTo" - __version__ = "0.41" + __version__ = "0.42" __type__ = "hook" - __config__ = [("activated", "bool", "Activated", "False")] + __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__ = """rehost.to hook plugin""" __author_name__ = ("RaNaN") @@ -34,4 +38,4 @@ class RehostTo(MultiHoster): self.ses = data["ses"] self.long_ses = data["long_ses"] - return MultiHoster.coreReady(self) + return MultiHoster.coreReady(self) \ No newline at end of file -- cgit v1.2.3 From b4c7821ad13bbc08f7566ade751fa210adf99c10 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Fri, 12 Oct 2012 20:05:41 +0200 Subject: better updatemanager --- module/plugins/hooks/UpdateManager.py | 71 +++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 32 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index ce75399c5..bcd23a62d 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -32,16 +32,18 @@ class UpdateManager(Hook): __version__ = "0.12" __description__ = """checks for updates""" __config__ = [("activated", "bool", "Activated", "True"), - ("interval", "int", "Check interval in minutes", "360"), + ("interval", "int", "Check interval in minutes", "480"), ("debug", "bool", "Check for plugin changes when in debug mode", False)] __author_name__ = ("RaNaN") __author_mail__ = ("ranan@pyload.org") + URL = "http://get.pyload.org/check2/%s/" + MIN_TIME = 3 * 60 * 60 # 3h minimum check interval + @property def debug(self): return self.core.debug and self.getConfig("debug") - def setup(self): if self.debug: self.logDebug("Monitoring file changes") @@ -51,21 +53,20 @@ class UpdateManager(Hook): self.periodical = self.checkChanges self.mtimes = {} #recordes times else: - self.interval = self.getConfig("interval") * 60 + self.interval = max(self.getConfig("interval") * 60, self.MIN_TIME) self.updated = False self.reloaded = True + self.version = "None" self.info = {"pyload": False, "plugins": False} @threaded def periodical(self): - update = self.checkForUpdate() - if update: - self.info["pyload"] = True - else: - self.log.info(_("No Updates for pyLoad")) - self.checkPlugins() + + updates = self.checkForUpdate() + if updates: + self.checkPlugins(updates) if self.updated and not self.reloaded: self.info["plugins"] = True @@ -73,7 +74,7 @@ class UpdateManager(Hook): elif self.updated and self.reloaded: self.log.info(_("Plugins updated and reloaded")) self.updated = False - else: + elif self.version == "None": self.log.info(_("No plugin updates available")) @Expose @@ -82,48 +83,54 @@ class UpdateManager(Hook): self.periodical() def checkForUpdate(self): - """checks if an update is available""" + """checks if an update is available, return result""" try: - version_check = getURL("http://get.pyload.org/check/%s/" % self.core.api.getServerVersion()) - if version_check == "": - return False - else: - self.log.info(_("*** New pyLoad Version %s available ***") % version_check) - self.log.info(_("*** Get it here: http://pyload.org/download ***")) - return True + if self.version == "None": # No updated known + version_check = getURL(self.URL % self.core.api.getServerVersion()).splitlines() + self.version = version_check[0] + + # Still no updates, plugins will be checked + if self.version == "None": + self.log.info(_("No Updates for pyLoad")) + return version_check[1:] + + + self.info["pyload"] = True + self.log.info(_("*** New pyLoad Version %s available ***") % self.version) + self.log.info(_("*** Get it here: http://pyload.org/download ***")) + except: self.log.warning(_("Not able to connect server for updates")) - return False + + return None # Nothing will be done - def checkPlugins(self): + def checkPlugins(self, updates): """ checks for plugins updates""" # plugins were already updated if self.info["plugins"]: return - try: - updates = getURL("http://get.pyload.org/plugins/check/") - except: - self.log.warning(_("Not able to connect server for updates")) - return False - - updates = updates.splitlines() reloads = [] vre = re.compile(r'__version__.*=.*("|\')([0-9.]+)') + url = updates[0] + schema = updates[1].split("|") + updates = updates[2:] for plugin in updates: - path, version = plugin.split(":") - prefix, filename = path.split("/") + info = dict(zip(schema, plugin.split("|"))) + filename = info["name"] + prefix = info["type"] + version = info["version"] if filename.endswith(".pyc"): name = filename[:filename.find("_")] else: name = filename.replace(".py", "") - #TODO: obsolete + #TODO: obsolete in 0.5.0 if prefix.endswith("s"): type = prefix[:-1] else: @@ -145,7 +152,7 @@ class UpdateManager(Hook): }) try: - content = getURL("http://get.pyload.org/plugins/get/" + path) + content = getURL(url % info) except Exception, e: self.logWarning(_("Error when updating %s") % filename, str(e)) continue @@ -166,7 +173,7 @@ class UpdateManager(Hook): def checkChanges(self): - if self.last_check + self.getConfig("interval") * 60 < time(): + if self.last_check + max(self.getConfig("interval") * 60, self.MIN_TIME) < time(): self.old_periodical() self.last_check = time() -- cgit v1.2.3 From 5fb05cfd62fe14143430f61f0a6bc83877d6a989 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Fri, 12 Oct 2012 22:53:04 +0200 Subject: forget to bump version --- 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 bcd23a62d..c800b44bf 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -29,7 +29,7 @@ from module.plugins.Hook import threaded, Expose, Hook class UpdateManager(Hook): __name__ = "UpdateManager" - __version__ = "0.12" + __version__ = "0.13" __description__ = """checks for updates""" __config__ = [("activated", "bool", "Activated", "True"), ("interval", "int", "Check interval in minutes", "480"), -- cgit v1.2.3 From 4342410b82b87f10610cee1a5d02f779628f7a90 Mon Sep 17 00:00:00 2001 From: zoidberg10 Date: Sun, 14 Oct 2012 01:12:59 +0200 Subject: update CaptchaBrotherhood - closed #696, sharerapid.com --- module/plugins/hooks/CaptchaBrotherhood.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py index a22a5ee1d..bdf547827 100644 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ b/module/plugins/hooks/CaptchaBrotherhood.py @@ -44,7 +44,7 @@ class CaptchaBrotherhoodException(Exception): class CaptchaBrotherhood(Hook): __name__ = "CaptchaBrotherhood" - __version__ = "0.03" + __version__ = "0.04" __description__ = """send captchas to CaptchaBrotherhood.com""" __config__ = [("activated", "bool", "Activated", False), ("username", "str", "Username", ""), @@ -53,7 +53,7 @@ class CaptchaBrotherhood(Hook): __author_name__ = ("RaNaN", "zoidberg") __author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz") - API_URL = "http://ocrhood.gazcad.com/" + API_URL = "http://www.captchabrotherhood.com/" def setup(self): self.info = {} -- cgit v1.2.3 From 1b494bca9f442b3a8dd75818c68f41235dcdbdfe Mon Sep 17 00:00:00 2001 From: zoidberg10 Date: Sat, 20 Oct 2012 09:30:04 +0200 Subject: small plugin fixes, closed #694, #695 --- module/plugins/hooks/XFileSharingPro.py | 36 +++++++++++++++------------------ 1 file changed, 16 insertions(+), 20 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 3981db2d0..105c70113 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -5,7 +5,7 @@ import re class XFileSharingPro(Hook): __name__ = "XFileSharingPro" - __version__ = "0.03" + __version__ = "0.04" __type__ = "hook" __config__ = [ ("activated" , "bool" , "Activated" , "True"), ("loadDefault", "bool", "Include default (built-in) hoster list" , "True"), @@ -25,29 +25,25 @@ class XFileSharingPro(Hook): if self.getConfig('loadDefault'): hosterList |= set(( #WORKING HOSTERS: - "azsharing.com", "banashare.com", "fileband.com", "kingsupload.com", "migahost.com", "ryushare.com", "xfileshare.eu", - #NOT TESTED: - "aieshare.com", "amonshare.com", "asixfiles.com", - "bebasupload.com", "boosterking.com", "buckshare.com", "bulletupload.com", "crocshare.com", "ddlanime.com", "divxme.com", - "dopeshare.com", "downupload.com", "eyesfile.com", "eyvx.com", "fik1.com", "file4safe.com", "file4sharing.com", - "fileforth.com", "filemade.com", "filemak.com", "fileplaygroud.com", "filerace.com", "filestrack.com", - "fileupper.com", "filevelocity.com", "fooget.com", "4bytez.com", "freefilessharing.com", "glumbouploads.com", "grupload.com", - "heftyfile.com", "hipfile.com", "host4desi.com", "hulkshare.com", "idupin.com", "imageporter.com", "isharefast.com", - "jalurcepat.com", "laoupload.com", "linkzhost.com", "loombo.com", "maknyos.com", - "mlfat4arab.com", "movreel.com", "netuploaded.com", "ok2upload.com", "180upload.com", "1hostclick.com", "ovfile.com", - "putshare.com", "pyramidfiles.com", "q4share.com", "queenshare.com", "ravishare.com", "rockdizfile.com", "sendmyway.com", + "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", + #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", "speedoshare.com", "uploadbaz.com", "uploadboost.com", "uploadc.com", - "uploaddot.com", "uploadfloor.com", "uploadic.com", "uploadville.com", "uptobox.com", "vidbull.com", "zalaa.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", "kingshare.to", "filemaze.ws", "filehost.ws", "goldfile.eu", "filestock.ru", "moidisk.ru" - "4up.me", "kfiles.kz", "odsiebie.pl", "upchi.co.il", "upit.in", "verzend.be" - )) - + "farshare.to", "filemaze.ws", "filehost.ws", "filestock.ru", "moidisk.ru", "4up.im", "100shared.com", + #WRONG FILE NAME: + "sendmyway.com", "upchi.co.il", "180upload.com", #NOT WORKING: - """ - """ + "amonshare.com", "imageporter.com", "file4safe.com", + #DOWN OR BROKEN: + "ddlanime.com", "fileforth.com", "loombo.com", "goldfile.eu", "putshare.com" + )) hosterList -= (excludeList) hosterList -= set(('', u'')) -- cgit v1.2.3 From 5cbfd1ebff6845f2824f0086969b733346858d5a Mon Sep 17 00:00:00 2001 From: Nils Hesse Date: Thu, 8 Nov 2012 13:06:06 +0100 Subject: Added the reload.cc plugin --- module/plugins/hooks/ReloadCc.py | 59 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 module/plugins/hooks/ReloadCc.py (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/ReloadCc.py b/module/plugins/hooks/ReloadCc.py new file mode 100644 index 000000000..1d4adfbe3 --- /dev/null +++ b/module/plugins/hooks/ReloadCc.py @@ -0,0 +1,59 @@ +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.1" + __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, we dont use them anyway + + 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() + + pwd = "pwd=%s" % data['password'] + + try: + pwd = "hash=%s" % data['pwdhash'] + except Exception: + pass + + # Get supported hosters list from reload.cc using the json API v1 + answer = getURL("https://api.reload.cc/login?via=pyload&v=1&get_supported=true&get_traffic=true&user=%s&%s" % (user, pwd)) + 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) \ No newline at end of file -- cgit v1.2.3 From a0217bf6ef37f5ee57b2bf04baa6568adb69247a Mon Sep 17 00:00:00 2001 From: Nils Hesse Date: Thu, 8 Nov 2012 23:46:51 +0100 Subject: Use a dictionary to supply HTTP requests with the GET parameters (ensure proper URL encoding) --- module/plugins/hooks/ReloadCc.py | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/ReloadCc.py b/module/plugins/hooks/ReloadCc.py index 1d4adfbe3..e563e81ba 100644 --- a/module/plugins/hooks/ReloadCc.py +++ b/module/plugins/hooks/ReloadCc.py @@ -5,7 +5,7 @@ from module.network.RequestFactory import getURL class ReloadCc(MultiHoster): __name__ = "ReloadCc" - __version__ = "0.1" + __version__ = "0.2" __type__ = "hook" __description__ = """Reload.cc hook plugin""" @@ -16,7 +16,7 @@ class ReloadCc(MultiHoster): __author_name__ = ("Reload Team") __author_mail__ = ("hello@reload.cc") - interval = 0 # Disable periodic calls, we dont use them anyway + interval = 0 # Disable periodic calls def getHoster(self): # If no accounts are available there will be no hosters available @@ -26,16 +26,22 @@ class ReloadCc(MultiHoster): # Get account data (user, data) = self.account.selectAccount() - - pwd = "pwd=%s" % data['password'] + + # 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: - pwd = "hash=%s" % data['pwdhash'] + query_params.update(dict(hash=self.account.infos[user]['pwdhash'])) except Exception: - pass + query_params.update(dict(pwd=data['password'])) - # Get supported hosters list from reload.cc using the json API v1 - answer = getURL("https://api.reload.cc/login?via=pyload&v=1&get_supported=true&get_traffic=true&user=%s&%s" % (user, pwd)) + answer = getURL("https://api.reload.cc/login", get=query_params) data = json_loads(answer) @@ -52,7 +58,7 @@ class ReloadCc(MultiHoster): 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.")) + 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 -- cgit v1.2.3 From 94966b3c2a093a79858dd9672ae2380bdc3ccf6e Mon Sep 17 00:00:00 2001 From: zoidberg10 Date: Tue, 13 Nov 2012 21:57:57 +0100 Subject: youtube config options, resume - closed #717, ul.to - closed #716, netload.in - fix some urls, linkdecrypter - fix crypter list --- module/plugins/hooks/LinkdecrypterCom.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/LinkdecrypterCom.py b/module/plugins/hooks/LinkdecrypterCom.py index ac939afd9..a554e05eb 100644 --- a/module/plugins/hooks/LinkdecrypterCom.py +++ b/module/plugins/hooks/LinkdecrypterCom.py @@ -24,28 +24,33 @@ from module.utils import remove_chars class LinkdecrypterCom(Hook): __name__ = "LinkdecrypterCom" - __version__ = "0.14" + __version__ = "0.15" __description__ = """linkdecrypter.com - regexp loader""" __config__ = [ ("activated", "bool", "Activated" , "True") ] __author_name__ = ("zoidberg") - + def coreReady(self): page = getURL("http://linkdecrypter.com/") m = re.search(r'Supported: ([^+<]*)', page) if not m: self.logError(_("Crypter list not found")) return - - online = m.group(1).split(', ') + builtin = [ name.lower() for name in self.core.pluginManager.crypterPlugins.keys() ] builtin.extend([ "downloadserienjunkiesorg" ]) - - online = [ crypter.replace(".", "\\.") for crypter in online if remove_chars(crypter, "-.") not in builtin ] + + 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) + regexp = r"http://([^.]+\.)*?(%s)/.*" % "|".join(online) dict = self.core.pluginManager.crypterPlugins[self.__name__] dict["pattern"] = regexp -- cgit v1.2.3 From af7376b3a37c09ade8329d2136862faf1f6537fb Mon Sep 17 00:00:00 2001 From: zoidberg10 Date: Thu, 15 Nov 2012 21:32:18 +0100 Subject: ExternalScripts - patch by x_puma_x - closed #712,#713 --- module/plugins/hooks/ExternalScripts.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index 2e77f1dae..f46f290c0 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -27,7 +27,7 @@ from module.utils import save_join class ExternalScripts(Hook): __name__ = "ExternalScripts" - __version__ = "0.21" + __version__ = "0.22" __description__ = """Run external scripts""" __config__ = [("activated", "bool", "Activated", "True")] __author_name__ = ("mkaay", "RaNaN", "spoob") @@ -85,7 +85,7 @@ class ExternalScripts(Hook): def downloadFinished(self, pyfile): for script in self.scripts['download_finished']: - self.callScript(script, pyfile.pluginname, pyfile.url, pyfile.name, pyfile.id, + self.callScript(script, pyfile.pluginname, pyfile.url, pyfile.name, save_join(self.core.config['general']['download_folder'], pyfile.package().folder, pyfile.name), pyfile.id) @@ -95,7 +95,7 @@ class ExternalScripts(Hook): folder = self.core.config['general']['download_folder'] folder = save_join(folder, pypack.folder) - self.callScript(script, pypack.name, folder, pypack.id) + self.callScript(script, pypack.name, folder, pypack.password, pypack.id) def beforeReconnecting(self, ip): for script in self.scripts['before_reconnect']: -- cgit v1.2.3 From c00d44161399f7094931bac8144f544f3dd4002b Mon Sep 17 00:00:00 2001 From: Nils Hesse Date: Fri, 22 Feb 2013 15:20:34 +0100 Subject: Change from https:// to http:// for api.reload.cc requests (SSL not supported yet) --- module/plugins/hooks/ReloadCc.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/ReloadCc.py b/module/plugins/hooks/ReloadCc.py index e563e81ba..dbd9d659b 100644 --- a/module/plugins/hooks/ReloadCc.py +++ b/module/plugins/hooks/ReloadCc.py @@ -5,25 +5,25 @@ from module.network.RequestFactory import getURL class ReloadCc(MultiHoster): __name__ = "ReloadCc" - __version__ = "0.2" + __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"), + ("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): + + 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() @@ -41,25 +41,25 @@ class ReloadCc(MultiHoster): except Exception: query_params.update(dict(pwd=data['password'])) - answer = getURL("https://api.reload.cc/login", get=query_params) + 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'] - + + # 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") + 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) \ No newline at end of file + + # Run the overwriten core ready which actually enables the multihoster hook + return MultiHoster.coreReady(self) -- cgit v1.2.3 From ad2a4ba837fb450df24094d916deebb10837c9eb Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sat, 2 Mar 2013 16:34:43 +0100 Subject: closed #27 --- module/plugins/hooks/Captcha9kw.py | 61 ++++++++++++++++++++++---------------- 1 file changed, 35 insertions(+), 26 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index b4d23f6e8..dc223ae1e 100644 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -30,7 +30,7 @@ from module.plugins.Hook import Hook class Captcha9kw(Hook): __name__ = "Captcha9kw" - __version__ = "0.02" + __version__ = "0.03" __description__ = """send captchas to 9kw.eu""" __config__ = [("activated", "bool", "Activated", False), ("force", "bool", "Force CT even if client is connected", False), @@ -43,13 +43,13 @@ class Captcha9kw(Hook): def setup(self): self.info = {} - def getCredits(self): - response = getURL(self.API_URL, get = { "apikey": self.getConfig("passkey"), "pyload": "1", "action": "usercaptchaguthaben" }) - + 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) - return credits + return credits else: self.logError(response) return 0 @@ -63,29 +63,33 @@ class Captcha9kw(Hook): self.logDebug("%s : %s" % (task.captchaFile, data)) response = getURL(self.API_URL, post = { - "apikey": self.getConfig("passkey"), - "pyload": "1", - "base64": "1", - "file-upload-01": data, - "action": "usercaptchaupload" }) + "apikey": self.getConfig("passkey"), + "pyload": "1", + "source": "pyload", + "base64": "1", + "file-upload-01": data, + "action": "usercaptchaupload" }) + + if response.isdigit(): + self.logInfo(_("NewCaptchaID from upload: %s : %s" % (response,task.captchaFile))) - for i in range(1, 100, 2): - response2 = getURL(self.API_URL, get = { "apikey": self.getConfig("passkey"), "id": response,"pyload": "1", "action": "usercaptchacorrectdata" }) + for i in range(1, 200, 2): + response2 = getURL(self.API_URL, get = { "apikey": self.getConfig("passkey"), "id": response,"pyload": "1","source": "pyload", "action": "usercaptchacorrectdata" }) - if(response2 != ""): - break; + if(response2 != ""): + break; - time.sleep(1) + time.sleep(1) - result = response2 - task.data["ticket"] = response - self.logDebug("result %s : %s" % (response, result)) - task.setResult(result) + result = response2 + task.data["ticket"] = response + self.logInfo("result %s : %s" % (response, result)) + task.setResult(result) + else: + self.logError("Bad upload: %s" % response) + return False def newCaptchaTask(self, task): - if "service" in task.data: #captcha already beeing handled - return False - if not task.isTextual(): return False @@ -97,12 +101,11 @@ class Captcha9kw(Hook): if self.getCredits() > 0: task.handler.append(self) - task.data['service'] = self.__name__ - task.setWaiting(100) + task.setWaiting(220) start_new_thread(self.processCaptcha, (task,)) else: - self.logInfo(_("Your Captcha 9kw.eu Account has not enough credits")) + self.logError(_("Your Captcha 9kw.eu Account has not enough credits")) def captchaCorrect(self, task): if "ticket" in task.data: @@ -114,12 +117,15 @@ class Captcha9kw(Hook): "api_key": self.getConfig("passkey"), "correct": "1", "pyload": "1", + "source": "pyload", "id": task.data["ticket"] } ) self.logInfo("Request correct: %s" % response) except BadHeader, e: self.logError("Could not send correct request.", str(e)) + else: + self.logError("No CaptchaID for correct request (task %s) found." % task) def captchaInvalid(self, task): if "ticket" in task.data: @@ -131,9 +137,12 @@ class Captcha9kw(Hook): "api_key": self.getConfig("passkey"), "correct": "2", "pyload": "1", + "source": "pyload", "id": task.data["ticket"] } ) self.logInfo("Request refund: %s" % response) except BadHeader, e: - self.logError("Could not send refund request.", str(e)) \ No newline at end of file + self.logError("Could not send refund request.", str(e)) + else: + self.logError("No CaptchaID for not correct request (task %s) found." % task) -- cgit v1.2.3 From f9a78e7ff37cc7b2420a58cfb7539453aa78678c Mon Sep 17 00:00:00 2001 From: Stefano Date: Wed, 6 Mar 2013 23:01:32 +0100 Subject: LinkdecrypterCom: regex fix --- module/plugins/hooks/LinkdecrypterCom.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/LinkdecrypterCom.py b/module/plugins/hooks/LinkdecrypterCom.py index a554e05eb..2cb91d120 100644 --- a/module/plugins/hooks/LinkdecrypterCom.py +++ b/module/plugins/hooks/LinkdecrypterCom.py @@ -24,14 +24,14 @@ from module.utils import remove_chars class LinkdecrypterCom(Hook): __name__ = "LinkdecrypterCom" - __version__ = "0.15" + __version__ = "0.16" __description__ = """linkdecrypter.com - regexp loader""" __config__ = [ ("activated", "bool", "Activated" , "True") ] __author_name__ = ("zoidberg") def coreReady(self): page = getURL("http://linkdecrypter.com/") - m = re.search(r'Supported: ([^+<]*)', page) + m = re.search(r'Supported\(\d+\): ([^+<]*)', page) if not m: self.logError(_("Crypter list not found")) return @@ -56,4 +56,4 @@ class LinkdecrypterCom(Hook): dict["pattern"] = regexp dict["re"] = re.compile(regexp) - self.logDebug("REGEXP: " + regexp) \ No newline at end of file + self.logDebug("REGEXP: " + regexp) -- cgit v1.2.3 From 803ae199c53aad8b682b2d0a8e46af786589a1b0 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sat, 9 Mar 2013 13:03:08 +0100 Subject: updated 9kw plugin (#27) --- module/plugins/hooks/Captcha9kw.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) mode change 100644 => 100755 module/plugins/hooks/Captcha9kw.py (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py old mode 100644 new mode 100755 index dc223ae1e..b34ffeb05 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -32,8 +32,8 @@ class Captcha9kw(Hook): __name__ = "Captcha9kw" __version__ = "0.03" __description__ = """send captchas to 9kw.eu""" - __config__ = [("activated", "bool", "Activated", False), - ("force", "bool", "Force CT even if client is connected", False), + __config__ = [("activated", "bool", "Activated", True), + ("force", "bool", "Force CT even if client is connected", True), ("passkey", "password", "API key", ""),] __author_name__ = ("RaNaN") __author_mail__ = ("RaNaN@pyload.org") @@ -61,12 +61,17 @@ class Captcha9kw(Hook): data = f.read() data = b64encode(data) self.logDebug("%s : %s" % (task.captchaFile, data)) + if task.isPositional(): + mouse = 1 + else: + mouse = 0 response = getURL(self.API_URL, post = { "apikey": self.getConfig("passkey"), "pyload": "1", "source": "pyload", "base64": "1", + "mouse": mouse, "file-upload-01": data, "action": "usercaptchaupload" }) @@ -90,7 +95,7 @@ class Captcha9kw(Hook): return False def newCaptchaTask(self, task): - if not task.isTextual(): + if not task.isTextual() and not task.isPositional(): return False if not self.getConfig("passkey"): @@ -145,4 +150,4 @@ class Captcha9kw(Hook): 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) + self.logError("No CaptchaID for not correct request (task %s) found." % task) \ No newline at end of file -- cgit v1.2.3 From 261e5d90719a9a578f718c55992c80b0b3f7e45f Mon Sep 17 00:00:00 2001 From: Stefano Date: Sat, 23 Mar 2013 21:30:27 +0100 Subject: New debrid: DebridItaliaCom --- module/plugins/hooks/DebridItaliaCom.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 module/plugins/hooks/DebridItaliaCom.py (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/DebridItaliaCom.py b/module/plugins/hooks/DebridItaliaCom.py new file mode 100644 index 000000000..8cd997f4d --- /dev/null +++ b/module/plugins/hooks/DebridItaliaCom.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- + +from module.plugins.internal.MultiHoster import MultiHoster + + +class DebridItaliaCom(MultiHoster): + __name__ = "DebridItaliaCom" + __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__ = """Debriditalia.com hook plugin""" + __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", + "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"] -- cgit v1.2.3 From 8342aad089589479650703de915a356d634b202b Mon Sep 17 00:00:00 2001 From: Stefano Date: Sat, 23 Mar 2013 22:32:28 +0100 Subject: Plugins: fixed inconsistent indentation --- module/plugins/hooks/Captcha9kw.py | 52 +++++++++++++++++----------------- module/plugins/hooks/ExtractArchive.py | 2 -- 2 files changed, 26 insertions(+), 28 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index b34ffeb05..a01ce9576 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -62,40 +62,40 @@ class Captcha9kw(Hook): data = b64encode(data) self.logDebug("%s : %s" % (task.captchaFile, data)) if task.isPositional(): - mouse = 1 + mouse = 1 else: - mouse = 0 + mouse = 0 response = getURL(self.API_URL, post = { - "apikey": self.getConfig("passkey"), - "pyload": "1", - "source": "pyload", - "base64": "1", - "mouse": mouse, - "file-upload-01": data, - "action": "usercaptchaupload" }) + "apikey": self.getConfig("passkey"), + "pyload": "1", + "source": "pyload", + "base64": "1", + "mouse": mouse, + "file-upload-01": data, + "action": "usercaptchaupload" }) - if response.isdigit(): - self.logInfo(_("NewCaptchaID from upload: %s : %s" % (response,task.captchaFile))) + if response.isdigit(): + self.logInfo(_("NewCaptchaID from upload: %s : %s" % (response,task.captchaFile))) - for i in range(1, 200, 2): - response2 = getURL(self.API_URL, get = { "apikey": self.getConfig("passkey"), "id": response,"pyload": "1","source": "pyload", "action": "usercaptchacorrectdata" }) + for i in range(1, 200, 2): + response2 = getURL(self.API_URL, get = { "apikey": self.getConfig("passkey"), "id": response,"pyload": "1","source": "pyload", "action": "usercaptchacorrectdata" }) - if(response2 != ""): - break; + if(response2 != ""): + break; - time.sleep(1) + time.sleep(1) - result = response2 - task.data["ticket"] = response - self.logInfo("result %s : %s" % (response, result)) - task.setResult(result) - else: - self.logError("Bad upload: %s" % response) - return False + result = response2 + task.data["ticket"] = response + self.logInfo("result %s : %s" % (response, result)) + task.setResult(result) + else: + self.logError("Bad upload: %s" % response) + return False def newCaptchaTask(self, task): - if not task.isTextual() and not task.isPositional(): + if not task.isTextual() and not task.isPositional(): return False if not self.getConfig("passkey"): @@ -130,7 +130,7 @@ class Captcha9kw(Hook): except BadHeader, e: self.logError("Could not send correct request.", str(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: @@ -150,4 +150,4 @@ class Captcha9kw(Hook): 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) \ No newline at end of file + self.logError("No CaptchaID for not correct request (task %s) found." % task) diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index c789495ca..a5a973b7f 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -196,8 +196,6 @@ class ExtractArchive(Hook): files_ids = new_files_ids # also check extracted files if not matched: self.logInfo(_("No files found to extract")) - - def startExtracting(self, plugin, fid, passwords, thread): pyfile = self.core.files.getFile(fid) -- cgit v1.2.3