From 46eaa480d1f80b7aa701d756de953050f7885f0c Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 16 Feb 2015 10:39:43 +0100 Subject: Fix filename case --- pyload/plugin/account/File4SafeCom.py | 18 +++ pyload/plugin/account/File4safeCom.py | 18 --- pyload/plugin/account/Keep2ShareCc.py | 69 ++++++++++ pyload/plugin/account/Keep2shareCc.py | 69 ---------- pyload/plugin/account/NowVideoAt.py | 56 -------- pyload/plugin/account/NowVideoSx.py | 56 ++++++++ pyload/plugin/crypter/C1NeonCom.py | 19 +++ pyload/plugin/crypter/C1neonCom.py | 19 --- pyload/plugin/crypter/Movie2KTo.py | 19 +++ pyload/plugin/crypter/Movie2kTo.py | 19 --- pyload/plugin/hook/Captcha9Kw.py | 253 ++++++++++++++++++++++++++++++++++ pyload/plugin/hook/Captcha9kw.py | 253 ---------------------------------- pyload/plugin/hoster/Keep2ShareCc.py | 132 ++++++++++++++++++ pyload/plugin/hoster/Keep2shareCc.py | 132 ------------------ pyload/plugin/hoster/Share4WebCom.py | 22 +++ pyload/plugin/hoster/Share4webCom.py | 22 --- pyload/plugin/hoster/Vipleech4UCom.py | 18 +++ pyload/plugin/hoster/Vipleech4uCom.py | 18 --- 18 files changed, 606 insertions(+), 606 deletions(-) create mode 100644 pyload/plugin/account/File4SafeCom.py delete mode 100644 pyload/plugin/account/File4safeCom.py create mode 100644 pyload/plugin/account/Keep2ShareCc.py delete mode 100644 pyload/plugin/account/Keep2shareCc.py delete mode 100644 pyload/plugin/account/NowVideoAt.py create mode 100644 pyload/plugin/account/NowVideoSx.py create mode 100644 pyload/plugin/crypter/C1NeonCom.py delete mode 100644 pyload/plugin/crypter/C1neonCom.py create mode 100644 pyload/plugin/crypter/Movie2KTo.py delete mode 100644 pyload/plugin/crypter/Movie2kTo.py create mode 100644 pyload/plugin/hook/Captcha9Kw.py delete mode 100644 pyload/plugin/hook/Captcha9kw.py create mode 100644 pyload/plugin/hoster/Keep2ShareCc.py delete mode 100644 pyload/plugin/hoster/Keep2shareCc.py create mode 100644 pyload/plugin/hoster/Share4WebCom.py delete mode 100644 pyload/plugin/hoster/Share4webCom.py create mode 100644 pyload/plugin/hoster/Vipleech4UCom.py delete mode 100644 pyload/plugin/hoster/Vipleech4uCom.py (limited to 'pyload/plugin') diff --git a/pyload/plugin/account/File4SafeCom.py b/pyload/plugin/account/File4SafeCom.py new file mode 100644 index 000000000..4f311aa4c --- /dev/null +++ b/pyload/plugin/account/File4SafeCom.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- + +from pyload.plugin.internal.XFSAccount import XFSAccount + + +class File4safeCom(XFSAccount): + __name__ = "File4safeCom" + __type__ = "account" + __version__ = "0.04" + + __description__ = """File4safe.com account plugin""" + __license__ = "GPLv3" + __authors__ = [("stickell", "l.stickell@yahoo.it")] + + + HOSTER_DOMAIN = "file4safe.com" + + LOGIN_FAIL_PATTERN = r'input_login' diff --git a/pyload/plugin/account/File4safeCom.py b/pyload/plugin/account/File4safeCom.py deleted file mode 100644 index 4f311aa4c..000000000 --- a/pyload/plugin/account/File4safeCom.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- - -from pyload.plugin.internal.XFSAccount import XFSAccount - - -class File4safeCom(XFSAccount): - __name__ = "File4safeCom" - __type__ = "account" - __version__ = "0.04" - - __description__ = """File4safe.com account plugin""" - __license__ = "GPLv3" - __authors__ = [("stickell", "l.stickell@yahoo.it")] - - - HOSTER_DOMAIN = "file4safe.com" - - LOGIN_FAIL_PATTERN = r'input_login' diff --git a/pyload/plugin/account/Keep2ShareCc.py b/pyload/plugin/account/Keep2ShareCc.py new file mode 100644 index 000000000..7ed15dc62 --- /dev/null +++ b/pyload/plugin/account/Keep2ShareCc.py @@ -0,0 +1,69 @@ +# -*- coding: utf-8 -*- + +import re + +from time import gmtime, mktime, strptime + +from pyload.plugin.Account import Account + + +class Keep2shareCc(Account): + __name__ = "Keep2shareCc" + __type__ = "account" + __version__ = "0.02" + + __description__ = """Keep2share.cc account plugin""" + __license__ = "GPLv3" + __authors__ = [("aeronaut", "aeronaut@pianoguy.de")] + + + VALID_UNTIL_PATTERN = r'Premium expires: (.+?)' + TRAFFIC_LEFT_PATTERN = r'Available traffic \(today\):(.+?)' + + LOGIN_FAIL_PATTERN = r'Please fix the following input errors' + + + def loadAccountInfo(self, user, req): + validuntil = None + trafficleft = None + premium = None + + html = req.load("http://keep2share.cc/site/profile.html", decode=True) + + m = re.search(self.VALID_UNTIL_PATTERN, html) + if m: + expiredate = m.group(1).strip() + self.logDebug("Expire date: " + expiredate) + + try: + validuntil = mktime(strptime(expiredate, "%Y.%m.%d")) + + except Exception, e: + self.logError(e) + + else: + if validuntil > mktime(gmtime()): + premium = True + else: + premium = False + validuntil = None + + m = re.search(self.TRAFFIC_LEFT_PATTERN, html) + if m: + try: + trafficleft = self.parseTraffic(m.group(1)) + + except Exception, e: + self.logError(e) + + return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium} + + + def login(self, user, data, req): + req.cj.setCookie("keep2share.cc", "lang", "en") + + html = req.load("http://keep2share.cc/login.html", + post={'LoginForm[username]': user, 'LoginForm[password]': data['password']}) + + if re.search(self.LOGIN_FAIL_PATTERN, html): + self.wrongPassword() diff --git a/pyload/plugin/account/Keep2shareCc.py b/pyload/plugin/account/Keep2shareCc.py deleted file mode 100644 index 7ed15dc62..000000000 --- a/pyload/plugin/account/Keep2shareCc.py +++ /dev/null @@ -1,69 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from time import gmtime, mktime, strptime - -from pyload.plugin.Account import Account - - -class Keep2shareCc(Account): - __name__ = "Keep2shareCc" - __type__ = "account" - __version__ = "0.02" - - __description__ = """Keep2share.cc account plugin""" - __license__ = "GPLv3" - __authors__ = [("aeronaut", "aeronaut@pianoguy.de")] - - - VALID_UNTIL_PATTERN = r'Premium expires: (.+?)' - TRAFFIC_LEFT_PATTERN = r'Available traffic \(today\):(.+?)' - - LOGIN_FAIL_PATTERN = r'Please fix the following input errors' - - - def loadAccountInfo(self, user, req): - validuntil = None - trafficleft = None - premium = None - - html = req.load("http://keep2share.cc/site/profile.html", decode=True) - - m = re.search(self.VALID_UNTIL_PATTERN, html) - if m: - expiredate = m.group(1).strip() - self.logDebug("Expire date: " + expiredate) - - try: - validuntil = mktime(strptime(expiredate, "%Y.%m.%d")) - - except Exception, e: - self.logError(e) - - else: - if validuntil > mktime(gmtime()): - premium = True - else: - premium = False - validuntil = None - - m = re.search(self.TRAFFIC_LEFT_PATTERN, html) - if m: - try: - trafficleft = self.parseTraffic(m.group(1)) - - except Exception, e: - self.logError(e) - - return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium} - - - def login(self, user, data, req): - req.cj.setCookie("keep2share.cc", "lang", "en") - - html = req.load("http://keep2share.cc/login.html", - post={'LoginForm[username]': user, 'LoginForm[password]': data['password']}) - - if re.search(self.LOGIN_FAIL_PATTERN, html): - self.wrongPassword() diff --git a/pyload/plugin/account/NowVideoAt.py b/pyload/plugin/account/NowVideoAt.py deleted file mode 100644 index d2527d635..000000000 --- a/pyload/plugin/account/NowVideoAt.py +++ /dev/null @@ -1,56 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from time import gmtime, mktime, strptime - -from pyload.plugin.Account import Account - - -class NowVideoAt(Account): - __name__ = "NowVideoAt" - __type__ = "account" - __version__ = "0.01" - - __description__ = """NowVideo.at account plugin""" - __license__ = "GPLv3" - __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - - - VALID_UNTIL_PATTERN = r'>Your premium membership expires on: (.+?)<' - - - def loadAccountInfo(self, user, req): - validuntil = None - trafficleft = -1 - premium = None - - html = req.load("http://www.nowvideo.at/premium.php") - - m = re.search(self.VALID_UNTIL_PATTERN, html) - if m: - expiredate = m.group(1).strip() - self.logDebug("Expire date: " + expiredate) - - try: - validuntil = mktime(strptime(expiredate, "%Y-%b-%d")) - - except Exception, e: - self.logError(e) - - else: - if validuntil > mktime(gmtime()): - premium = True - else: - premium = False - validuntil = -1 - - return {"validuntil": validuntil, "trafficleft": trafficleft, "premium": premium} - - - def login(self, user, data, req): - html = req.load("http://www.nowvideo.at/login.php", - post={'user': user, 'pass': data['password']}) - - if ">Invalid login details" is html: - self.wrongPassword() diff --git a/pyload/plugin/account/NowVideoSx.py b/pyload/plugin/account/NowVideoSx.py new file mode 100644 index 000000000..d2527d635 --- /dev/null +++ b/pyload/plugin/account/NowVideoSx.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- + +import re + +from time import gmtime, mktime, strptime + +from pyload.plugin.Account import Account + + +class NowVideoAt(Account): + __name__ = "NowVideoAt" + __type__ = "account" + __version__ = "0.01" + + __description__ = """NowVideo.at account plugin""" + __license__ = "GPLv3" + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + + + VALID_UNTIL_PATTERN = r'>Your premium membership expires on: (.+?)<' + + + def loadAccountInfo(self, user, req): + validuntil = None + trafficleft = -1 + premium = None + + html = req.load("http://www.nowvideo.at/premium.php") + + m = re.search(self.VALID_UNTIL_PATTERN, html) + if m: + expiredate = m.group(1).strip() + self.logDebug("Expire date: " + expiredate) + + try: + validuntil = mktime(strptime(expiredate, "%Y-%b-%d")) + + except Exception, e: + self.logError(e) + + else: + if validuntil > mktime(gmtime()): + premium = True + else: + premium = False + validuntil = -1 + + return {"validuntil": validuntil, "trafficleft": trafficleft, "premium": premium} + + + def login(self, user, data, req): + html = req.load("http://www.nowvideo.at/login.php", + post={'user': user, 'pass': data['password']}) + + if ">Invalid login details" is html: + self.wrongPassword() diff --git a/pyload/plugin/crypter/C1NeonCom.py b/pyload/plugin/crypter/C1NeonCom.py new file mode 100644 index 000000000..a7973b041 --- /dev/null +++ b/pyload/plugin/crypter/C1NeonCom.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- + +from pyload.plugin.internal.DeadCrypter import DeadCrypter, create_getInfo + + +class C1neonCom(DeadCrypter): + __name__ = "C1neonCom" + __type__ = "crypter" + __version__ = "0.05" + + __pattern__ = r'http://(?:www\.)?c1neon\.com/.*?' + __config__ = [] + + __description__ = """C1neon.com decrypter plugin""" + __license__ = "GPLv3" + __authors__ = [("godofdream", "soilfiction@gmail.com")] + + +getInfo = create_getInfo(C1neonCom) diff --git a/pyload/plugin/crypter/C1neonCom.py b/pyload/plugin/crypter/C1neonCom.py deleted file mode 100644 index a7973b041..000000000 --- a/pyload/plugin/crypter/C1neonCom.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- - -from pyload.plugin.internal.DeadCrypter import DeadCrypter, create_getInfo - - -class C1neonCom(DeadCrypter): - __name__ = "C1neonCom" - __type__ = "crypter" - __version__ = "0.05" - - __pattern__ = r'http://(?:www\.)?c1neon\.com/.*?' - __config__ = [] - - __description__ = """C1neon.com decrypter plugin""" - __license__ = "GPLv3" - __authors__ = [("godofdream", "soilfiction@gmail.com")] - - -getInfo = create_getInfo(C1neonCom) diff --git a/pyload/plugin/crypter/Movie2KTo.py b/pyload/plugin/crypter/Movie2KTo.py new file mode 100644 index 000000000..16a9850d9 --- /dev/null +++ b/pyload/plugin/crypter/Movie2KTo.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- + +from pyload.plugin.internal.DeadCrypter import DeadCrypter, create_getInfo + + +class Movie2kTo(DeadCrypter): + __name__ = "Movie2kTo" + __type__ = "crypter" + __version__ = "0.51" + + __pattern__ = r'http://(?:www\.)?movie2k\.to/(.*)\.html' + __config__ = [] + + __description__ = """Movie2k.to decrypter plugin""" + __license__ = "GPLv3" + __authors__ = [("4Christopher", "4Christopher@gmx.de")] + + +getInfo = create_getInfo(Movie2kTo) diff --git a/pyload/plugin/crypter/Movie2kTo.py b/pyload/plugin/crypter/Movie2kTo.py deleted file mode 100644 index 16a9850d9..000000000 --- a/pyload/plugin/crypter/Movie2kTo.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- - -from pyload.plugin.internal.DeadCrypter import DeadCrypter, create_getInfo - - -class Movie2kTo(DeadCrypter): - __name__ = "Movie2kTo" - __type__ = "crypter" - __version__ = "0.51" - - __pattern__ = r'http://(?:www\.)?movie2k\.to/(.*)\.html' - __config__ = [] - - __description__ = """Movie2k.to decrypter plugin""" - __license__ = "GPLv3" - __authors__ = [("4Christopher", "4Christopher@gmx.de")] - - -getInfo = create_getInfo(Movie2kTo) diff --git a/pyload/plugin/hook/Captcha9Kw.py b/pyload/plugin/hook/Captcha9Kw.py new file mode 100644 index 000000000..a74983d9b --- /dev/null +++ b/pyload/plugin/hook/Captcha9Kw.py @@ -0,0 +1,253 @@ +# -*- 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 pyload.plugin.Addon import Addon + + +class Captcha9kw(Addon): + __name__ = "Captcha9kw" + __type__ = "hook" + __version__ = "0.26" + + __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 + + + def _processCaptcha(self, task): + try: + with open(task.captchaFile, 'rb') as f: + data = f.read() + + except IOError, e: + self.logError(e) + return + + data = b64encode(data) + mouse = 1 if task.isPositional() else 0 + 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' : mouse, + 'file-upload-01': 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/pyload/plugin/hook/Captcha9kw.py b/pyload/plugin/hook/Captcha9kw.py deleted file mode 100644 index a74983d9b..000000000 --- a/pyload/plugin/hook/Captcha9kw.py +++ /dev/null @@ -1,253 +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 pyload.plugin.Addon import Addon - - -class Captcha9kw(Addon): - __name__ = "Captcha9kw" - __type__ = "hook" - __version__ = "0.26" - - __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 - - - def _processCaptcha(self, task): - try: - with open(task.captchaFile, 'rb') as f: - data = f.read() - - except IOError, e: - self.logError(e) - return - - data = b64encode(data) - mouse = 1 if task.isPositional() else 0 - 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' : mouse, - 'file-upload-01': 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/pyload/plugin/hoster/Keep2ShareCc.py b/pyload/plugin/hoster/Keep2ShareCc.py new file mode 100644 index 000000000..8f8e8cb67 --- /dev/null +++ b/pyload/plugin/hoster/Keep2ShareCc.py @@ -0,0 +1,132 @@ +# -*- coding: utf-8 -*- + +import re + +from urlparse import urljoin, urlparse + +from pyload.plugin.internal.captcha import ReCaptcha +from pyload.plugin.internal.SimpleHoster import _isDirectLink, SimpleHoster, create_getInfo + + +class Keep2shareCc(SimpleHoster): + __name__ = "Keep2shareCc" + __type__ = "hoster" + __version__ = "0.17" + + __pattern__ = r'https?://(?:www\.)?(keep2share|k2s|keep2s)\.cc/file/(?P\w+)' + + __description__ = """Keep2share.cc hoster plugin""" + __license__ = "GPLv3" + __authors__ = [("stickell", "l.stickell@yahoo.it"), + ("Walter Purcaro", "vuolter@gmail.com")] + + + URL_REPLACEMENTS = [(__pattern__ + ".*", "http://k2s.cc/file/\g")] + + NAME_PATTERN = r'File: (?P.+)' + SIZE_PATTERN = r'Size: (?P[^<]+)' + + OFFLINE_PATTERN = r'File not found or deleted|Sorry, this file is blocked or deleted|Error 404' + TEMP_OFFLINE_PATTERN = r'Downloading blocked due to' + + LINK_FREE_PATTERN = LINK_PREMIUM_PATTERN = r'"([^"]+url.html?file=.+?)"|window\.location\.href = \'(.+?)\';' + + CAPTCHA_PATTERN = r'src="(/file/captcha\.html.+?)"' + + WAIT_PATTERN = r'Please wait ([\d:]+) to download this file' + TEMP_ERROR_PATTERN = r'>\s*(Download count files exceed|Traffic limit exceed|Free account does not allow to download more than one file at the same time)' + ERROR_PATTERN = r'>\s*(Free user can\'t download large files|You no can access to this file|This download available only for premium users|This is private file)' + + + def checkErrors(self): + m = re.search(self.TEMP_ERROR_PATTERN, self.html) + if m: + self.info['error'] = m.group(1) + self.wantReconnect = True + self.retry(wait_time=30 * 60, reason=m.group(0)) + + m = re.search(self.ERROR_PATTERN, self.html) + if m: + errmsg = self.info['error'] = m.group(1) + self.error(errmsg) + + m = re.search(self.WAIT_PATTERN, self.html) + if m: + self.logDebug("Hoster told us to wait for %s" % m.group(1)) + + # string to time convert courtesy of https://stackoverflow.com/questions/10663720 + ftr = [3600, 60, 1] + wait_time = sum([a * b for a, b in zip(ftr, map(int, m.group(1).split(':')))]) + + self.wantReconnect = True + self.retry(wait_time=wait_time, reason="Please wait to download this file") + + self.info.pop('error', None) + + + def handleFree(self): + self.fid = re.search(r'', self.html).group(1) + self.html = self.load(self.pyfile.url, post={'yt0': '', 'slow_id': self.fid}) + + self.checkErrors() + + m = re.search(self.LINK_FREE_PATTERN, self.html) + + if m is None: + self.handleCaptcha() + + self.wait(30) + + self.html = self.load(self.pyfile.url, post={'uniqueId': self.fid, 'free': 1}) + + self.checkErrors() + + m = re.search(self.LINK_FREE_PATTERN, self.html) + if m is None: + self.error(_("LINK_FREE_PATTERN not found")) + + self.link = m.group(1) + + + def handleCaptcha(self): + recaptcha = ReCaptcha(self) + + for _i in xrange(5): + post_data = {'free' : 1, + 'freeDownloadRequest': 1, + 'uniqueId' : self.fid, + 'yt0' : ''} + + m = re.search(self.CAPTCHA_PATTERN, self.html) + if m: + captcha_url = urljoin(self.base, m.group(1)) + post_data['CaptchaForm[code]'] = self.decryptCaptcha(captcha_url) + else: + challenge, response = recaptcha.challenge() + post_data.update({'recaptcha_challenge_field': challenge, + 'recaptcha_response_field' : response}) + + self.html = self.load(self.pyfile.url, post=post_data) + + if 'recaptcha' not in self.html: + self.correctCaptcha() + break + else: + self.invalidCaptcha() + else: + self.fail(_("All captcha attempts failed")) + + + def downloadLink(self, link): + if not link: + return + + p = urlparse(self.pyfile.url) + base = "%s://%s" % (p.scheme, p.netloc) + link = _isDirectLink(self, link, self.premium) + + if link: + self.download(urljoin(base, link), disposition=True) + + +getInfo = create_getInfo(Keep2shareCc) diff --git a/pyload/plugin/hoster/Keep2shareCc.py b/pyload/plugin/hoster/Keep2shareCc.py deleted file mode 100644 index 8f8e8cb67..000000000 --- a/pyload/plugin/hoster/Keep2shareCc.py +++ /dev/null @@ -1,132 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from urlparse import urljoin, urlparse - -from pyload.plugin.internal.captcha import ReCaptcha -from pyload.plugin.internal.SimpleHoster import _isDirectLink, SimpleHoster, create_getInfo - - -class Keep2shareCc(SimpleHoster): - __name__ = "Keep2shareCc" - __type__ = "hoster" - __version__ = "0.17" - - __pattern__ = r'https?://(?:www\.)?(keep2share|k2s|keep2s)\.cc/file/(?P\w+)' - - __description__ = """Keep2share.cc hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("stickell", "l.stickell@yahoo.it"), - ("Walter Purcaro", "vuolter@gmail.com")] - - - URL_REPLACEMENTS = [(__pattern__ + ".*", "http://k2s.cc/file/\g")] - - NAME_PATTERN = r'File: (?P.+)' - SIZE_PATTERN = r'Size: (?P[^<]+)' - - OFFLINE_PATTERN = r'File not found or deleted|Sorry, this file is blocked or deleted|Error 404' - TEMP_OFFLINE_PATTERN = r'Downloading blocked due to' - - LINK_FREE_PATTERN = LINK_PREMIUM_PATTERN = r'"([^"]+url.html?file=.+?)"|window\.location\.href = \'(.+?)\';' - - CAPTCHA_PATTERN = r'src="(/file/captcha\.html.+?)"' - - WAIT_PATTERN = r'Please wait ([\d:]+) to download this file' - TEMP_ERROR_PATTERN = r'>\s*(Download count files exceed|Traffic limit exceed|Free account does not allow to download more than one file at the same time)' - ERROR_PATTERN = r'>\s*(Free user can\'t download large files|You no can access to this file|This download available only for premium users|This is private file)' - - - def checkErrors(self): - m = re.search(self.TEMP_ERROR_PATTERN, self.html) - if m: - self.info['error'] = m.group(1) - self.wantReconnect = True - self.retry(wait_time=30 * 60, reason=m.group(0)) - - m = re.search(self.ERROR_PATTERN, self.html) - if m: - errmsg = self.info['error'] = m.group(1) - self.error(errmsg) - - m = re.search(self.WAIT_PATTERN, self.html) - if m: - self.logDebug("Hoster told us to wait for %s" % m.group(1)) - - # string to time convert courtesy of https://stackoverflow.com/questions/10663720 - ftr = [3600, 60, 1] - wait_time = sum([a * b for a, b in zip(ftr, map(int, m.group(1).split(':')))]) - - self.wantReconnect = True - self.retry(wait_time=wait_time, reason="Please wait to download this file") - - self.info.pop('error', None) - - - def handleFree(self): - self.fid = re.search(r'', self.html).group(1) - self.html = self.load(self.pyfile.url, post={'yt0': '', 'slow_id': self.fid}) - - self.checkErrors() - - m = re.search(self.LINK_FREE_PATTERN, self.html) - - if m is None: - self.handleCaptcha() - - self.wait(30) - - self.html = self.load(self.pyfile.url, post={'uniqueId': self.fid, 'free': 1}) - - self.checkErrors() - - m = re.search(self.LINK_FREE_PATTERN, self.html) - if m is None: - self.error(_("LINK_FREE_PATTERN not found")) - - self.link = m.group(1) - - - def handleCaptcha(self): - recaptcha = ReCaptcha(self) - - for _i in xrange(5): - post_data = {'free' : 1, - 'freeDownloadRequest': 1, - 'uniqueId' : self.fid, - 'yt0' : ''} - - m = re.search(self.CAPTCHA_PATTERN, self.html) - if m: - captcha_url = urljoin(self.base, m.group(1)) - post_data['CaptchaForm[code]'] = self.decryptCaptcha(captcha_url) - else: - challenge, response = recaptcha.challenge() - post_data.update({'recaptcha_challenge_field': challenge, - 'recaptcha_response_field' : response}) - - self.html = self.load(self.pyfile.url, post=post_data) - - if 'recaptcha' not in self.html: - self.correctCaptcha() - break - else: - self.invalidCaptcha() - else: - self.fail(_("All captcha attempts failed")) - - - def downloadLink(self, link): - if not link: - return - - p = urlparse(self.pyfile.url) - base = "%s://%s" % (p.scheme, p.netloc) - link = _isDirectLink(self, link, self.premium) - - if link: - self.download(urljoin(base, link), disposition=True) - - -getInfo = create_getInfo(Keep2shareCc) diff --git a/pyload/plugin/hoster/Share4WebCom.py b/pyload/plugin/hoster/Share4WebCom.py new file mode 100644 index 000000000..4748c6e2a --- /dev/null +++ b/pyload/plugin/hoster/Share4WebCom.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- + +from pyload.plugin.hoster.UnibytesCom import UnibytesCom +from pyload.plugin.internal.SimpleHoster import create_getInfo + + +class Share4webCom(UnibytesCom): + __name__ = "Share4webCom" + __type__ = "hoster" + __version__ = "0.11" + + __pattern__ = r'https?://(?:www\.)?share4web\.com/get/\w+' + + __description__ = """Share4web.com hoster plugin""" + __license__ = "GPLv3" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] + + + HOSTER_DOMAIN = "share4web.com" + + +getInfo = create_getInfo(UnibytesCom) diff --git a/pyload/plugin/hoster/Share4webCom.py b/pyload/plugin/hoster/Share4webCom.py deleted file mode 100644 index 4748c6e2a..000000000 --- a/pyload/plugin/hoster/Share4webCom.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- - -from pyload.plugin.hoster.UnibytesCom import UnibytesCom -from pyload.plugin.internal.SimpleHoster import create_getInfo - - -class Share4webCom(UnibytesCom): - __name__ = "Share4webCom" - __type__ = "hoster" - __version__ = "0.11" - - __pattern__ = r'https?://(?:www\.)?share4web\.com/get/\w+' - - __description__ = """Share4web.com hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - - - HOSTER_DOMAIN = "share4web.com" - - -getInfo = create_getInfo(UnibytesCom) diff --git a/pyload/plugin/hoster/Vipleech4UCom.py b/pyload/plugin/hoster/Vipleech4UCom.py new file mode 100644 index 000000000..b56096d46 --- /dev/null +++ b/pyload/plugin/hoster/Vipleech4UCom.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- + +from pyload.plugin.internal.DeadHoster import DeadHoster, create_getInfo + + +class Vipleech4uCom(DeadHoster): + __name__ = "Vipleech4uCom" + __type__ = "hoster" + __version__ = "0.20" + + __pattern__ = r'http://(?:www\.)?vipleech4u\.com/manager\.php' + + __description__ = """Vipleech4u.com hoster plugin""" + __license__ = "GPLv3" + __authors__ = [("Kagenoshin", "kagenoshin@gmx.ch")] + + +getInfo = create_getInfo(Vipleech4uCom) diff --git a/pyload/plugin/hoster/Vipleech4uCom.py b/pyload/plugin/hoster/Vipleech4uCom.py deleted file mode 100644 index b56096d46..000000000 --- a/pyload/plugin/hoster/Vipleech4uCom.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- - -from pyload.plugin.internal.DeadHoster import DeadHoster, create_getInfo - - -class Vipleech4uCom(DeadHoster): - __name__ = "Vipleech4uCom" - __type__ = "hoster" - __version__ = "0.20" - - __pattern__ = r'http://(?:www\.)?vipleech4u\.com/manager\.php' - - __description__ = """Vipleech4u.com hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("Kagenoshin", "kagenoshin@gmx.ch")] - - -getInfo = create_getInfo(Vipleech4uCom) -- cgit v1.2.3