From eb61d1bb0a30fd32f99b93f847346c610fbc91d2 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 15 Nov 2014 07:26:01 +0100 Subject: Update plugins after merging --- module/plugins/accounts/CatShareNet.py | 56 ---- module/plugins/accounts/JunocloudMe.py | 16 - module/plugins/accounts/Keep2shareCc.py | 69 ----- module/plugins/accounts/LinestorageCom.py | 16 - module/plugins/accounts/MegaRapidCz.py | 59 ---- module/plugins/accounts/NowVideoAt.py | 56 ---- module/plugins/accounts/RapidfileshareNet.py | 18 -- module/plugins/accounts/UploadcCom.py | 16 - module/plugins/accounts/XFileSharingPro.py | 30 -- module/plugins/crypter/FilesonicComFolder.py | 15 - module/plugins/crypter/HotfileComFolder.py | 16 - module/plugins/crypter/JunocloudMeFolder.py | 20 -- module/plugins/crypter/LinkCryptWs.py | 341 --------------------- module/plugins/crypter/MegaRapidCzFolder.py | 20 -- module/plugins/crypter/MegauploadComFolder.py | 15 - module/plugins/crypter/RapidfileshareNetFolder.py | 20 -- module/plugins/crypter/SexuriaCom.py | 94 ------ module/plugins/crypter/SharingmatrixComFolder.py | 15 - module/plugins/crypter/WuploadComFolder.py | 15 - module/plugins/crypter/XFileSharingProFolder.py | 47 --- module/plugins/hoster/EnteruploadCom.py | 18 -- module/plugins/hoster/FileSharkPl.py | 137 --------- module/plugins/hoster/FilesonicCom.py | 19 -- module/plugins/hoster/JunocloudMe.py | 29 -- module/plugins/hoster/Keep2shareCc.py | 118 -------- module/plugins/hoster/KickloadCom.py | 18 -- module/plugins/hoster/MegaCoNz.py | 144 --------- module/plugins/hoster/MegaRapidCz.py | 71 ----- module/plugins/hoster/MegauploadCom.py | 18 -- module/plugins/hoster/MegavideoCom.py | 19 -- module/plugins/hoster/NahrajCz.py | 18 -- module/plugins/hoster/NowVideoAt.py | 44 --- module/plugins/hoster/OronCom.py | 19 -- module/plugins/hoster/PandaplaNet.py | 18 -- module/plugins/hoster/PrzeklejPl.py | 18 -- module/plugins/hoster/RapidfileshareNet.py | 31 -- module/plugins/hoster/SharingmatrixCom.py | 19 -- module/plugins/hoster/StorageTo.py | 18 -- module/plugins/hoster/UpleaCom.py | 60 ---- module/plugins/hoster/UploadboxCom.py | 18 -- module/plugins/hoster/UploadhereCom.py | 18 -- module/plugins/hoster/UploadkingCom.py | 18 -- module/plugins/internal/CaptchaService.py | 209 ------------- module/plugins/internal/XFSAccount.py | 122 -------- module/plugins/internal/XFSCrypter.py | 29 -- module/plugins/internal/XFSHoster.py | 345 ---------------------- 46 files changed, 2549 deletions(-) delete mode 100644 module/plugins/accounts/CatShareNet.py delete mode 100644 module/plugins/accounts/JunocloudMe.py delete mode 100644 module/plugins/accounts/Keep2shareCc.py delete mode 100644 module/plugins/accounts/LinestorageCom.py delete mode 100644 module/plugins/accounts/MegaRapidCz.py delete mode 100644 module/plugins/accounts/NowVideoAt.py delete mode 100644 module/plugins/accounts/RapidfileshareNet.py delete mode 100644 module/plugins/accounts/UploadcCom.py delete mode 100644 module/plugins/accounts/XFileSharingPro.py delete mode 100644 module/plugins/crypter/FilesonicComFolder.py delete mode 100644 module/plugins/crypter/HotfileComFolder.py delete mode 100644 module/plugins/crypter/JunocloudMeFolder.py delete mode 100644 module/plugins/crypter/LinkCryptWs.py delete mode 100644 module/plugins/crypter/MegaRapidCzFolder.py delete mode 100644 module/plugins/crypter/MegauploadComFolder.py delete mode 100644 module/plugins/crypter/RapidfileshareNetFolder.py delete mode 100644 module/plugins/crypter/SexuriaCom.py delete mode 100644 module/plugins/crypter/SharingmatrixComFolder.py delete mode 100644 module/plugins/crypter/WuploadComFolder.py delete mode 100644 module/plugins/crypter/XFileSharingProFolder.py delete mode 100644 module/plugins/hoster/EnteruploadCom.py delete mode 100644 module/plugins/hoster/FileSharkPl.py delete mode 100644 module/plugins/hoster/FilesonicCom.py delete mode 100644 module/plugins/hoster/JunocloudMe.py delete mode 100644 module/plugins/hoster/Keep2shareCc.py delete mode 100644 module/plugins/hoster/KickloadCom.py delete mode 100644 module/plugins/hoster/MegaCoNz.py delete mode 100644 module/plugins/hoster/MegaRapidCz.py delete mode 100644 module/plugins/hoster/MegauploadCom.py delete mode 100644 module/plugins/hoster/MegavideoCom.py delete mode 100644 module/plugins/hoster/NahrajCz.py delete mode 100644 module/plugins/hoster/NowVideoAt.py delete mode 100644 module/plugins/hoster/OronCom.py delete mode 100644 module/plugins/hoster/PandaplaNet.py delete mode 100644 module/plugins/hoster/PrzeklejPl.py delete mode 100644 module/plugins/hoster/RapidfileshareNet.py delete mode 100644 module/plugins/hoster/SharingmatrixCom.py delete mode 100644 module/plugins/hoster/StorageTo.py delete mode 100644 module/plugins/hoster/UpleaCom.py delete mode 100644 module/plugins/hoster/UploadboxCom.py delete mode 100644 module/plugins/hoster/UploadhereCom.py delete mode 100644 module/plugins/hoster/UploadkingCom.py delete mode 100644 module/plugins/internal/CaptchaService.py delete mode 100644 module/plugins/internal/XFSAccount.py delete mode 100644 module/plugins/internal/XFSCrypter.py delete mode 100644 module/plugins/internal/XFSHoster.py (limited to 'module/plugins') diff --git a/module/plugins/accounts/CatShareNet.py b/module/plugins/accounts/CatShareNet.py deleted file mode 100644 index c33219685..000000000 --- a/module/plugins/accounts/CatShareNet.py +++ /dev/null @@ -1,56 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from time import mktime, strptime - -from module.plugins.Account import Account - - -class CatShareNet(Account): - __name__ = "CatShareNet" - __type__ = "account" - __version__ = "0.01" - - __description__ = """CatShareNet account plugin""" - __license__ = "GPLv3" - __authors__ = [("prOq", None)] - - - PREMIUM_PATTERN = r'class="nav-collapse collapse pull-right">[\s\w<>=-."/:]*\sz.\s*
  • .*\s*(.*?)[\s\w<>/]*href="/logout"' - VALID_UNTIL_PATTERN = r'
    [\s\w<>=-":;]*.*?(.*?)' - - - def loadAccountInfo(self, user, req): - premium = False - validuntil = -1 - - html = req.load("http://catshare.net/", decode=True) - - try: - m = re.search(self.PREMIUM_PATTERN, html) - if "Premium" in m.group(1): - premium = True - except: - pass - - try: - m = re.search(self.VALID_UNTIL_PATTERN, html) - expiredate = m.group(1) - if "-" not in expiredate: - validuntil = mktime(strptime(expiredate, "%d.%m.%Y")) - except: - pass - - return {'premium': premium, 'trafficleft': -1, 'validuntil': validuntil} - - - def login(self, user, data, req): - html = req.load("http://catshare.net/login", - post={'user_email': user, - 'user_password': data['password'], - 'remindPassword': 0, - 'user[submit]': "Login"}) - - if not 'Wyloguj' in html: - self.wrongPassword() diff --git a/module/plugins/accounts/JunocloudMe.py b/module/plugins/accounts/JunocloudMe.py deleted file mode 100644 index b0fc160f3..000000000 --- a/module/plugins/accounts/JunocloudMe.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.XFSAccount import XFSAccount - - -class JunocloudMe(XFSAccount): - __name__ = "JunocloudMe" - __type__ = "account" - __version__ = "0.02" - - __description__ = """Junocloud.me account plugin""" - __license__ = "GPLv3" - __authors__ = [("guidobelix", "guidobelix@hotmail.it")] - - - HOSTER_DOMAIN = "junocloud.me" diff --git a/module/plugins/accounts/Keep2shareCc.py b/module/plugins/accounts/Keep2shareCc.py deleted file mode 100644 index de9b9b5d8..000000000 --- a/module/plugins/accounts/Keep2shareCc.py +++ /dev/null @@ -1,69 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from time import gmtime, mktime, strptime - -from module.plugins.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/module/plugins/accounts/LinestorageCom.py b/module/plugins/accounts/LinestorageCom.py deleted file mode 100644 index cf8dd3f3e..000000000 --- a/module/plugins/accounts/LinestorageCom.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.XFSAccount import XFSAccount - - -class LinestorageCom(XFSAccount): - __name__ = "LinestorageCom" - __type__ = "account" - __version__ = "0.02" - - __description__ = """Linestorage.com account plugin""" - __license__ = "GPLv3" - __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - - - HOSTER_DOMAIN = "linestorage.com" diff --git a/module/plugins/accounts/MegaRapidCz.py b/module/plugins/accounts/MegaRapidCz.py deleted file mode 100644 index 41da7ac73..000000000 --- a/module/plugins/accounts/MegaRapidCz.py +++ /dev/null @@ -1,59 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from time import mktime, strptime -from module.plugins.Account import Account - - -class MegaRapidCz(Account): - __name__ = "MegaRapidCz" - __type__ = "account" - __version__ = "0.34" - - __description__ = """MegaRapid.cz account plugin""" - __license__ = "GPLv3" - __authors__ = [("MikyWoW", "mikywow@seznam.cz"), - ("zoidberg", "zoidberg@mujmail.cz")] - - - login_timeout = 60 - - LIMITDL_PATTERN = ur'Max. počet paralelních stahování: (\d+)' - VALID_UNTIL_PATTERN = ur'Paušální stahování aktivní. Vyprší (.*?)' - TRAFFIC_LEFT_PATTERN = r'Kredit(.*?) GiB' - - - def loadAccountInfo(self, user, req): - html = req.load("http://megarapid.cz/mujucet/", decode=True) - - m = re.search(self.LIMITDL_PATTERN, html) - if m: - data = self.getAccountData(user) - data['options']['limitDL'] = [int(m.group(1))] - - m = re.search(self.VALID_UNTIL_PATTERN, html) - if m: - validuntil = mktime(strptime(m.group(1), "%d.%m.%Y - %H:%M")) - return {"premium": True, "trafficleft": -1, "validuntil": validuntil} - - m = re.search(self.TRAFFIC_LEFT_PATTERN, html) - if m: - trafficleft = float(m.group(1)) * (1 << 20) - return {"premium": True, "trafficleft": trafficleft, "validuntil": -1} - - return {"premium": False, "trafficleft": None, "validuntil": None} - - - def login(self, user, data, req): - htm = req.load("http://megarapid.cz/prihlaseni/") - if "Heslo:" in htm: - start = htm.index('id="inp_hash" name="hash" value="') - htm = htm[start + 33:] - hashes = htm[0:32] - htm = req.load("http://megarapid.cz/prihlaseni/", - post={"hash": hashes, - "login": user, - "pass1": data['password'], - "remember": 0, - "sbmt": u"Přihlásit"}) diff --git a/module/plugins/accounts/NowVideoAt.py b/module/plugins/accounts/NowVideoAt.py deleted file mode 100644 index 234984b6b..000000000 --- a/module/plugins/accounts/NowVideoAt.py +++ /dev/null @@ -1,56 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from time import gmtime, mktime, strptime - -from module.plugins.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/module/plugins/accounts/RapidfileshareNet.py b/module/plugins/accounts/RapidfileshareNet.py deleted file mode 100644 index c0dd7eaee..000000000 --- a/module/plugins/accounts/RapidfileshareNet.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.XFSAccount import XFSAccount - - -class RapidfileshareNet(XFSAccount): - __name__ = "RapidfileshareNet" - __type__ = "account" - __version__ = "0.05" - - __description__ = """Rapidfileshare.net account plugin""" - __license__ = "GPLv3" - __authors__ = [("guidobelix", "guidobelix@hotmail.it")] - - - HOSTER_DOMAIN = "rapidfileshare.net" - - TRAFFIC_LEFT_PATTERN = r'>Traffic available today:
    .*?bgcolor="#EFEFEF">(?P.*?)', flags=re.I | re.S) - PATTERN_DL_LINK_PAGE = re.compile(r'"(dl_links_\d+_\d+\.html)"', flags=re.I) - PATTERN_REDIRECT_LINKS = re.compile(r'value="(http://sexuria\.com/out\.php\?id=\d+\&part=\d+\&link=\d+)" readonly', flags=re.I) - - - def decrypt(self, pyfile): - # Init - self.pyfile = pyfile - self.package = pyfile.package() - - # Get package links - package_name, self.links, folder_name, package_pwd = self.decryptLinks(self.pyfile.url) - self.packages = [(package_name, self.links, folder_name)] - - - def decryptLinks(self, url): - linklist = [] - name = self.package.name - folder = self.package.folder - password = None - - if re.match(self.PATTERN_SUPPORTED_MAIN, url): - # Processing main page - html = self.load(url) - links = re.findall(self.PATTERN_DL_LINK_PAGE, html) - for link in links: - linklist.append("http://sexuria.com/v1/" + link) - - elif re.match(self.PATTERN_SUPPORTED_REDIRECT, url): - # Processing direct redirect link (out.php), redirecting to main page - id = re.search(self.PATTERN_SUPPORTED_REDIRECT, url).group('ID') - if id: - linklist.append("http://sexuria.com/v1/Pornos_Kostenlos_liebe_%s.html" % id) - - elif re.match(self.PATTERN_SUPPORTED_CRYPT, url): - # Extract info from main file - id = re.search(self.PATTERN_SUPPORTED_CRYPT, url).group('ID') - html = self.load("http://sexuria.com/v1/Pornos_Kostenlos_info_%s.html" % id, decode=True) - - title = re.search(self.PATTERN_TITLE, html).group('TITLE').strip() - if title: - name = folder = title - self.logDebug("Package info found, name [%s] and folder [%s]" % (name, folder)) - - pwd = re.search(self.PATTERN_PASSWORD, html).group('PWD') - if pwd: - password = pwd.strip() - self.logDebug("Password info [%s] found" % password) - - # Process link (dl_link) - html = self.load(url) - links = re.findall(self.PATTERN_REDIRECT_LINKS, html) - if len(links) == 0: - self.LogError("Broken for link %s" % link) - else: - for link in links: - link = link.replace("http://sexuria.com/", "http://www.sexuria.com/") - finallink = self.load(link, just_header=True)['location'] - if not finallink or "sexuria.com/" in finallink: - self.LogError("Broken for link %s" % link) - else: - linklist.append(finallink) - - # Debug log - self.logDebug("%d supported links" % len(linklist)) - for i, link in enumerate(linklist): - self.logDebug("Supported link %d, %s" % (i + 1, link)) - - return name, linklist, folder, password diff --git a/module/plugins/crypter/SharingmatrixComFolder.py b/module/plugins/crypter/SharingmatrixComFolder.py deleted file mode 100644 index ddc3bdb37..000000000 --- a/module/plugins/crypter/SharingmatrixComFolder.py +++ /dev/null @@ -1,15 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.DeadCrypter import DeadCrypter - - -class SharingmatrixComFolder(DeadCrypter): - __name__ = "SharingmatrixComFolder" - __type__ = "crypter" - __version__ = "0.01" - - __pattern__ = r'http://(?:www\.)?sharingmatrix\.com/folder/\w+' - - __description__ = """Sharingmatrix.com folder decrypter plugin""" - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] diff --git a/module/plugins/crypter/WuploadComFolder.py b/module/plugins/crypter/WuploadComFolder.py deleted file mode 100644 index b77bc3e67..000000000 --- a/module/plugins/crypter/WuploadComFolder.py +++ /dev/null @@ -1,15 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.DeadCrypter import DeadCrypter - - -class WuploadComFolder(DeadCrypter): - __name__ = "WuploadComFolder" - __type__ = "crypter" - __version__ = "0.01" - - __pattern__ = r'http://(?:www\.)?wupload\.com/folder/\w+' - - __description__ = """Wupload.com folder decrypter plugin""" - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] diff --git a/module/plugins/crypter/XFileSharingProFolder.py b/module/plugins/crypter/XFileSharingProFolder.py deleted file mode 100644 index dffd8909c..000000000 --- a/module/plugins/crypter/XFileSharingProFolder.py +++ /dev/null @@ -1,47 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from module.plugins.internal.XFSCrypter import XFSCrypter - - -class XFileSharingProFolder(XFSCrypter): - __name__ = "XFileSharingProFolder" - __type__ = "crypter" - __version__ = "0.03" - - __pattern__ = r'^unmatchable$' - __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), - ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] - - __description__ = """XFileSharingPro dummy folder decrypter plugin for hook""" - __license__ = "GPLv3" - __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - - - def _log(self, type, args): - msg = " | ".join([str(a).strip() for a in args if a]) - logger = getattr(self.log, type) - logger("%s: %s: %s" % (self.__name__, self.HOSTER_NAME, msg or _("%s MARK" % type.upper()))) - - - def init(self): - super(XFileSharingProFolder, self).init() - - self.__pattern__ = self.core.pluginManager.crypterPlugins[self.__name__]['pattern'] - - self.HOSTER_DOMAIN = re.match(self.__pattern__, self.pyfile.url).group(1).lower() - self.HOSTER_NAME = "".join([str.capitalize() for str in self.HOSTER_DOMAIN.split('.')]) - - account = self.core.accountManager.getAccountPlugin(self.HOSTER_NAME) - - if account and account.canUse(): - self.account = account - elif self.account: - self.account.HOSTER_DOMAIN = self.HOSTER_DOMAIN - else: - return - - self.user, data = self.account.selectAccount() - self.req = self.account.getAccountRequest(self.user) - self.premium = self.account.isPremium(self.user) diff --git a/module/plugins/hoster/EnteruploadCom.py b/module/plugins/hoster/EnteruploadCom.py deleted file mode 100644 index bbd613f57..000000000 --- a/module/plugins/hoster/EnteruploadCom.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo - - -class EnteruploadCom(DeadHoster): - __name__ = "EnteruploadCom" - __type__ = "hoster" - __version__ = "0.02" - - __pattern__ = r'http://(?:www\.)?enterupload\.com/\w+' - - __description__ = """EnterUpload.com hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - - -getInfo = create_getInfo(EnteruploadCom) diff --git a/module/plugins/hoster/FileSharkPl.py b/module/plugins/hoster/FileSharkPl.py deleted file mode 100644 index 5a9cbb456..000000000 --- a/module/plugins/hoster/FileSharkPl.py +++ /dev/null @@ -1,137 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from urlparse import urljoin - -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo - - -class FileSharkPl(SimpleHoster): - __name__ = "FileSharkPl" - __type__ = "hoster" - __version__ = "0.01" - - __pattern__ = r'http://(?:www\.)?fileshark\.pl/pobierz/\d{6}/\w{5}' - - __description__ = """FileShark.pl hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("prOq", None), - ("Walter Purcaro", "vuolter@gmail.com")] - - - NAME_PATTERN = r'

    (?P.+)

    ' - SIZE_PATTERN = r'

    (.*?)(?P\d+\.?\d*)\s(?P\w+)

    ' - - OFFLINE_PATTERN = '(P|p)lik zosta. (usuni.ty|przeniesiony)' - - DOWNLOAD_ALERT = r'

    (.*?)

    ' - IP_BLOCKED_PATTERN = 'Strona jest dost.pna wy..cznie dla u.ytkownik.w znajduj.cych si. na terenie Polski' - DOWNLOAD_SLOTS_ERROR_PATTERN = r'Osi.gni.to maksymaln. liczb. .ci.ganych jednocze.nie plik.w\.' - - DOWNLOAD_URL_FREE = r'
    ' - DOWNLOAD_URL_PREMIUM = r'' - - SECONDS_PATTERN = r'var timeToDownload = (\d+);' - - CAPTCHA_IMG_PATTERN = '' - - - def setup(self): - self.resumeDownload = True - if self.premium: - self.multiDL = True - self.limitDL = 20 - else: - self.multiDL = False - - - def prepare(self): - super(FileSharkPl, self).prepare() - - m = re.search(self.DOWNLOAD_ALERT, self.html): - if m: - return - - alert = m.group(1) - - if re.match(self.IP_BLOCKED_PATTERN, alert): - self.fail(_("Only connections from Polish IP are allowed")) - elif re.match(self.DOWNLOAD_SLOTS_ERROR_PATTERN, alert): - self.logInfo(_("No free download slots available")) - self.retry(10, 30 * 60, _("Still no free download slots available")) - else: - self.logInfo(alert) - self.retry(10, 10 * 60, _("Try again later")) - - - #@NOTE: handlePremium method was never been tested - def handlePremium(self): - self.logDebug("Premium accounts support in experimental modus!") - m = re.search(self.DOWNLOAD_URL_PREMIUM, self.html) - file_url = urljoin("http://fileshark.pl", m.group(1)) - - self.download(file_url, disposition=True) - self.checkDownload() - - - def handleFree(self): - m = re.search(self.DOWNLOAD_URL_FREE, self.html) - if m is None: - self.error(_("Download url not found")) - - file_url = urljoin("http://fileshark.pl", m.group(1)) - - m = re.search(self.SECONDS_PATTERN, self.html) - if m: - seconds = int(m.group(1)) - self.logDebug("Wait %s seconds" % seconds) - self.wait(seconds + 2) - - action, inputs = self.parseHtmlForm('action=""') - m = re.search(self.CAPTCHA_TOKEN_PATTERN, self.html) - if m is None: - self.retry(reason=_("Captcha form not found")) - - inputs['form[_token]'] = m.group(1) - - m = re.search(self.CAPTCHA_IMG_PATTERN, self.html) - if m is None: - self.retry(reason=_("Captcha image not found")) - - tmp_load = self.load - self.load = self.decode64 #: injects decode64 inside decryptCaptcha - - inputs['form[captcha]'] = self.decryptCaptcha(m.group(1), imgtype='jpeg') - inputs['form[start]'] = "" - - self.load = tmp_load - - self.download(file_url, post=inputs, cookies=True, disposition=True) - self.checkDownload() - - - def checkDownload(self): - check = super(FileSharkPl, self).checkDownload({ - 'wrong_captcha': re.compile(r''), - 'wait_pattern': re.compile(self.SECONDS_PATTERN), - 'DL-found': re.compile('') - }) - - if check == "DL-found": - self.correctCaptcha() - - elif check == "wrong_captcha": - self.invalidCaptcha() - self.retry(10, 1, _("Wrong captcha solution")) - - elif check == "wait_pattern": - self.retry() - - - def decode64(self, data, *args, **kwargs): - return data.decode("base64") - - -getInfo = create_getInfo(FileSharkPl) diff --git a/module/plugins/hoster/FilesonicCom.py b/module/plugins/hoster/FilesonicCom.py deleted file mode 100644 index 8bfa0fa2e..000000000 --- a/module/plugins/hoster/FilesonicCom.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo - - -class FilesonicCom(DeadHoster): - __name__ = "FilesonicCom" - __type__ = "hoster" - __version__ = "0.35" - - __pattern__ = r'http://(?:www\.)?filesonic\.com/file/\w+' - - __description__ = """Filesonic.com hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("jeix", "jeix@hasnomail.de"), - ("paulking", None)] - - -getInfo = create_getInfo(FilesonicCom) diff --git a/module/plugins/hoster/JunocloudMe.py b/module/plugins/hoster/JunocloudMe.py deleted file mode 100644 index 0f839960a..000000000 --- a/module/plugins/hoster/JunocloudMe.py +++ /dev/null @@ -1,29 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo - - -class JunocloudMe(XFSHoster): - __name__ = "JunocloudMe" - __type__ = "hoster" - __version__ = "0.03" - - __pattern__ = r'http://(?:\w+\.)?junocloud\.me/\w{12}' - - __description__ = """Junocloud.me hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("guidobelix", "guidobelix@hotmail.it")] - - - HOSTER_DOMAIN = "junocloud.me" - - URL_REPLACEMENTS = [(r'/(?:embed-)?(\w{12}).*', r'/\1'), (r'//www\.', "//dl3.")] - - NAME_PATTERN = r'

    http://junocloud.me/w{12}/(?P.+?)

    ' - SIZE_PATTERN = r'

    Size: (?P[\d.,]+) (?P[\w^_]+)

    ' - - OFFLINE_PATTERN = r'>No such file with this filename<' - TEMP_OFFLINE_PATTERN = r'The page may have been renamed, removed or be temporarily unavailable.<' - - -getInfo = create_getInfo(JunocloudMe) diff --git a/module/plugins/hoster/Keep2shareCc.py b/module/plugins/hoster/Keep2shareCc.py deleted file mode 100644 index fd8a5524d..000000000 --- a/module/plugins/hoster/Keep2shareCc.py +++ /dev/null @@ -1,118 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from urlparse import urlparse, urljoin - -from module.plugins.internal.CaptchaService import ReCaptcha -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo - - -class Keep2shareCc(SimpleHoster): - __name__ = "Keep2shareCc" - __type__ = "hoster" - __version__ = "0.15" - - __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")] - - - 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' - - LINK_PATTERN = r'To download this file with slow speed, use
    this link' - CAPTCHA_PATTERN = r'src="(/file/captcha\.html.+?)"' - WAIT_PATTERN = r'Please wait ([\d:]+) to download this file' - MULTIDL_ERROR = r'Free account does not allow to download more than one file at the same time' - - - def handleFree(self): - self.sanitize_url() - self.html = self.load(self.pyfile.url) - - self.fid = re.search(r'', self.html).group(1) - self.html = self.load(self.pyfile.url, post={'yt0': '', 'slow_id': self.fid}) - - if ">Downloading is not possible" in self.html: - self.fail("Free user can't download large files") - - m = re.search(r"function download\(\){.*window\.location\.href = '([^']+)';", self.html, re.S) - if m: # Direct mode - self.startDownload(m.group(1)) - else: - self.handleCaptcha() - - self.wait(30) - - self.html = self.load(self.pyfile.url, post={'uniqueId': self.fid, 'free': 1}) - - 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.wait(wait_time, True) - self.retry() - - m = re.search(self.MULTIDL_ERROR, self.html) - if m: - # if someone is already downloading on our line, wait 30min and retry - self.logDebug("Already downloading, waiting for 30 minutes") - self.wait(30 * 60, True) - self.retry() - - m = re.search(self.LINK_PATTERN, self.html) - if m is None: - self.error(_("LINK_PATTERN not found")) - self.startDownload(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_url, 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 startDownload(self, url): - d = urljoin(self.base_url, url) - self.download(d, disposition=True) - - - def sanitize_url(self): - header = self.load(self.pyfile.url, just_header=True) - if 'location' in header: - self.pyfile.url = header['location'] - p = urlparse(self.pyfile.url) - self.base_url = "%s://%s" % (p.scheme, p.hostname) - - -getInfo = create_getInfo(Keep2shareCc) diff --git a/module/plugins/hoster/KickloadCom.py b/module/plugins/hoster/KickloadCom.py deleted file mode 100644 index 1c39db46c..000000000 --- a/module/plugins/hoster/KickloadCom.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo - - -class KickloadCom(DeadHoster): - __name__ = "KickloadCom" - __type__ = "hoster" - __version__ = "0.21" - - __pattern__ = r'http://(?:www\.)?kickload\.com/get/.+' - - __description__ = """Kickload.com hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("mkaay", "mkaay@mkaay.de")] - - -getInfo = create_getInfo(KickloadCom) diff --git a/module/plugins/hoster/MegaCoNz.py b/module/plugins/hoster/MegaCoNz.py deleted file mode 100644 index 2129fbfc8..000000000 --- a/module/plugins/hoster/MegaCoNz.py +++ /dev/null @@ -1,144 +0,0 @@ -# -*- coding: utf-8 -*- - -import random -import re - -from array import array -from base64 import standard_b64decode -from os import remove - -from Crypto.Cipher import AES -from Crypto.Util import Counter -from pycurl import SSL_CIPHER_LIST - -from module.common.json_layer import json_loads, json_dumps -from module.plugins.Hoster import Hoster - - -class MegaCoNz(Hoster): - __name__ = "MegaCoNz" - __type__ = "hoster" - __version__ = "0.16" - - __pattern__ = r'https?://(\w+\.)?mega\.co\.nz/#!([\w!-]+)' - - __description__ = """Mega.co.nz hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("RaNaN", "ranan@pyload.org")] - - - API_URL = "https://g.api.mega.co.nz/cs?id=%d" - FILE_SUFFIX = ".crypted" - - - def b64_decode(self, data): - data = data.replace("-", "+").replace("_", "/") - return standard_b64decode(data + '=' * (-len(data) % 4)) - - - def getCipherKey(self, key): - """ Construct the cipher key from the given data """ - a = array("I", key) - key_array = array("I", [a[0] ^ a[4], a[1] ^ a[5], a[2] ^ a[6], a[3] ^ a[7]]) - return key_array - - - def callApi(self, **kwargs): - """ Dispatch a call to the api, see https://mega.co.nz/#developers """ - # generate a session id, no idea where to obtain elsewhere - uid = random.randint(10 << 9, 10 ** 10) - - res = self.load(self.API_URL % uid, post=json_dumps([kwargs])) - self.logDebug("Api Response: " + res) - return json_loads(res) - - - def decryptAttr(self, data, key): - cbc = AES.new(self.getCipherKey(key), AES.MODE_CBC, "\0" * 16) - attr = cbc.decrypt(self.b64_decode(data)) - self.logDebug("Decrypted Attr: " + attr) - if not attr.startswith("MEGA"): - self.fail(_("Decryption failed")) - - # Data is padded, 0-bytes must be stripped - return json_loads(re.search(r'{.+?}', attr).group(0)) - - - def decryptFile(self, key): - """ Decrypts the file at lastDownload` """ - - # upper 64 bit of counter start - n = key[16:24] - - # convert counter to long and shift bytes - ctr = Counter.new(128, initial_value=long(n.encode("hex"), 16) << 64) - cipher = AES.new(self.getCipherKey(key), AES.MODE_CTR, counter=ctr) - - self.pyfile.setStatus("decrypting") - - file_crypted = self.lastDownload - file_decrypted = file_crypted.rsplit(self.FILE_SUFFIX)[0] - - try: - f = open(file_crypted, "rb") - df = open(file_decrypted, "wb") - except IOError, e: - self.fail(str(e)) - - # TODO: calculate CBC-MAC for checksum - - size = 2 ** 15 # buffer size, 32k - while True: - buf = f.read(size) - if not buf: - break - - df.write(cipher.decrypt(buf)) - - f.close() - df.close() - remove(file_crypted) - - self.lastDownload = file_decrypted - - - def process(self, pyfile): - key = None - - # match is guaranteed because plugin was chosen to handle url - node = re.match(self.__pattern__, pyfile.url).group(2) - if "!" in node: - node, key = node.split("!") - - self.logDebug("File id: %s | Key: %s" % (node, key)) - - if not key: - self.fail(_("No file key provided in the URL")) - - # g is for requesting a download url - # this is similar to the calls in the mega js app, documentation is very bad - dl = self.callApi(a="g", g=1, p=node, ssl=1)[0] - - if "e" in dl: - e = dl['e'] - # ETEMPUNAVAIL (-18): Resource temporarily not available, please try again later - if e == -18: - self.retry() - else: - self.fail(_("Error code:") + e) - - # TODO: map other error codes, e.g - # EACCESS (-11): Access violation (e.g., trying to write to a read-only share) - - key = self.b64_decode(key) - attr = self.decryptAttr(dl['at'], key) - - pyfile.name = attr['n'] + self.FILE_SUFFIX - - self.req.http.c.setopt(SSL_CIPHER_LIST, "RC4-MD5:DEFAULT") - - self.download(dl['g']) - self.decryptFile(key) - - # Everything is finished and final name can be set - pyfile.name = attr['n'] diff --git a/module/plugins/hoster/MegaRapidCz.py b/module/plugins/hoster/MegaRapidCz.py deleted file mode 100644 index b3100b6d4..000000000 --- a/module/plugins/hoster/MegaRapidCz.py +++ /dev/null @@ -1,71 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from pycurl import HTTPHEADER - -from module.network.RequestFactory import getRequest -from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo - - -def getInfo(urls): - h = getRequest() - h.c.setopt(HTTPHEADER, - ["Accept: text/html", - "User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"]) - - for url in urls: - html = h.load(url, decode=True) - yield parseFileInfo(MegaRapidCz, url, html) - - -class MegaRapidCz(SimpleHoster): - __name__ = "MegaRapidCz" - __type__ = "hoster" - __version__ = "0.54" - - __pattern__ = r'http://(?:www\.)?(share|mega)rapid\.cz/soubor/\d+/.+' - - __description__ = """MegaRapid.cz hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("MikyWoW", "mikywow@seznam.cz"), - ("zoidberg", "zoidberg@mujmail.cz"), - ("stickell", "l.stickell@yahoo.it"), - ("Walter Purcaro", "vuolter@gmail.com")] - - - NAME_PATTERN = r']*>]*>(?:]*>)?(?P[^<]+)' - SIZE_PATTERN = r'Velikost:\s*\s*(?P[\d.,]+) (?P[\w^_]+)' - OFFLINE_PATTERN = ur'Nastala chyba 404|Soubor byl smazán' - - FORCE_CHECK_TRAFFIC = True - - LINK_PATTERN = r'([^<]+)' - ERR_LOGIN_PATTERN = ur'
    Stahování je přístupné pouze přihlášeným uživatelům' - ERR_CREDIT_PATTERN = ur'
    Stahování zdarma je možné jen přes náš' - - - def setup(self): - self.chunkLimit = 1 - - - def handlePremium(self): - try: - self.html = self.load(self.pyfile.url, decode=True) - except BadHeader, e: - self.account.relogin(self.user) - self.retry(wait_time=60, reason=str(e)) - - m = re.search(self.LINK_PATTERN, self.html) - if m: - link = m.group(1) - self.logDebug("Premium link: %s" % link) - self.download(link, disposition=True) - else: - if re.search(self.ERR_LOGIN_PATTERN, self.html): - self.relogin(self.user) - self.retry(wait_time=60, reason=_("User login failed")) - elif re.search(self.ERR_CREDIT_PATTERN, self.html): - self.fail(_("Not enough credit left")) - else: - self.fail(_("Download link not found")) diff --git a/module/plugins/hoster/MegauploadCom.py b/module/plugins/hoster/MegauploadCom.py deleted file mode 100644 index 7f51a8a46..000000000 --- a/module/plugins/hoster/MegauploadCom.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo - - -class MegauploadCom(DeadHoster): - __name__ = "MegauploadCom" - __type__ = "hoster" - __version__ = "0.31" - - __pattern__ = r'http://(?:www\.)?megaupload\.com/\?.*&?(d|v)=\w+' - - __description__ = """Megaupload.com hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("spoob", "spoob@pyload.org")] - - -getInfo = create_getInfo(MegauploadCom) diff --git a/module/plugins/hoster/MegavideoCom.py b/module/plugins/hoster/MegavideoCom.py deleted file mode 100644 index 24905ce62..000000000 --- a/module/plugins/hoster/MegavideoCom.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo - - -class MegavideoCom(DeadHoster): - __name__ = "MegavideoCom" - __type__ = "hoster" - __version__ = "0.21" - - __pattern__ = r'http://(?:www\.)?megavideo\.com/\?.*&?(d|v)=\w+' - - __description__ = """Megavideo.com hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("jeix", "jeix@hasnomail.de"), - ("mkaay", "mkaay@mkaay.de")] - - -getInfo = create_getInfo(MegavideoCom) diff --git a/module/plugins/hoster/NahrajCz.py b/module/plugins/hoster/NahrajCz.py deleted file mode 100644 index 6b5699408..000000000 --- a/module/plugins/hoster/NahrajCz.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo - - -class NahrajCz(DeadHoster): - __name__ = "NahrajCz" - __type__ = "hoster" - __version__ = "0.21" - - __pattern__ = r'http://(?:www\.)?nahraj\.cz/content/download/.+' - - __description__ = """Nahraj.cz hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - - -getInfo = create_getInfo(NahrajCz) diff --git a/module/plugins/hoster/NowVideoAt.py b/module/plugins/hoster/NowVideoAt.py deleted file mode 100644 index 53d782d06..000000000 --- a/module/plugins/hoster/NowVideoAt.py +++ /dev/null @@ -1,44 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo - - -class NowVideoAt(SimpleHoster): - __name__ = "NowVideoAt" - __type__ = "hoster" - __version__ = "0.05" - - __pattern__ = r'http://(?:www\.)?nowvideo\.(at|ch|co|eu|sx)/(video|mobile/#/videos)/(?P\w+)' - - __description__ = """NowVideo.at hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - - - URL_REPLACEMENTS = [(__pattern__, r'http://www.nowvideo.at/video/\g')] - - NAME_PATTERN = r'

    (?P.+?)<' - OFFLINE_PATTERN = r'>This file no longer exists' - - LINK_FREE_PATTERN = r'\s*' - SIZE_PATTERN = r'>http://www.rapidfileshare.net/\w+? \((?P[\d.,]+) (?P[\w^_]+)\)' - - OFFLINE_PATTERN = r'>No such file with this filename' - TEMP_OFFLINE_PATTERN = r'The page may have been renamed, removed or be temporarily unavailable.<' - - - def handlePremium(self): - self.fail(_("Premium download not implemented")) - - -getInfo = create_getInfo(RapidfileshareNet) diff --git a/module/plugins/hoster/SharingmatrixCom.py b/module/plugins/hoster/SharingmatrixCom.py deleted file mode 100644 index fa08a4a8f..000000000 --- a/module/plugins/hoster/SharingmatrixCom.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo - - -class SharingmatrixCom(DeadHoster): - __name__ = "SharingmatrixCom" - __type__ = "hoster" - __version__ = "0.01" - - __pattern__ = r'http://(?:www\.)?sharingmatrix\.com/file/\w+' - - __description__ = """Sharingmatrix.com hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("jeix", "jeix@hasnomail.de"), - ("paulking", None)] - - -getInfo = create_getInfo(SharingmatrixCom) diff --git a/module/plugins/hoster/StorageTo.py b/module/plugins/hoster/StorageTo.py deleted file mode 100644 index bedc2934f..000000000 --- a/module/plugins/hoster/StorageTo.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo - - -class StorageTo(DeadHoster): - __name__ = "StorageTo" - __type__ = "hoster" - __version__ = "0.01" - - __pattern__ = r'http://(?:www\.)?storage\.to/get/.+' - - __description__ = """Storage.to hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("mkaay", "mkaay@mkaay.de")] - - -getInfo = create_getInfo(StorageTo) diff --git a/module/plugins/hoster/UpleaCom.py b/module/plugins/hoster/UpleaCom.py deleted file mode 100644 index 409d7b4ca..000000000 --- a/module/plugins/hoster/UpleaCom.py +++ /dev/null @@ -1,60 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from urlparse import urljoin - -from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo - - -class UpleaCom(XFSHoster): - __name__ = "UpleaCom" - __type__ = "hoster" - __version__ = "0.04" - - __pattern__ = r'https?://(?:www\.)?uplea\.com/dl/\w{15}' - - __description__ = """Uplea.com hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("Redleon", None)] - - - HOSTER_DOMAIN = "uplea.com" - - NAME_PATTERN = r'class="agmd size18">(?P.+?)<' - SIZE_PATTERN = r'size14">(?P[\d.,]+) (?P[\w^_])' - - OFFLINE_PATTERN = r'>You followed an invalid or expired link' - - LINK_PATTERN = r'"(http?://\w+\.uplea\.com/anonym/.*?)"' - WAIT_PATTERN = r'timeText:([\d.]+),' - VARS_PATTERN = r'class="cel_tbl_step1_foot">\s' - - - def setup(self): - self.multiDL = False - self.chunkLimit = 1 - self.resumeDownload = True - - - def handleFree(self): - m = re.search(self.VARS_PATTERN, self.html) - if m is None: - self.error("VARS_PATTERN not found") - - self.html = self.load(urljoin("http://uplea.com/", m.groups(1))) - - m = re.search(self.WAIT_PATTERN, self.html) - if m: - self.wait(m.group(1), True) - self.retry() - - m = re.search(self.LINK_PATTERN, self.html) - if m is None: - self.error("LINK_PATTERN not found") - - self.wait(15) - self.download(m.group(1), disposition=True) - - -getInfo = create_getInfo(UpleaCom) diff --git a/module/plugins/hoster/UploadboxCom.py b/module/plugins/hoster/UploadboxCom.py deleted file mode 100644 index 031c5f761..000000000 --- a/module/plugins/hoster/UploadboxCom.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo - - -class UploadboxCom(DeadHoster): - __name__ = "Uploadbox" - __type__ = "hoster" - __version__ = "0.05" - - __pattern__ = r'http://(?:www\.)?uploadbox\.com/files/.+' - - __description__ = """UploadBox.com hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - - -getInfo = create_getInfo(UploadboxCom) diff --git a/module/plugins/hoster/UploadhereCom.py b/module/plugins/hoster/UploadhereCom.py deleted file mode 100644 index 8da30be46..000000000 --- a/module/plugins/hoster/UploadhereCom.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo - - -class UploadhereCom(DeadHoster): - __name__ = "UploadhereCom" - __type__ = "hoster" - __version__ = "0.12" - - __pattern__ = r'http://(?:www\.)?uploadhere\.com/\w{10}' - - __description__ = """Uploadhere.com hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - - -getInfo = create_getInfo(UploadhereCom) diff --git a/module/plugins/hoster/UploadkingCom.py b/module/plugins/hoster/UploadkingCom.py deleted file mode 100644 index 743e700eb..000000000 --- a/module/plugins/hoster/UploadkingCom.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo - - -class UploadkingCom(DeadHoster): - __name__ = "UploadkingCom" - __type__ = "hoster" - __version__ = "0.14" - - __pattern__ = r'http://(?:www\.)?uploadking\.com/\w{10}' - - __description__ = """UploadKing.com hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - - -getInfo = create_getInfo(UploadkingCom) diff --git a/module/plugins/internal/CaptchaService.py b/module/plugins/internal/CaptchaService.py deleted file mode 100644 index 38775f519..000000000 --- a/module/plugins/internal/CaptchaService.py +++ /dev/null @@ -1,209 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from random import random - - -class CaptchaService: - __name__ = "CaptchaService" - __version__ = "0.14" - - __description__ = """Base captcha service plugin""" - __license__ = "GPLv3" - __authors__ = [("pyLoad Team", "admin@pyload.org")] - - - KEY_PATTERN = None - - key = None #: last key detected - - - def __init__(self, plugin): - self.plugin = plugin - - - def detect_key(self, html=None): - if not html: - if hasattr(self.plugin, "html") and self.plugin.html: - html = self.plugin.html - else: - errmsg = _("%s html not found") % self.__name__ - self.plugin.fail(errmsg) #@TODO: replace all plugin.fail(errmsg) with plugin.error(errmsg) in 0.4.10 - raise TypeError(errmsg) - - m = re.search(self.KEY_PATTERN, html) - if m: - self.key = m.group("KEY") - self.plugin.logDebug("%s key: %s" % (self.__name__, self.key)) - return self.key - else: - self.plugin.logDebug("%s key not found" % self.__name__) - return None - - - def challenge(self, key=None): - raise NotImplementedError - - - def result(self, server, challenge): - raise NotImplementedError - - -class ReCaptcha(CaptchaService): - __name__ = "ReCaptcha" - __version__ = "0.07" - - __description__ = """ReCaptcha captcha service plugin""" - __license__ = "GPLv3" - __authors__ = [("pyLoad Team", "admin@pyload.org")] - - - KEY_PATTERN = r'recaptcha(/api|\.net)/(challenge|noscript)\?k=(?P[\w-]+)' - KEY_AJAX_PATTERN = r'Recaptcha\.create\s*\(\s*["\'](?P[\w-]+)' - - - def detect_key(self, html=None): - if not html: - if hasattr(self.plugin, "html") and self.plugin.html: - html = self.plugin.html - else: - errmsg = _("ReCaptcha html not found") - self.plugin.fail(errmsg) - raise TypeError(errmsg) - - m = re.search(self.KEY_PATTERN, html) or re.search(self.KEY_AJAX_PATTERN, html) - if m: - self.key = m.group("KEY") - self.plugin.logDebug("ReCaptcha key: %s" % self.key) - return self.key - else: - self.plugin.logDebug("ReCaptcha key not found") - return None - - - def challenge(self, key=None): - if not key: - if self.detect_key(): - key = self.key - else: - errmsg = _("ReCaptcha key not found") - self.plugin.fail(errmsg) - raise TypeError(errmsg) - - js = self.plugin.req.load("http://www.google.com/recaptcha/api/challenge", get={'k': key}) - - try: - challenge = re.search("challenge : '(.+?)',", js).group(1) - server = re.search("server : '(.+?)',", js).group(1) - except: - self.plugin.error("ReCaptcha challenge pattern not found") - - result = self.result(server, challenge) - - return challenge, result - - - def result(self, server, challenge): - return self.plugin.decryptCaptcha("%simage" % server, get={'c': challenge}, - cookies=True, forceUser=True, imgtype="jpg") - - -class AdsCaptcha(CaptchaService): - __name__ = "AdsCaptcha" - __version__ = "0.04" - - __description__ = """AdsCaptcha captcha service plugin""" - __license__ = "GPLv3" - __authors__ = [("pyLoad Team", "admin@pyload.org")] - - - ID_PATTERN = r'api\.adscaptcha\.com/Get\.aspx\?[^"\']*CaptchaId=(?P\d+)' - KEY_PATTERN = r'api\.adscaptcha\.com/Get\.aspx\?[^"\']*PublicKey=(?P[\w-]+)' - - - def detect_key(self, html=None): - if not html: - if hasattr(self.plugin, "html") and self.plugin.html: - html = self.plugin.html - else: - errmsg = _("AdsCaptcha html not found") - self.plugin.fail(errmsg) - raise TypeError(errmsg) - - m = re.search(self.ID_PATTERN, html) - n = re.search(self.KEY_PATTERN, html) - if m and n: - self.key = (m.group("ID"), m.group("KEY")) - self.plugin.logDebug("AdsCaptcha id|key: %s | %s" % self.key) - return self.key - else: - self.plugin.logDebug("AdsCaptcha id or key not found") - return None - - - def challenge(self, key=None): #: key is a tuple(CaptchaId, PublicKey) - if not key: - if self.detect_key(): - key = self.key - else: - errmsg = _("AdsCaptcha key not found") - self.plugin.fail(errmsg) - raise TypeError(errmsg) - - CaptchaId, PublicKey = key - - js = self.plugin.req.load("http://api.adscaptcha.com/Get.aspx", get={'CaptchaId': CaptchaId, 'PublicKey': PublicKey}) - - try: - challenge = re.search("challenge: '(.+?)',", js).group(1) - server = re.search("server: '(.+?)',", js).group(1) - except: - self.plugin.error("AdsCaptcha challenge pattern not found") - - result = self.result(server, challenge) - - return challenge, result - - - def result(self, server, challenge): - return self.plugin.decryptCaptcha("%sChallenge.aspx" % server, get={'cid': challenge, 'dummy': random()}, - cookies=True, imgtype="jpg") - - -class SolveMedia(CaptchaService): - __name__ = "SolveMedia" - __version__ = "0.05" - - __description__ = """SolveMedia captcha service plugin""" - __license__ = "GPLv3" - __authors__ = [("pyLoad Team", "admin@pyload.org")] - - - KEY_PATTERN = r'api\.solvemedia\.com/papi/challenge\.(no)?script\?k=(?P.+?)["\']' - - - def challenge(self, key=None): - if not key: - if self.detect_key(): - key = self.key - else: - errmsg = _("SolveMedia key not found") - self.plugin.fail(errmsg) - raise TypeError(errmsg) - - html = self.plugin.req.load("http://api.solvemedia.com/papi/challenge.noscript", get={'k': key}) - try: - challenge = re.search(r'', - html).group(1) - server = "http://api.solvemedia.com/papi/media" - except: - self.plugin.error("SolveMedia challenge pattern not found") - - result = self.result(server, challenge) - - return challenge, result - - - def result(self, server, challenge): - return self.plugin.decryptCaptcha(server, get={'c': challenge}, imgtype="gif") diff --git a/module/plugins/internal/XFSAccount.py b/module/plugins/internal/XFSAccount.py deleted file mode 100644 index ba2c00ec9..000000000 --- a/module/plugins/internal/XFSAccount.py +++ /dev/null @@ -1,122 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from time import gmtime, mktime, strptime -from urlparse import urljoin - -from module.plugins.Account import Account -from module.plugins.internal.SimpleHoster import parseHtmlForm, set_cookies - - -class XFSAccount(Account): - __name__ = "XFSAccount" - __type__ = "account" - __version__ = "0.25" - - __description__ = """XFileSharing account plugin""" - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), - ("Walter Purcaro", "vuolter@gmail.com")] - - - HOSTER_DOMAIN = None - HOSTER_URL = None - - COOKIES = [(HOSTER_DOMAIN, "lang", "english")] - - PREMIUM_PATTERN = r'\(Premium only\)' - - VALID_UNTIL_PATTERN = r'>Premium.[Aa]ccount expire:.*?(\d{1,2} [\w^_]+ \d{4})' - - TRAFFIC_LEFT_PATTERN = r'>Traffic available today:.*?\s*(?P[\d.,]+|[Uu]nlimited)\s*(?:(?P[\w^_]+)\s*)?' - TRAFFIC_LEFT_UNIT = "MB" #: used only if no group was found - - LOGIN_FAIL_PATTERN = r'>(Incorrect Login or Password|Error<)' - - - def __init__(self, manager, accounts): #@TODO: remove in 0.4.10 - self.init() - return super(XFSAccount, self).__init__(manager, accounts) - - - def init(self): - # if not self.HOSTER_DOMAIN: - # self.fail(_("Missing HOSTER_DOMAIN")) - - if not self.HOSTER_URL: - self.HOSTER_URL = "http://www.%s/" % self.HOSTER_DOMAIN - - - def loadAccountInfo(self, user, req): - validuntil = None - trafficleft = None - premium = None - - html = req.load(self.HOSTER_URL, get={'op': "my_account"}, decode=True) - - premium = True if re.search(self.PREMIUM_PATTERN, html) else False - - 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, "%d %B %Y")) - - except Exception, e: - self.logError(e) - - else: - if validuntil > mktime(gmtime()): - premium = True - else: - premium = False - validuntil = None #: registered account type (not premium) - - m = re.search(self.TRAFFIC_LEFT_PATTERN, html) - if m: - try: - traffic = m.groupdict() - size = traffic['S'] - - if "nlimited" in size: - trafficleft = -1 - if validuntil is None: - validuntil = -1 - else: - if 'U' in traffic: - unit = traffic['U'] - elif isinstance(self.TRAFFIC_LEFT_UNIT, basestring): - unit = self.TRAFFIC_LEFT_UNIT - else: - unit = "" - - trafficleft = self.parseTraffic(size + unit) - - except Exception, e: - self.logError(e) - - return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium} - - - def login(self, user, data, req): - if isinstance(self.COOKIES, list): - set_cookies(req.cj, self.COOKIES) - - url = urljoin(self.HOSTER_URL, "login.html") - html = req.load(url, decode=True) - - action, inputs = parseHtmlForm('name="FL"', html) - if not inputs: - inputs = {'op': "login", - 'redirect': self.HOSTER_URL} - - inputs.update({'login': user, - 'password': data['password']}) - - html = req.load(self.HOSTER_URL, post=inputs, decode=True) - - if re.search(self.LOGIN_FAIL_PATTERN, html): - self.wrongPassword() diff --git a/module/plugins/internal/XFSCrypter.py b/module/plugins/internal/XFSCrypter.py deleted file mode 100644 index 62fd8c017..000000000 --- a/module/plugins/internal/XFSCrypter.py +++ /dev/null @@ -1,29 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.SimpleCrypter import SimpleCrypter - - -class XFSCrypter(SimpleCrypter): - __name__ = "XFSCrypter" - __type__ = "crypter" - __version__ = "0.04" - - __pattern__ = r'^unmatchable$' - - __description__ = """XFileSharing decrypter plugin""" - __license__ = "GPLv3" - __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - - - HOSTER_DOMAIN = None - HOSTER_NAME = None - - URL_REPLACEMENTS = [(r'&?per_page=\d+', ""), (r'[?/&]+$', ""), (r'(.+/[^?]+)$', r'\1?'), (r'$', r'&per_page=10000')] - - COOKIES = [(HOSTER_DOMAIN, "lang", "english")] - - LINK_PATTERN = r'<(?:td|TD).*?>\s*.+?(?:)?\s*' - NAME_PATTERN = r'<[tT]itle>.*?\: (?P.+) folder' - - OFFLINE_PATTERN = r'>\s*\w+ (Not Found|file (was|has been) removed)' - TEMP_OFFLINE_PATTERN = r'>\s*\w+ server (is in )?(maintenance|maintainance)' diff --git a/module/plugins/internal/XFSHoster.py b/module/plugins/internal/XFSHoster.py deleted file mode 100644 index f54bb5e45..000000000 --- a/module/plugins/internal/XFSHoster.py +++ /dev/null @@ -1,345 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from random import random -from time import sleep - -from pycurl import FOLLOWLOCATION, LOW_SPEED_TIME - -from module.plugins.hoster.UnrestrictLi import secondsToMidnight -from module.plugins.internal.CaptchaService import ReCaptcha, SolveMedia -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo -from module.utils import html_unescape - - -class XFSHoster(SimpleHoster): - __name__ = "XFSHoster" - __type__ = "hoster" - __version__ = "0.15" - - __pattern__ = r'^unmatchable$' - - __description__ = """XFileSharing hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), - ("stickell", "l.stickell@yahoo.it"), - ("Walter Purcaro", "vuolter@gmail.com")] - - - HOSTER_DOMAIN = None - HOSTER_NAME = None - - URL_REPLACEMENTS = [(r'/(?:embed-)?(\w{12}).*', r'/\1')] #: plus support embedded files - - COOKIES = [(HOSTER_DOMAIN, "lang", "english")] - - INFO_PATTERN = r'Filename:(?P[^<]+)\s*.*?\((?P[^<]+)\)' - NAME_PATTERN = r'[\d.,]+) ?(?P[\w^_]+)?\)' - - OFFLINE_PATTERN = r'>\s*\w+ (Not Found|file (was|has been) removed)' - TEMP_OFFLINE_PATTERN = r'>\s*\w+ server (is in )?(maintenance|maintainance)' - - WAIT_PATTERN = r'.*?>(\d+)' - - OVR_LINK_PATTERN = r'

    Download Link

    \s*]*>([^<]+)' - LINK_PATTERN = None #: final download url pattern - - CAPTCHA_PATTERN = r'(http://[^"\']+?/captchas?/[^"\']+)' - CAPTCHA_DIV_PATTERN = r'>Enter code.*?(.+?)

    ' - RECAPTCHA_PATTERN = None - SOLVEMEDIA_PATTERN = None - - ERROR_PATTERN = r'(?:class=["\']err["\'][^>]*>|<[Cc]enter>)(.+?)(?:["\']|\(ERROR:(.+?)\)' - - - def setup(self): - self.chunkLimit = 1 - self.resumeDownload = self.multiDL = self.premium - - - def prepare(self): - """ Initialize important variables """ - if not self.HOSTER_DOMAIN: - self.fail(_("Missing HOSTER_DOMAIN")) - - if not self.HOSTER_NAME: - self.HOSTER_NAME = "".join([str.capitalize() for str in self.HOSTER_DOMAIN.split('.')]) - - if not self.LINK_PATTERN: - pattern = r'(https?://(www\.)?([^/]*?%s|\d+\.\d+\.\d+\.\d+)(\:\d+)?(/d/|(/files)?/\d+/\w+/).+?)["\'<]' - self.LINK_PATTERN = pattern % self.HOSTER_DOMAIN.replace('.', '\.') - - self.captcha = None - self.errmsg = None - self.passwords = self.getPassword().splitlines() - - if (self.__pattern__ != self.core.pluginManager.hosterPlugins[self.__name__]['pattern'] - and re.match(self.__pattern__, self.pyfile.url) is None): - self.logInfo(_("Multi hoster detected")) - if self.premium: - self.logDebug(_("Looking for download link...")) - self.handleOverriden() - else: - self.fail(_("Only premium users can use url leech feature")) - - return super(XFSHoster, self).prepare() - - - def handleFree(self): - link = self.getDownloadLink() - - if link: - if self.captcha: - self.correctCaptcha() - - self.download(link, ref=True, cookies=True, disposition=True) - - elif self.errmsg: - if 'captcha' in self.errmsg: - self.fail(_("No valid captcha code entered")) - else: - self.fail(self.errmsg) - - else: - self.fail(_("Download link not found")) - - - def handlePremium(self): - return self.handleFree() - - - def getDownloadLink(self): - for i in xrange(1, 5): - self.logDebug("Getting download link: #%d" % i) - - self.checkErrors() - - m = re.search(self.LINK_PATTERN, self.html, re.S) - if m: - break - - data = self.getPostParameters() - - # sleep(10) - - self.req.http.c.setopt(FOLLOWLOCATION, 0) - - self.html = self.load(self.pyfile.url, post=data, ref=True, decode=True) - self.header = self.req.http.header - - self.req.http.c.setopt(FOLLOWLOCATION, 1) - - m = re.search(r'Location\s*:\s*(.+)', self.header, re.I) - if m: - break - - m = re.search(self.LINK_PATTERN, self.html, re.S) - if m: - break - else: - return - - self.errmsg = None - - return m.group(1).strip() #@TODO: Remove .strip() in 0.4.10 - - - def handleOverriden(self): - #only tested with easybytez.com - self.html = self.load("http://www.%s/" % self.HOSTER_DOMAIN) - - action, inputs = self.parseHtmlForm('') - - upload_id = "%012d" % int(random() * 10 ** 12) - action += upload_id + "&js_on=1&utype=prem&upload_type=url" - - inputs['tos'] = '1' - inputs['url_mass'] = self.pyfile.url - inputs['up1oad_type'] = 'url' - - self.logDebug(action, inputs) - - self.req.setOption("timeout", 600) #: wait for file to upload to easybytez.com - - self.html = self.load(action, post=inputs) - - self.checkErrors() - - action, inputs = self.parseHtmlForm('F1') - if not inputs: - if self.errmsg: - self.retry(reason=self.errmsg) - else: - self.error(_("TEXTAREA F1 not found")) - - self.logDebug(inputs) - - stmsg = inputs['st'] - - if stmsg == 'OK': - self.html = self.load(action, post=inputs) - - elif 'Can not leech file' in stmsg: - self.retry(20, 3 * 60, _("Can not leech file")) - - elif 'today' in stmsg: - self.retry(wait_time=secondsToMidnight(gmt=2), reason=_("You've used all Leech traffic today")) - - else: - self.fail(stmsg) - - #get easybytez.com link for uploaded file - m = re.search(self.OVR_LINK_PATTERN, self.html) - if m is None: - self.error(_("OVR_LINK_PATTERN not found")) - - header = self.load(m.group(1).strip(), just_header=True, decode=True) #@TODO: Remove .strip() in 0.4.10 - if 'location' in header: #: Direct download link - self.download(header['location'], ref=True, cookies=True, disposition=True) - else: - self.fail(_("Download link not found")) - - - def checkErrors(self): - m = re.search(self.ERROR_PATTERN, self.html) - - if m is None: - self.errmsg = None - else: - self.errmsg = m.group(1) - - self.logWarning(re.sub(r"<.*?>", " ", self.errmsg)) - - if 'wait' in self.errmsg: - wait_time = sum([int(v) * {"hour": 3600, "minute": 60, "second": 1}[u] for v, u in - re.findall(r'(\d+)\s*(hour|minute|second)', self.errmsg)]) - self.wait(wait_time, True) - - elif 'captcha' in self.errmsg: - self.invalidCaptcha() - - elif 'premium' in self.errmsg and 'require' in self.errmsg: - self.fail(_("File can be downloaded by premium users only")) - - elif 'limit' in self.errmsg: - if 'days' in self.errmsg: - delay = secondsToMidnight(gmt=2) - retries = 3 - else: - delay = 1 * 60 * 60 - retries = 25 - - self.wait(delay, True) - self.retry(retries, reason=_("Download limit exceeded")) - - elif 'countdown' in self.errmsg or 'Expired' in self.errmsg: - self.retry(reason=_("Link expired")) - - elif 'maintenance' in self.errmsg or 'maintainance' in self.errmsg: - self.tempOffline() - - elif 'download files up to' in self.errmsg: - self.fail(_("File too large for free download")) - - else: - self.retry(wait_time=60, reason=self.errmsg) - - return self.errmsg - - - def getPostParameters(self): - for _i in xrange(3): - if hasattr(self, "FORM_PATTERN"): - action, inputs = self.parseHtmlForm(self.FORM_PATTERN) - else: - action, inputs = self.parseHtmlForm(input_names={"op": re.compile("^download")}) - - if not inputs: - action, inputs = self.parseHtmlForm('F1') - if not inputs: - if self.errmsg: - self.retry(reason=self.errmsg) - else: - self.error(_("TEXTAREA F1 not found")) - - self.logDebug(inputs) - - if 'op' in inputs and inputs['op'] in ("download2", "download3"): - if "password" in inputs: - if self.passwords: - inputs['password'] = self.passwords.pop(0) - else: - self.fail(_("No or invalid passport")) - - if not self.premium: - m = re.search(self.WAIT_PATTERN, self.html) - if m: - wait_time = int(m.group(1)) - self.setWait(wait_time, False) - else: - wait_time = 0 - - self.captcha = self.handleCaptcha(inputs) - - if wait_time: - self.wait() - - return inputs - else: - inputs['referer'] = self.pyfile.url - - if self.premium: - inputs['method_premium'] = "Premium Download" - if 'method_free' in inputs: - del inputs['method_free'] - else: - inputs['method_free'] = "Free Download" - if 'method_premium' in inputs: - del inputs['method_premium'] - - self.html = self.load(self.pyfile.url, post=inputs, ref=True) - else: - self.error(_("FORM: %s") % (inputs['op'] if 'op' in inputs else _("UNKNOWN"))) - - - def handleCaptcha(self, inputs): - m = re.search(self.CAPTCHA_PATTERN, self.html) - if m: - captcha_url = m.group(1) - inputs['code'] = self.decryptCaptcha(captcha_url) - return 1 - - m = re.search(self.CAPTCHA_DIV_PATTERN, self.html, re.S) - if m: - captcha_div = m.group(1) - self.logDebug(captcha_div) - numerals = re.findall(r'(\d)', html_unescape(captcha_div)) - inputs['code'] = "".join([a[1] for a in sorted(numerals, key=lambda num: int(num[0]))]) - self.logDebug("Captcha code: %s" % inputs['code'], numerals) - return 2 - - recaptcha = ReCaptcha(self) - try: - captcha_key = re.search(self.RECAPTCHA_PATTERN, self.html).group(1) - except: - captcha_key = recaptcha.detect_key() - - if captcha_key: - self.logDebug("ReCaptcha key: %s" % captcha_key) - inputs['recaptcha_challenge_field'], inputs['recaptcha_response_field'] = recaptcha.challenge(captcha_key) - return 3 - - solvemedia = SolveMedia(self) - try: - captcha_key = re.search(self.SOLVEMEDIA_PATTERN, self.html).group(1) - except: - captcha_key = solvemedia.detect_key() - - if captcha_key: - self.logDebug("SolveMedia key: %s" % captcha_key) - inputs['adcopy_challenge'], inputs['adcopy_response'] = solvemedia.challenge(captcha_key) - return 4 - - return 0 -- cgit v1.2.3