diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-10-05 13:32:36 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-10-05 13:32:36 +0200 |
commit | d1e2da48ff1158c84bab62aba3e62ff16f24f124 (patch) | |
tree | 14c2b461b84ab1c07ab39fbe3a80aa69c7b4c8ef | |
parent | Fix refs on hook plugins + add missing __init__ files (diff) | |
parent | Remove old Ev0InFetcher hook (diff) | |
download | pyload-d1e2da48ff1158c84bab62aba3e62ff16f24f124.tar.xz |
Merge branch 'stable' into 0.4.10
Conflicts:
module/plugins/internal/CaptchaService.py
pyload/plugins/account/CyberlockerCh.py
pyload/plugins/account/EgoFilesCom.py
pyload/plugins/account/HotfileCom.py
pyload/plugins/crypter/HotfileFolderCom.py
pyload/plugins/crypter/LinkSaveIn.py
pyload/plugins/crypter/OneKhDe.py
pyload/plugins/hoster/EgoFilesCom.py
pyload/plugins/internal/XFSPAccount.py
30 files changed, 128 insertions, 332 deletions
diff --git a/pyload/plugins/account/CramitIn.py b/pyload/plugins/account/CramitIn.py index 5bf7a3141..ee61310ef 100644 --- a/pyload/plugins/account/CramitIn.py +++ b/pyload/plugins/account/CramitIn.py @@ -6,10 +6,10 @@ from pyload.plugins.internal.XFSPAccount import XFSPAccount class CramitIn(XFSPAccount): __name__ = "CramitIn" __type__ = "account" - __version__ = "0.01" + __version__ = "0.02" __description__ = """Cramit.in account plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" - MAIN_PAGE = "http://cramit.in/" + HOSTER_URL = "http://cramit.in/" diff --git a/pyload/plugins/account/CyberlockerCh.py b/pyload/plugins/account/CyberlockerCh.py deleted file mode 100644 index 94cc0d8c4..000000000 --- a/pyload/plugins/account/CyberlockerCh.py +++ /dev/null @@ -1,35 +0,0 @@ -# -*- coding: utf-8 -*- - -from pyload.plugins.internal.XFSPAccount import XFSPAccount -from pyload.plugins.internal.SimpleHoster import parseHtmlForm - - -class CyberlockerCh(XFSPAccount): - __name__ = "CyberlockerCh" - __type__ = "account" - __version__ = "0.01" - - __description__ = """Cyberlocker.ch account plugin""" - __author_name__ = "stickell" - __author_mail__ = "l.stickell@yahoo.it" - - MAIN_PAGE = "http://cyberlocker.ch/" - - - def login(self, user, data, req): - html = req.load(self.MAIN_PAGE + 'login.html', decode=True) - - action, inputs = parseHtmlForm('name="FL"', html) - if not inputs: - inputs = {"op": "login", - "redirect": self.MAIN_PAGE} - - inputs.update({"login": user, - "password": data['password']}) - - # Without this a 403 Forbidden is returned - req.http.lastURL = self.MAIN_PAGE + 'login.html' - html = req.load(self.MAIN_PAGE, post=inputs, decode=True) - - if 'Incorrect Login or Password' in html or '>Error<' in html: - self.wrongPassword() diff --git a/pyload/plugins/account/DropboxCom.py b/pyload/plugins/account/DropboxCom.py index d3078c7f6..15e95d46d 100644 --- a/pyload/plugins/account/DropboxCom.py +++ b/pyload/plugins/account/DropboxCom.py @@ -8,7 +8,7 @@ from pyload.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class DropboxCom(SimpleHoster): __name__ = "DropboxCom" __type__ = "hoster" - __version__ = "0.01" + __version__ = "0.02" __pattern__ = r'https?://(?:www\.)?dropbox\.com/.+' @@ -22,7 +22,7 @@ class DropboxCom(SimpleHoster): OFFLINE_PATTERN = r'<title>Dropbox - (404|Shared link error)<' - SH_COOKIES = [(".dropbox.com", "lang", "en")] + COOKIES = [(".dropbox.com", "lang", "en")] def setup(self): diff --git a/pyload/plugins/account/EgoFilesCom.py b/pyload/plugins/account/EgoFilesCom.py deleted file mode 100644 index 8947d24c7..000000000 --- a/pyload/plugins/account/EgoFilesCom.py +++ /dev/null @@ -1,44 +0,0 @@ -# -*- coding: utf-8 -*- - -import re -import time - -from pyload.plugins.base.Account import Account -from pyload.utils import parseFileSize - - -class EgoFilesCom(Account): - __name__ = "EgoFilesCom" - __type__ = "account" - __version__ = "0.2" - - __description__ = """Egofiles.com account plugin""" - __author_name__ = "stickell" - __author_mail__ = "l.stickell@yahoo.it" - - PREMIUM_ACCOUNT_PATTERN = '<br/>\s*Premium: (?P<P>[^/]*) / Traffic left: (?P<T>[\d.]*) (?P<U>\w*)\s*\\n\s*<br/>' - - - def loadAccountInfo(self, user, req): - html = req.load("http://egofiles.com") - if 'You are logged as a Free User' in html: - return {"premium": False, "validuntil": None, "trafficleft": None} - - m = re.search(self.PREMIUM_ACCOUNT_PATTERN, html) - if m: - validuntil = int(time.mktime(time.strptime(m.group('P'), "%Y-%m-%d %H:%M:%S"))) - trafficleft = parseFileSize(m.group('T'), m.group('U')) / 1024 - return {"premium": True, "validuntil": validuntil, "trafficleft": trafficleft} - else: - self.logError("Unable to retrieve account information - Plugin may be out of date") - - def login(self, user, data, req): - # Set English language - req.load("https://egofiles.com/ajax/lang.php?lang=en", just_header=True) - - html = req.load("http://egofiles.com/ajax/register.php", - post={"log": 1, - "loginV": user, - "passV": data['password']}) - if 'Login successful' not in html: - self.wrongPassword() diff --git a/pyload/plugins/account/File4safeCom.py b/pyload/plugins/account/File4safeCom.py index 4da721193..4429b917b 100644 --- a/pyload/plugins/account/File4safeCom.py +++ b/pyload/plugins/account/File4safeCom.py @@ -6,13 +6,13 @@ from pyload.plugins.internal.XFSPAccount import XFSPAccount class File4safeCom(XFSPAccount): __name__ = "File4safeCom" __type__ = "account" - __version__ = "0.01" + __version__ = "0.02" __description__ = """File4safe.com account plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" - MAIN_PAGE = "http://file4safe.com/" + HOSTER_URL = "http://file4safe.com/" LOGIN_FAIL_PATTERN = r'input_login' PREMIUM_PATTERN = r'Extend Premium' diff --git a/pyload/plugins/account/FilerioCom.py b/pyload/plugins/account/FilerioCom.py index 0a8bc10cd..c86fa7e1f 100644 --- a/pyload/plugins/account/FilerioCom.py +++ b/pyload/plugins/account/FilerioCom.py @@ -6,10 +6,10 @@ from pyload.plugins.internal.XFSPAccount import XFSPAccount class FilerioCom(XFSPAccount): __name__ = "FilerioCom" __type__ = "account" - __version__ = "0.01" + __version__ = "0.02" __description__ = """FileRio.in account plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" - MAIN_PAGE = "http://filerio.in/" + HOSTER_URL = "http://filerio.in/" diff --git a/pyload/plugins/account/HotfileCom.py b/pyload/plugins/account/HotfileCom.py deleted file mode 100644 index 3dde85b49..000000000 --- a/pyload/plugins/account/HotfileCom.py +++ /dev/null @@ -1,74 +0,0 @@ -# -*- coding: utf-8 -*- - -from time import strptime, mktime -import hashlib - -from pyload.plugins.base.Account import Account - - -class HotfileCom(Account): - __name__ = "HotfileCom" - __type__ = "account" - __version__ = "0.2" - - __description__ = """Hotfile.com account plugin""" - __author_name__ = ("mkaay", "JoKoT3") - __author_mail__ = ("mkaay@mkaay.de", "jokot3@gmail.com") - - - def loadAccountInfo(self, user, req): - resp = self.apiCall("getuserinfo", user=user) - if resp.startswith("."): - self.core.debug("HotfileCom API Error: %s" % resp) - raise Exception - info = {} - for p in resp.split("&"): - key, value = p.split("=") - info[key] = value - - if info['is_premium'] == '1': - info['premium_until'] = info['premium_until'].replace("T", " ") - zone = info['premium_until'][19:] - info['premium_until'] = info['premium_until'][:19] - zone = int(zone[:3]) - - validuntil = int(mktime(strptime(info['premium_until'], "%Y-%m-%d %H:%M:%S"))) + (zone * 60 * 60) - tmp = {"validuntil": validuntil, "trafficleft": -1, "premium": True} - - elif info['is_premium'] == '0': - tmp = {"premium": False} - - return tmp - - def apiCall(self, method, post={}, user=None): - if user: - data = self.getAccountData(user) - else: - user, data = self.selectAccount() - - req = self.getAccountRequest(user) - - digest = req.load("http://api.hotfile.com/", post={"action": "getdigest"}) - h = hashlib.md5() - h.update(data['password']) - hp = h.hexdigest() - h = hashlib.md5() - h.update(hp) - h.update(digest) - pwhash = h.hexdigest() - - post.update({"action": method}) - post.update({"username": user, "passwordmd5dig": pwhash, "digest": digest}) - resp = req.load("http://api.hotfile.com/", post=post) - req.close() - return resp - - def login(self, user, data, req): - cj = self.getAccountCookies(user) - cj.setCookie("hotfile.com", "lang", "en") - req.load("http://hotfile.com/", cookies=True) - page = req.load("http://hotfile.com/login.php", post={"returnto": "/", "user": user, "pass": data['password']}, - cookies=True) - - if "Bad username/password" in page: - self.wrongPassword() diff --git a/pyload/plugins/account/MovReelCom.py b/pyload/plugins/account/MovReelCom.py index 0f80b1aa8..71766427f 100644 --- a/pyload/plugins/account/MovReelCom.py +++ b/pyload/plugins/account/MovReelCom.py @@ -6,7 +6,7 @@ from pyload.plugins.internal.XFSPAccount import XFSPAccount class MovReelCom(XFSPAccount): __name__ = "MovReelCom" __type__ = "account" - __version__ = "0.01" + __version__ = "0.02" __description__ = """Movreel.com account plugin""" __author_name__ = "t4skforce" @@ -15,7 +15,7 @@ class MovReelCom(XFSPAccount): login_timeout = 60 info_threshold = 30 - MAIN_PAGE = "http://movreel.com/" + HOSTER_URL = "http://movreel.com/" TRAFFIC_LEFT_PATTERN = r'Traffic.*?<b>([^<]+)</b>' LOGIN_FAIL_PATTERN = r'<b[^>]*>Incorrect Login or Password</b><br>' diff --git a/pyload/plugins/account/OboomCom.py b/pyload/plugins/account/OboomCom.py index 14bdd1510..b304e210c 100644 --- a/pyload/plugins/account/OboomCom.py +++ b/pyload/plugins/account/OboomCom.py @@ -11,7 +11,7 @@ from pyload.plugins.base.Account import Account class OboomCom(Account): __name__ = "OboomCom" __type__ = "account" - __version__ = "0.1" + __version__ = "0.2" __description__ = """Oboom.com account plugin""" __author_name__ = "stanley" @@ -22,32 +22,41 @@ class OboomCom(Account): passwd = self.getAccountData(user)['password'] salt = passwd[::-1] pbkdf2 = PBKDF2(passwd, salt, 1000).hexread(16) - result = json_loads(req.load("https://www.oboom.com/1.0/login", get={"auth": user, "pass": pbkdf2})) + result = json_loads(req.load("https://www.oboom.com/1/login", get={"auth": user, "pass": pbkdf2})) if not result[0] == 200: self.logWarning("Failed to log in: %s" % result[1]) self.wrongPassword() return result[1] + def loadAccountInfo(self, name, req): accountData = self.loadAccountData(name, req) + userData = accountData['user'] - if "premium_unix" in userData: - validUntilUtc = int(userData['premium_unix']) - if validUntilUtc > int(time.time()): - premium = True - validUntil = validUntilUtc - traffic = userData['traffic'] - trafficLeft = traffic['current'] - maxTraffic = traffic['max'] - session = accountData['session'] - return {"premium": premium, - "validuntil": validUntil, - "trafficleft": trafficLeft / 1024, - "maxtraffic": maxTraffic / 1024, - "session": session - } - return {"premium": False, "validuntil": -1} + if userData['premium'] == "null": + premium = False + else: + premium = True + + if userData['premium_unix'] == "null": + validUntil = -1 + else: + validUntil = int(userData['premium_unix']) + + traffic = userData['traffic'] + + trafficLeft = traffic['current'] + maxTraffic = traffic['max'] + + session = accountData['session'] + + return {'premium': premium, + 'validuntil': validUntil, + 'trafficleft': trafficLeft / 1024, + 'maxtraffic': maxTraffic / 1024, + 'session': session} + def login(self, user, data, req): self.loadAccountData(user, req) diff --git a/pyload/plugins/account/RarefileNet.py b/pyload/plugins/account/RarefileNet.py index 68e2595e2..e715d0fe0 100644 --- a/pyload/plugins/account/RarefileNet.py +++ b/pyload/plugins/account/RarefileNet.py @@ -6,10 +6,10 @@ from pyload.plugins.internal.XFSPAccount import XFSPAccount class RarefileNet(XFSPAccount): __name__ = "RarefileNet" __type__ = "account" - __version__ = "0.02" + __version__ = "0.03" __description__ = """RareFile.net account plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" - MAIN_PAGE = "http://rarefile.net/" + HOSTER_URL = "http://rarefile.net/" diff --git a/pyload/plugins/account/RyushareCom.py b/pyload/plugins/account/RyushareCom.py index 74258e984..032132537 100644 --- a/pyload/plugins/account/RyushareCom.py +++ b/pyload/plugins/account/RyushareCom.py @@ -6,13 +6,13 @@ from pyload.plugins.internal.XFSPAccount import XFSPAccount class RyushareCom(XFSPAccount): __name__ = "RyushareCom" __type__ = "account" - __version__ = "0.03" + __version__ = "0.04" __description__ = """Ryushare.com account plugin""" __author_name__ = ("zoidberg", "trance4us") __author_mail__ = ("zoidberg@mujmail.cz", "") - MAIN_PAGE = "http://ryushare.com/" + HOSTER_URL = "http://ryushare.com/" def login(self, user, data, req): diff --git a/pyload/plugins/account/UptoboxCom.py b/pyload/plugins/account/UptoboxCom.py index 7f9618da8..94c32e753 100644 --- a/pyload/plugins/account/UptoboxCom.py +++ b/pyload/plugins/account/UptoboxCom.py @@ -6,12 +6,12 @@ from pyload.plugins.internal.XFSPAccount import XFSPAccount class UptoboxCom(XFSPAccount): __name__ = "UptoboxCom" __type__ = "account" - __version__ = "0.02" + __version__ = "0.03" __description__ = """DDLStorage.com account plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" - MAIN_PAGE = "http://uptobox.com/" + HOSTER_URL = "http://uptobox.com/" VALID_UNTIL_PATTERN = r'>Premium.[Aa]ccount expire: ([^<]+)</strong>' diff --git a/pyload/plugins/base/Account.py b/pyload/plugins/base/Account.py index e338f6b26..acf531694 100644 --- a/pyload/plugins/base/Account.py +++ b/pyload/plugins/base/Account.py @@ -147,8 +147,10 @@ class Account(Base): raise Exception("Wrong return format") except Exception, e: infos = {"error": str(e)} + print_exc() - if req: req.close() + if req: + req.close() self.logDebug("Account Info: %s" % infos) diff --git a/pyload/plugins/crypter/DDLMusicOrg.py b/pyload/plugins/crypter/DDLMusicOrg.py index 52c10dc42..8c944c306 100644 --- a/pyload/plugins/crypter/DDLMusicOrg.py +++ b/pyload/plugins/crypter/DDLMusicOrg.py @@ -23,7 +23,7 @@ class DDLMusicOrg(Crypter): self.multiDL = False def decrypt(self, pyfile): - html = self.req.load(pyfile.url, cookies=True) + html = self.load(pyfile.url, cookies=True) if re.search(r"Wer dies nicht rechnen kann", html) is not None: self.offline() @@ -38,7 +38,7 @@ class DDLMusicOrg(Crypter): else: solve = int(math.group(1)) - int(math.group(3)) sleep(3) - htmlwithlink = self.req.load(pyfile.url, cookies=True, + htmlwithlink = self.load(pyfile.url, cookies=True, post={"calc%s" % linknr: solve, "send%s" % linknr: "Send", "id": id, "linknr": linknr}) m = re.search(r"<form id=\"ff\" action=\"(.*?)\" method=\"post\">", htmlwithlink) diff --git a/pyload/plugins/crypter/DuckCryptInfo.py b/pyload/plugins/crypter/DuckCryptInfo.py index 450fc867a..7f25b9ae6 100644 --- a/pyload/plugins/crypter/DuckCryptInfo.py +++ b/pyload/plugins/crypter/DuckCryptInfo.py @@ -23,12 +23,7 @@ class DuckCryptInfo(Crypter): def decrypt(self, pyfile): url = pyfile.url - # seems we don't need to wait - #src = self.req.load(str(url)) - #m = re.search(self.TIMER_PATTERN, src) - #if m: - # self.logDebug("Sleeping for" % m.group(1)) - # self.setWait(int(m.group(1)) ,False) + m = re.match(self.__pattern__, url) if m is None: self.fail('Weird error in link') diff --git a/pyload/plugins/crypter/HoerbuchIn.py b/pyload/plugins/crypter/HoerbuchIn.py index 2c72eef27..572472f5a 100644 --- a/pyload/plugins/crypter/HoerbuchIn.py +++ b/pyload/plugins/crypter/HoerbuchIn.py @@ -45,7 +45,7 @@ class HoerbuchIn(Crypter): url = m.group(0) self.pyfile.url = url - src = self.req.load(url, post={"viewed": "adpg"}) + src = self.load(url, post={"viewed": "adpg"}) links = [] pattern = re.compile("http://www\.hoerbuch\.in/protection/(\w+)/(.*?)\"") diff --git a/pyload/plugins/crypter/HotfileFolderCom.py b/pyload/plugins/crypter/HotfileFolderCom.py index 21d086302..4f144cc52 100644 --- a/pyload/plugins/crypter/HotfileFolderCom.py +++ b/pyload/plugins/crypter/HotfileFolderCom.py @@ -1,30 +1,15 @@ # -*- coding: utf-8 -*- -import re +from pyload.plugins.internal.DeadCrypter import DeadCrypter -from pyload.plugins.base.Crypter import Crypter - -class HotfileFolderCom(Crypter): +class HotfileFolderCom(DeadCrypter): __name__ = "HotfileFolderCom" __type__ = "crypter" - __version__ = "0.1" + __version__ = "0.3" - __pattern__ = r'http://(?:www\.)?hotfile.com/list/\w+/\w+' + __pattern__ = r'https?://(?:www\.)?hotfile\.com/list/\w+/\w+' __description__ = """Hotfile.com folder decrypter plugin""" __author_name__ = "RaNaN" __author_mail__ = "RaNaN@pyload.org" - - - def decrypt(self, pyfile): - html = self.load(pyfile.url) - - name = re.findall( - r'<img src="/i/folder.gif" width="23" height="14" style="margin-bottom: -2px;" />([^<]+)', html, - re.MULTILINE)[0].replace("/", "") - new_links = re.findall(r'href="(http://(www.)?hotfile\.com/dl/\d+/[0-9a-zA-Z]+[^"]+)', html) - - new_links = [x[0] for x in new_links] - - self.packages = [(name, new_links, name)] diff --git a/pyload/plugins/crypter/LinkSaveIn.py b/pyload/plugins/crypter/LinkSaveIn.py index fcc526092..f5c28e28e 100644 --- a/pyload/plugins/crypter/LinkSaveIn.py +++ b/pyload/plugins/crypter/LinkSaveIn.py @@ -8,14 +8,15 @@ import binascii import re from Crypto.Cipher import AES -from pyload.plugins.base.Crypter import Crypter + +from pyload.plugins.internal.SimpleCrypter import SimpleCrypter from pyload.utils import html_unescape -class LinkSaveIn(Crypter): +class LinkSaveIn(SimpleCrypter): __name__ = "LinkSaveIn" __type__ = "crypter" - __version__ = "2.01" + __version__ = "2.02" __pattern__ = r'http://(?:www\.)?linksave.in/(?P<id>\w+)$' @@ -23,10 +24,12 @@ class LinkSaveIn(Crypter): __author_name__ = "fragonib" __author_mail__ = "fragonib[AT]yahoo[DOT]es" + + COOKIES = [(".linksave.in", "Linksave_Language", "english")] + # Constants _JK_KEY_ = "jk" _CRYPTED_KEY_ = "crypted" - HOSTER_NAME = "linksave.in" def setup(self): @@ -36,11 +39,11 @@ class LinkSaveIn(Crypter): self.package = None self.preferred_sources = ["cnl2", "rsdf", "ccf", "dlc", "web"] + def decrypt(self, pyfile): # Init self.package = pyfile.package() self.fileid = re.match(self.__pattern__, pyfile.url).group('id') - self.req.cj.setCookie(self.HOSTER_NAME, "Linksave_Language", "english") # Request package self.html = self.load(pyfile.url) @@ -74,41 +77,48 @@ class LinkSaveIn(Crypter): else: self.fail('Could not extract any links') + def isOnline(self): if "<big>Error 404 - Folder not found!</big>" in self.html: self.logDebug("File not found") return False return True + def isPasswordProtected(self): if re.search(r'''<input.*?type="password"''', self.html): self.logDebug("Links are password protected") return True + def isCaptchaProtected(self): if "<b>Captcha:</b>" in self.html: self.logDebug("Links are captcha protected") return True return False + def unlockPasswordProtection(self): password = self.getPassword() self.logDebug("Submitting password [%s] for protected links" % password) post = {"id": self.fileid, "besucherpasswort": password, 'login': 'submit'} self.html = self.load(self.pyfile.url, post=post) + def unlockCaptchaProtection(self): captcha_hash = re.search(r'name="hash" value="([^"]+)', self.html).group(1) captcha_url = re.search(r'src=".(/captcha/cap.php\?hsh=[^"]+)', self.html).group(1) captcha_code = self.decryptCaptcha("http://linksave.in" + captcha_url, forceUser=True) self.html = self.load(self.pyfile.url, post={"id": self.fileid, "hash": captcha_hash, "code": captcha_code}) + def getPackageInfo(self): name = self.pyfile.package().name folder = self.pyfile.package().folder self.logDebug("Defaulting to pyfile name [%s] and folder [%s] for package" % (name, folder)) return name, folder + def handleErrors(self): if "The visitorpassword you have entered is wrong" in self.html: self.logDebug("Incorrect password, please set right password on 'Edit package' form and retry") @@ -122,6 +132,7 @@ class LinkSaveIn(Crypter): else: self.correctCaptcha() + def handleLinkSource(self, type_): if type_ == "cnl2": return self.handleCNL2() @@ -132,6 +143,7 @@ class LinkSaveIn(Crypter): else: self.fail('unknown source type "%s" (this is probably a bug)' % type_) + def handleWebLinks(self): package_links = [] self.logDebug("Search for Web links") @@ -159,6 +171,7 @@ class LinkSaveIn(Crypter): self.logDebug("Error decrypting Web link %s, %s" % (webLink, detail)) return package_links + def handleContainer(self, type_): package_links = [] type_ = type_.lower() @@ -173,6 +186,7 @@ class LinkSaveIn(Crypter): package_links.append(link) return package_links + def handleCNL2(self): package_links = [] self.logDebug("Search for CNL2 links") @@ -187,6 +201,7 @@ class LinkSaveIn(Crypter): self.fail("Unable to decrypt CNL2 links") return package_links + def _getCipherParams(self): # Get jk jk_re = r'<INPUT.*?NAME="%s".*?VALUE="(.*?)"' % LinkSaveIn._JK_KEY_ @@ -200,6 +215,7 @@ class LinkSaveIn(Crypter): self.logDebug("Detected %d crypted blocks" % len(vcrypted)) return vcrypted, vjk + def _getLinks(self, crypted, jk): # Get key jreturn = self.js.eval("%s f()" % jk) diff --git a/pyload/plugins/crypter/LixIn.py b/pyload/plugins/crypter/LixIn.py index 63d1e1869..831f35c22 100644 --- a/pyload/plugins/crypter/LixIn.py +++ b/pyload/plugins/crypter/LixIn.py @@ -10,7 +10,7 @@ class LixIn(Crypter): __type__ = "crypter" __version__ = "0.22" - __pattern__ = r'http://(www.)?lix.in/(?P<id>.*)' + __pattern__ = r'http://(?:www\.)?lix\.in/(?P<ID>.+)' __description__ = """Lix.in decrypter plugin""" __author_name__ = "spoob" @@ -28,10 +28,10 @@ class LixIn(Crypter): if m is None: self.fail("couldn't identify file id") - id = m.group("id") + id = m.group("ID") self.logDebug("File id is %s" % id) - self.html = self.req.load(url, decode=True) + self.html = self.load(url, decode=True) m = re.search(self.SUBMIT_PATTERN, self.html) if m is None: @@ -44,12 +44,12 @@ class LixIn(Crypter): if m: self.logDebug("Trying captcha") captcharesult = self.decryptCaptcha("http://lix.in/" + m.group("image")) - self.html = self.req.load(url, decode=True, + self.html = self.load(url, decode=True, post={"capt": captcharesult, "submit": "submit", "tiny": id}) else: self.logDebug("No captcha/captcha solved") else: - self.html = self.req.load(url, decode=True, post={"submit": "submit", "tiny": id}) + self.html = self.load(url, decode=True, post={"submit": "submit", "tiny": id}) m = re.search(self.LINK_PATTERN, self.html) if m is None: diff --git a/pyload/plugins/crypter/OneKhDe.py b/pyload/plugins/crypter/OneKhDe.py index 4f5592fb8..b39504628 100644 --- a/pyload/plugins/crypter/OneKhDe.py +++ b/pyload/plugins/crypter/OneKhDe.py @@ -30,9 +30,8 @@ class OneKhDe(Crypter): def proceed(self, url, location): url = self.parent.url - self.html = self.req.load(url) + self.html = self.load(url) link_ids = re.findall(r"<a id=\"DownloadLink_(\d*)\" href=\"http://1kh.de/", self.html) for id in link_ids: - new_link = html_unescape( - re.search("width=\"100%\" src=\"(.*)\"></iframe>", self.req.load("http://1kh.de/l/" + id)).group(1)) + new_link = html_unescape(re.search("width=\"100%\" src=\"(.*)\"></iframe>", self.load("http://1kh.de/l/" + id)).group(1)) self.urls.append(new_link) diff --git a/pyload/plugins/hoster/BitshareCom.py b/pyload/plugins/hoster/BitshareCom.py index 75d3ea38b..8896e6833 100644 --- a/pyload/plugins/hoster/BitshareCom.py +++ b/pyload/plugins/hoster/BitshareCom.py @@ -22,15 +22,17 @@ class BitshareCom(SimpleHoster): FILE_INFO_PATTERN = r'Downloading (?P<N>.+) - (?P<S>[\d.]+) (?P<U>\w+)</h1>' OFFLINE_PATTERN = r'(>We are sorry, but the requested file was not found in our database|>Error - File not available<|The file was deleted either by the uploader, inactivity or due to copyright claim)' + COOKIES = [(".bitshare.com", "language_selection", "EN")] + FILE_AJAXID_PATTERN = r'var ajaxdl = "(.*?)";' TRAFFIC_USED_UP = r'Your Traffic is used up for today. Upgrade to premium to continue!' def setup(self): - self.req.cj.setCookie(".bitshare.com", "language_selection", "EN") self.multiDL = self.premium self.chunkLimit = 1 + def process(self, pyfile): if self.premium: self.account.relogin(self.user) @@ -77,6 +79,7 @@ class BitshareCom(SimpleHoster): elif check == "error": self.retry(5, 5 * 60, "Bitshare host : Error occured") + def getDownloadUrl(self): # Return location if direct download is active if self.premium: @@ -131,6 +134,7 @@ class BitshareCom(SimpleHoster): return url + def handleErrors(self, response, separator): self.logDebug("Checking response [%s]" % response) if "ERROR:Session timed out" in response: @@ -139,6 +143,7 @@ class BitshareCom(SimpleHoster): msg = response.split(separator)[-1] self.fail(msg) + def handleCaptchaErrors(self, response): self.logDebug("Result of captcha resolving [%s]" % response) if "SUCCESS" in response: diff --git a/pyload/plugins/hoster/DepositfilesCom.py b/pyload/plugins/hoster/DepositfilesCom.py index 660adb06d..55cdc875f 100644 --- a/pyload/plugins/hoster/DepositfilesCom.py +++ b/pyload/plugins/hoster/DepositfilesCom.py @@ -11,7 +11,7 @@ from pyload.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class DepositfilesCom(SimpleHoster): __name__ = "DepositfilesCom" __type__ = "hoster" - __version__ = "0.48" + __version__ = "0.49" __pattern__ = r'https?://(?:www\.)?(depositfiles\.com|dfiles\.(eu|ru))(/\w{1,3})?/files/(?P<ID>\w+)' diff --git a/pyload/plugins/hoster/DlFreeFr.py b/pyload/plugins/hoster/DlFreeFr.py index 0365754bc..1e256368c 100644 --- a/pyload/plugins/hoster/DlFreeFr.py +++ b/pyload/plugins/hoster/DlFreeFr.py @@ -40,10 +40,12 @@ class AdYouLike: ADYOULIKE_CALLBACK = r'Adyoulike.g._jsonp_5579316662423138' ADYOULIKE_CHALLENGE_PATTERN = ADYOULIKE_CALLBACK + r'\((.*?)\)' + def __init__(self, plugin, engine="adyoulike"): self.plugin = plugin self.engine = engine + def challenge(self, html): adyoulike_data_string = None m = re.search(self.ADYOULIKE_INPUT_PATTERN, html) @@ -71,6 +73,7 @@ class AdYouLike: return ayl_data, challenge_data + def result(self, ayl, challenge): """ Adyoulike.g._jsonp_5579316662423138 @@ -117,6 +120,7 @@ class DlFreeFr(SimpleHoster): __author_name__ = ("the-razer", "zoidberg", "Toilal") __author_mail__ = ("daniel_ AT gmx DOT net", "zoidberg@mujmail.cz", "toilal.dev@gmail.com") + FILE_NAME_PATTERN = r'Fichier:</td>\s*<td[^>]*>(?P<N>[^>]*)</td>' FILE_SIZE_PATTERN = r'Taille:</td>\s*<td[^>]*>(?P<S>[\d.]+[KMG])o' OFFLINE_PATTERN = r"Erreur 404 - Document non trouv|Fichier inexistant|Le fichier demandé n'a pas été trouvé" @@ -127,13 +131,13 @@ class DlFreeFr(SimpleHoster): self.limitDL = 5 self.chunkLimit = 1 + def init(self): factory = self.core.requestFactory self.req = CustomBrowser(factory.bucket, factory.getOptions()) - def process(self, pyfile): - self.req.setCookieJar(None) + def process(self, pyfile): pyfile.url = replace_patterns(pyfile.url, self.FILE_URL_REPLACEMENTS) valid_url = pyfile.url headers = self.load(valid_url, just_header=True) @@ -157,6 +161,7 @@ class DlFreeFr(SimpleHoster): else: self.fail("Invalid return code: " + str(headers.get('code'))) + def handleFree(self): action, inputs = self.parseHtmlForm('action="getfile.pl"') @@ -180,6 +185,7 @@ class DlFreeFr(SimpleHoster): else: self.fail("Invalid response") + def getLastHeaders(self): #parse header header = {"code": self.req.code} diff --git a/pyload/plugins/hoster/EgoFilesCom.py b/pyload/plugins/hoster/EgoFilesCom.py index 9d477e156..e5888c4f1 100644 --- a/pyload/plugins/hoster/EgoFilesCom.py +++ b/pyload/plugins/hoster/EgoFilesCom.py @@ -1,94 +1,18 @@ # -*- coding: utf-8 -*- -# -# Test links: -# http://egofiles.com/mOZfMI1WLZ6HBkGG/random.bin -import re +from pyload.plugins.internal.DeadHoster import DeadHoster, create_getInfo -from pyload.plugins.internal.CaptchaService import ReCaptcha -from pyload.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo - -class EgoFilesCom(SimpleHoster): +class EgoFilesCom(DeadHoster): __name__ = "EgoFilesCom" __type__ = "hoster" - __version__ = "0.15" + __version__ = "0.16" - __pattern__ = r'https?://(?:www\.)?egofiles.com/(\w+)' + __pattern__ = r'https?://(?:www\.)?egofiles\.com/\w+' __description__ = """Egofiles.com hoster plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" - FILE_INFO_PATTERN = r'<div class="down-file">\s+(?P<N>[^\t]+)\s+<div class="file-properties">\s+(File size|Rozmiar): (?P<S>[\w.]+) (?P<U>\w+) \|' - OFFLINE_PATTERN = r'(File size|Rozmiar): 0 KB' - WAIT_TIME_PATTERN = r'For next free download you have to wait <strong>((?P<m>\d*)m)? ?((?P<s>\d+)s)?</strong>' - LINK_PATTERN = r'<a href="(?P<link>[^"]+)">Download ></a>' - - - def setup(self): - # Set English language - self.load("https://egofiles.com/ajax/lang.php?lang=en", just_header=True) - - def process(self, pyfile): - if self.premium and (not self.FORCE_CHECK_TRAFFIC or self.checkTrafficLeft()): - self.handlePremium() - else: - self.handleFree() - - def handleFree(self): - self.html = self.load(self.pyfile.url, decode=True) - self.getFileInfo() - - # Wait time between free downloads - if 'For next free download you have to wait' in self.html: - m = re.search(self.WAIT_TIME_PATTERN, self.html).groupdict('0') - waittime = int(m['m']) * 60 + int(m['s']) - self.wait(waittime, True) - - downloadURL = r'' - - recaptcha = ReCaptcha(self) - - captcha_key = recaptcha.detect_key() - if captcha_key is None: - self.parseError("ReCaptcha key not found") - - for _ in xrange(5): - challenge, response = recaptcha.challenge(captcha_key) - post_data = {'recaptcha_challenge_field': challenge, - 'recaptcha_response_field': response} - self.html = self.load(self.pyfile.url, post=post_data, decode=True) - m = re.search(self.LINK_PATTERN, self.html) - if m is None: - self.logInfo("Wrong captcha") - self.invalidCaptcha() - elif hasattr(m, 'group'): - downloadURL = m.group('link') - self.correctCaptcha() - break - else: - self.fail('Unknown error - Plugin may be out of date') - - if not downloadURL: - self.fail("No Download url retrieved/all captcha attempts failed") - - self.download(downloadURL, disposition=True) - - def handlePremium(self): - header = self.load(self.pyfile.url, just_header=True) - if 'location' in header: - self.logDebug("DIRECT LINK from header: " + header['location']) - self.download(header['location']) - else: - self.html = self.load(self.pyfile.url, decode=True) - self.getFileInfo() - m = re.search(r'<a href="(?P<link>[^"]+)">Download ></a>', self.html) - if m is None: - self.parseError('Unable to detect direct download url') - else: - self.logDebug("DIRECT URL from html: " + m.group('link')) - self.download(m.group('link'), disposition=True) - getInfo = create_getInfo(EgoFilesCom) diff --git a/pyload/plugins/hoster/FilerNet.py b/pyload/plugins/hoster/FilerNet.py index 91df4ff7e..5b3a07871 100644 --- a/pyload/plugins/hoster/FilerNet.py +++ b/pyload/plugins/hoster/FilerNet.py @@ -16,7 +16,7 @@ from pyload.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FilerNet(SimpleHoster): __name__ = "FilerNet" __type__ = "hoster" - __version__ = "0.03" + __version__ = "0.04" __pattern__ = r'https?://(?:www\.)?filer\.net/get/(\w+)' diff --git a/pyload/plugins/hoster/HotfileCom.py b/pyload/plugins/hoster/HotfileCom.py index 1dd8b4f4e..41831342f 100644 --- a/pyload/plugins/hoster/HotfileCom.py +++ b/pyload/plugins/hoster/HotfileCom.py @@ -8,7 +8,7 @@ class HotfileCom(DeadHoster): __type__ = "hoster" __version__ = "0.37" - __pattern__ = r'https?://(www.)?hotfile\.com/dl/\d+/[0-9a-zA-Z]+/' + __pattern__ = r'https?://(?:www\.)?hotfile\.com/dl/\d+/\w+' __description__ = """Hotfile.com hoster plugin""" __author_name__ = ("sitacuisses", "spoob", "mkaay", "JoKoT3") diff --git a/pyload/plugins/hoster/OboomCom.py b/pyload/plugins/hoster/OboomCom.py index 19e3d2ad4..e9496b469 100644 --- a/pyload/plugins/hoster/OboomCom.py +++ b/pyload/plugins/hoster/OboomCom.py @@ -13,9 +13,9 @@ from pyload.plugins.internal.CaptchaService import ReCaptcha class OboomCom(Hoster): __name__ = "OboomCom" __type__ = "hoster" - __version__ = "0.1" + __version__ = "0.2" - __pattern__ = r'https?://(?:www\.)?oboom\.com/(#(id=|/)?)?(?P<ID>[A-Z0-9]{8})' + __pattern__ = r'https?://(?:www\.)?oboom\.com/(#(id=|/)?)?(?P<ID>\w{8})' __description__ = """oboom.com hoster plugin""" __author_name__ = "stanley" @@ -27,7 +27,7 @@ class OboomCom(Hoster): def setup(self): self.chunkLimit = 1 - self.multiDL = self.premium + self.multiDL = self.resumeDownload = self.premium def process(self, pyfile): diff --git a/pyload/plugins/hoster/SpeedyshareCom.py b/pyload/plugins/hoster/SpeedyshareCom.py index 42bb3e453..5dd29dad0 100644 --- a/pyload/plugins/hoster/SpeedyshareCom.py +++ b/pyload/plugins/hoster/SpeedyshareCom.py @@ -15,7 +15,7 @@ class SpeedyshareCom(SimpleHoster): __type__ = "hoster" __version__ = "0.02" - __pattern__ = r"https?://(www\.)?(speedyshare\.com|speedy\.sh)/\w+" + __pattern__ = r"https?://(?:www\.)?(speedyshare\.com|speedy\.sh)/\w+" __description__ = """Speedyshare.com hoster plugin""" __author_name__ = "zapp-brannigan" diff --git a/pyload/plugins/hoster/UploadingCom.py b/pyload/plugins/hoster/UploadingCom.py index 882cb863f..1df258c4f 100644 --- a/pyload/plugins/hoster/UploadingCom.py +++ b/pyload/plugins/hoster/UploadingCom.py @@ -19,18 +19,18 @@ class UploadingCom(SimpleHoster): __author_name__ = ("jeix", "mkaay", "zoidberg") __author_mail__ = ("jeix@hasnomail.de", "mkaay@mkaay.de", "zoidberg@mujmail.cz") + FILE_NAME_PATTERN = r'id="file_title">(?P<N>.+)</' FILE_SIZE_PATTERN = r'size tip_container">(?P<S>[\d.]+) (?P<U>\w+)<' OFFLINE_PATTERN = r'(Page|file) not found' + COOKIES = [(".uploading.com", "lang", "1"), + (".uploading.com", "language", "1"), + (".uploading.com", "setlang", "en"), + (".uploading.com", "_lang", "en")] - def process(self, pyfile): - # set lang to english - self.req.cj.setCookie(".uploading.com", "lang", "1") - self.req.cj.setCookie(".uploading.com", "language", "1") - self.req.cj.setCookie(".uploading.com", "setlang", "en") - self.req.cj.setCookie(".uploading.com", "_lang", "en") + def process(self, pyfile): if not "/get/" in pyfile.url: pyfile.url = pyfile.url.replace("/files", "/files/get") @@ -42,6 +42,7 @@ class UploadingCom(SimpleHoster): else: self.handleFree() + def handlePremium(self): postData = {'action': 'get_link', 'code': self.file_info['ID'], @@ -55,6 +56,7 @@ class UploadingCom(SimpleHoster): raise Exception("Plugin defect.") + def handleFree(self): m = re.search('<h2>((Daily )?Download Limit)</h2>', self.html) if m: diff --git a/pyload/plugins/internal/XFSPAccount.py b/pyload/plugins/internal/XFSPAccount.py index 7d89536cc..058fdf2b5 100644 --- a/pyload/plugins/internal/XFSPAccount.py +++ b/pyload/plugins/internal/XFSPAccount.py @@ -5,20 +5,23 @@ import re from time import mktime, strptime from pyload.plugins.base.Account import Account -from pyload.plugins.internal.SimpleHoster import parseHtmlForm +from pyload.plugins.internal.SimpleHoster import parseHtmlForm, set_cookies from pyload.utils import parseFileSize class XFSPAccount(Account): __name__ = "XFSPAccount" __type__ = "account" - __version__ = "0.06" + __version__ = "0.07" __description__ = """XFileSharingPro base account plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" - MAIN_PAGE = None + + HOSTER_URL = None + + COOKIES = None #: or list of tuples [(domain, name, value)] VALID_UNTIL_PATTERN = r'>Premium.[Aa]ccount expire:</TD><TD><b>([^<]+)</b>' TRAFFIC_LEFT_PATTERN = r'>Traffic available today:</TD><TD><b>([^<]+)</b>' @@ -27,7 +30,7 @@ class XFSPAccount(Account): def loadAccountInfo(self, user, req): - html = req.load(self.MAIN_PAGE + "?op=my_account", decode=True) + html = req.load(self.HOSTER_URL + "?op=my_account", decode=True) validuntil = trafficleft = None premium = True if re.search(self.PREMIUM_PATTERN, html) else False @@ -52,18 +55,21 @@ class XFSPAccount(Account): return {"validuntil": validuntil, "trafficleft": trafficleft, "premium": premium} + def login(self, user, data, req): - html = req.load('%slogin.html' % self.MAIN_PAGE, decode=True) + set_cookies(req.cj, self.COOKIES) + + html = req.load('%slogin.html' % self.HOSTER_URL, decode=True) action, inputs = parseHtmlForm('name="FL"', html) if not inputs: inputs = {"op": "login", - "redirect": self.MAIN_PAGE} + "redirect": self.HOSTER_URL} inputs.update({"login": user, "password": data['password']}) - html = req.load(self.MAIN_PAGE, post=inputs, decode=True) + html = req.load(self.HOSTER_URL, post=inputs, decode=True) if re.search(self.LOGIN_FAIL_PATTERN, html): self.wrongPassword() |