diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-07-20 03:29:17 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-07-20 03:29:17 +0200 |
commit | f87a5ccc7f120946ce0973999029eaf6e39cd5a2 (patch) | |
tree | 27877ad04c1d9aed054d364ffded7aa6d5f54ed6 /module | |
parent | Fix hosters SH_COOKIES syntax (diff) | |
download | pyload-f87a5ccc7f120946ce0973999029eaf6e39cd5a2.tar.xz |
[DepositfilesCom] Fixed premium dl
Diffstat (limited to 'module')
-rw-r--r-- | module/plugins/accounts/DepositfilesCom.py | 27 | ||||
-rw-r--r-- | module/plugins/hoster/DepositfilesCom.py | 44 |
2 files changed, 36 insertions, 35 deletions
diff --git a/module/plugins/accounts/DepositfilesCom.py b/module/plugins/accounts/DepositfilesCom.py index beeae2a5f..2037f35c4 100644 --- a/module/plugins/accounts/DepositfilesCom.py +++ b/module/plugins/accounts/DepositfilesCom.py @@ -1,21 +1,7 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see <http://www.gnu.org/licenses/>. -""" - import re + from time import strptime, mktime from module.plugins.Account import Account @@ -23,16 +9,16 @@ from module.plugins.Account import Account class DepositfilesCom(Account): __name__ = "DepositfilesCom" - __version__ = "0.2" + __version__ = "0.3" __type__ = "account" __description__ = """Depositfiles.com account plugin""" - __author_name__ = ("mkaay", "stickell") - __author_mail__ = ("mkaay@mkaay.de", "l.stickell@yahoo.it") + __author_name__ = ("mkaay", "stickell", "Walter Purcaro") + __author_mail__ = ("mkaay@mkaay.de", "l.stickell@yahoo.it", "vuolter@gmail.com") def loadAccountInfo(self, user, req): - src = req.load("http://depositfiles.com/de/gold/") + src = req.load("https://dfiles.eu/de/gold/") validuntil = re.search(r"Sie haben Gold Zugang bis: <b>(.*?)</b></div>", src).group(1) validuntil = int(mktime(strptime(validuntil, "%Y-%m-%d %H:%M:%S"))) @@ -40,8 +26,7 @@ class DepositfilesCom(Account): return {"validuntil": validuntil, "trafficleft": -1} def login(self, user, data, req): - req.load("http://depositfiles.com/de/gold/payment.php") - src = req.load("http://depositfiles.com/de/login.php", get={"return": "/de/gold/payment.php"}, + src = req.load("https://dfiles.eu/de/login.php", get={"return": "/de/gold/payment.php"}, post={"login": user, "password": data['password']}) if r'<div class="error_message">Sie haben eine falsche Benutzername-Passwort-Kombination verwendet.</div>' in src: self.wrongPassword() diff --git a/module/plugins/hoster/DepositfilesCom.py b/module/plugins/hoster/DepositfilesCom.py index 0192859b7..386e3694e 100644 --- a/module/plugins/hoster/DepositfilesCom.py +++ b/module/plugins/hoster/DepositfilesCom.py @@ -1,30 +1,38 @@ # -*- coding: utf-8 -*- import re -from urllib import unquote -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo + from module.plugins.internal.CaptchaService import ReCaptcha +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class DepositfilesCom(SimpleHoster): __name__ = "DepositfilesCom" + __version__ = "0.47" __type__ = "hoster" - __pattern__ = r'https?://(?:www\.)?(depositfiles\.com|dfiles\.(eu|ru))(/\w{1,3})?/files/[\w]+' - __version__ = "0.46" + + __pattern__ = r'https?://(?:www\.)?(depositfiles\.com|dfiles\.(eu|ru))(/\w{1,3})?/files/(?P<ID>\w+)' + __description__ = """Depositfiles.com hoster plugin""" - __author_name__ = ("spoob", "zoidberg") - __author_mail__ = ("spoob@pyload.org", "zoidberg@mujmail.cz") + __author_name__ = ("spoob", "zoidberg", "Walter Purcaro") + __author_mail__ = ("spoob@pyload.org", "zoidberg@mujmail.cz", "vuolter@gmail.com") FILE_NAME_PATTERN = r'<script type="text/javascript">eval\( unescape\(\'(?P<N>.*?)\'' FILE_SIZE_PATTERN = r': <b>(?P<S>[0-9.]+) (?P<U>[kKMG])i?B</b>' OFFLINE_PATTERN = r'<span class="html_download_api-not_exists"></span>' - FILE_URL_REPLACEMENTS = [(r"\.com(/.*?)?/files", ".com/en/files"), (r"\.html$", "")] FILE_NAME_REPLACEMENTS = [(r'\%u([0-9A-Fa-f]{4})', lambda m: unichr(int(m.group(1), 16))), (r'.*<b title="(?P<N>[^"]+).*', "\g<N>")] + FILE_URL_REPLACEMENTS = [(__pattern__, "https://dfiles.eu/files/\g<ID>")] + + SH_COOKIES = [(".dfiles.eu", "lang_current", "en")] RECAPTCHA_PATTERN = r"Recaptcha.create\('([^']+)'" - LINK_PATTERN = r'<form id="downloader_file_form" action="(http://.+?\.(dfiles\.eu|depositfiles\.com)/.+?)" method="post"' + + FREE_LINK_PATTERN = r'<form id="downloader_file_form" action="(http://.+?\.(dfiles\.eu|depositfiles\.com)/.+?)" method="post"' + PREMIUM_LINK_PATTERN = r'class="repeat"><a href="(.+?)"' + PREMIUM_MIRROR_PATTERN = r'class="repeat_mirror"><a href="(.+?)"' + def handleFree(self): self.html = self.load(self.pyfile.url, post={"gateway_result": "1"}, cookies=True) @@ -67,7 +75,7 @@ class DepositfilesCom(SimpleHoster): recaptcha = ReCaptcha(self) for _ in xrange(5): - self.html = self.load("http://depositfiles.com/get_file.php", get=params) + self.html = self.load("https://dfiles.eu/get_file.php", get=params) if '<input type=button value="Continue" onclick="check_recaptcha' in self.html: if not captcha_key: @@ -78,7 +86,7 @@ class DepositfilesCom(SimpleHoster): self.logDebug(params) continue - found = re.search(self.LINK_PATTERN, self.html) + found = re.search(self.FREE_LINK_PATTERN, self.html) if found: if 'response' in params: self.correctCaptcha() @@ -96,15 +104,23 @@ class DepositfilesCom(SimpleHoster): self.retry(wait_time=60) def handlePremium(self): + self.html = self.load(self.pyfile.url, cookies=self.SH_COOKIES) + if '<span class="html_download_api-gold_traffic_limit">' in self.html: self.logWarning("Download limit reached") self.retry(25, 60 * 60, "Download limit reached") elif 'onClick="show_gold_offer' in self.html: self.account.relogin(self.user) self.retry() - link = unquote( - re.search('<div id="download_url">\s*<a href="(http://.+?\.depositfiles.com/.+?)"', self.html).group(1)) - self.download(link, disposition=True) - + else: + link = re.search(self.PREMIUM_LINK_PATTERN, self.html) + mirror = re.search(self.PREMIUM_MIRROR_PATTERN, self.html) + if link: + dlink = link.group(1) + elif mirror: + dlink = mirror.group(1) + else: + self.parseError("No direct download link or mirror found") + self.download(dlink, disposition=True) getInfo = create_getInfo(DepositfilesCom) |