diff options
author | Walter Purcaro <vuolter@gmail.com> | 2015-01-04 01:37:07 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2015-01-04 01:37:07 +0100 |
commit | 78ca228768eabe5b62a7b1643ad547662ae13115 (patch) | |
tree | c6a7529ddc6e363642afd3ee0ec2eee2f3572859 /module/plugins/crypter/DlProtectCom.py | |
parent | Merge pull request #1008 from LePastis/patch-1 (diff) | |
download | pyload-78ca228768eabe5b62a7b1643ad547662ae13115.tar.xz |
[DlProtectCom] Update
Diffstat (limited to 'module/plugins/crypter/DlProtectCom.py')
-rw-r--r-- | module/plugins/crypter/DlProtectCom.py | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/module/plugins/crypter/DlProtectCom.py b/module/plugins/crypter/DlProtectCom.py index 93ad8bffc..052e8303f 100644 --- a/module/plugins/crypter/DlProtectCom.py +++ b/module/plugins/crypter/DlProtectCom.py @@ -11,9 +11,9 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo class DlProtectCom(SimpleCrypter): __name__ = "DlProtectCom" __type__ = "crypter" - __version__ = "0.02" + __version__ = "0.03" - __pattern__ = r'http://(?:www\.)?dl-protect\.com/((en|fr)/)?(?P<ID>\w+)' + __pattern__ = r'https?://(?:www\.)?dl-protect\.com/((en|fr)/)?\w+' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] @@ -22,38 +22,36 @@ class DlProtectCom(SimpleCrypter): __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + COOKIES = [("dl-protect.com", "l", "en")] + OFFLINE_PATTERN = r'Unfortunately, the link you are looking for is not found' def getLinks(self): # Direct link with redirect - if not re.match(r"http://(?:www\.)?dl-protect\.com", self.req.http.lastEffectiveURL): + if not re.match(r"https?://(?:www\.)?dl-protect\.com/.+", self.req.http.lastEffectiveURL): return [self.req.http.lastEffectiveURL] - #id = re.match(self.__pattern__, self.pyfile.url).group('ID') - key = re.search(r'name="key" value="(.+?)"', self.html).group(1) + post_req = {'key' : re.search(r'name="key" value="(.+?)"', self.html).group(1), + 'submitform': ""} - post_req = {"key": key, "submitform": ""} + if "Please click on continue to see the content" in self.html: + post_req['submitform'] = "Continue" + self.wait(5) - if self.OFFLINE_PATTERN in self.html: - self.offline() - elif "Please click on continue to see the content" in self.html: - while not re.match(r'id="btn-continue" type="submit" value="Continue"', self.html): - self.setWait(1) - self.wait() - post_req.update({"submitform": "Continue"}) else: - mstime = int(round(time() * 1000)) + mstime = int(round(time() * 1000)) b64time = "_" + urlsafe_b64encode(str(mstime)).replace("=", "%3D") - post_req.update({"i": b64time, "submitform": "Decrypt+link"}) + post_req.update({'i' : b64time, + 'submitform': "Decrypt+link"}) if "Password :" in self.html: post_req['pwd'] = self.getPassword() if "Security Code" in self.html: - captcha_id = re.search(r'/captcha\.php\?uid=(.+?)"', self.html).group(1) - captcha_url = "http://www.dl-protect.com/captcha.php?uid=" + captcha_id + captcha_id = re.search(r'/captcha\.php\?uid=(.+?)"', self.html).group(1) + captcha_url = "http://www.dl-protect.com/captcha.php?uid=" + captcha_id captcha_code = self.decryptCaptcha(captcha_url, imgtype="gif") post_req['secure'] = captcha_code @@ -64,8 +62,7 @@ class DlProtectCom(SimpleCrypter): if errmsg in self.html: self.fail(_(errmsg[1:])) - pattern = r'<a href="([^/].+?)" target="_blank">' - return re.findall(pattern, self.html) + return re.findall(r'<a href="([^/].+?)" target="_blank">', self.html) getInfo = create_getInfo(DlProtectCom) |