From 4914e1b3c0db27fa3d82f5a486319acb18daa30c Mon Sep 17 00:00:00 2001 From: LePastis Date: Sun, 4 Jan 2015 00:39:32 +0100 Subject: Update DlProtectCom.py Hello Frist, I'm a French guy so sorry for my English. I have made some fix for the DlProtect crypter : - Remove '>' at the start of string to search in the html page - Chage field name on form - Add a loop to wait 'Continue' button on the form. I stay 1 bug, because for me the message was in French in the page ('Please click on continue to see the content' => 'Cliquez sur continuer pour voir le(s) lien(s)'). I don't not how to manage multi-language in the crypter. --- module/plugins/crypter/DlProtectCom.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'module/plugins/crypter/DlProtectCom.py') diff --git a/module/plugins/crypter/DlProtectCom.py b/module/plugins/crypter/DlProtectCom.py index a99ed0be9..93ad8bffc 100644 --- a/module/plugins/crypter/DlProtectCom.py +++ b/module/plugins/crypter/DlProtectCom.py @@ -11,7 +11,7 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo class DlProtectCom(SimpleCrypter): __name__ = "DlProtectCom" __type__ = "crypter" - __version__ = "0.01" + __version__ = "0.02" __pattern__ = r'http://(?:www\.)?dl-protect\.com/((en|fr)/)?(?P\w+)' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), @@ -22,7 +22,7 @@ class DlProtectCom(SimpleCrypter): __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - OFFLINE_PATTERN = r'>Unfortunately, the link you are looking for is not found' + OFFLINE_PATTERN = r'Unfortunately, the link you are looking for is not found' def getLinks(self): @@ -31,13 +31,16 @@ class DlProtectCom(SimpleCrypter): return [self.req.http.lastEffectiveURL] #id = re.match(self.__pattern__, self.pyfile.url).group('ID') - key = re.search(r'name="id_key" value="(.+?)"', self.html).group(1) + key = re.search(r'name="key" value="(.+?)"', self.html).group(1) - post_req = {"id_key": key, "submitform": ""} + post_req = {"key": key, "submitform": ""} if self.OFFLINE_PATTERN in self.html: self.offline() - elif ">Please click on continue to see the content" in self.html: + 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)) @@ -45,10 +48,10 @@ class DlProtectCom(SimpleCrypter): post_req.update({"i": b64time, "submitform": "Decrypt+link"}) - if ">Password :" in self.html: + if "Password :" in self.html: post_req['pwd'] = self.getPassword() - if ">Security Code" in self.html: + 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_code = self.decryptCaptcha(captcha_url, imgtype="gif") @@ -57,7 +60,7 @@ class DlProtectCom(SimpleCrypter): self.html = self.load(self.pyfile.url, post=post_req) - for errmsg in (">The password is incorrect", ">The security code is incorrect"): + for errmsg in ("The password is incorrect", "The security code is incorrect"): if errmsg in self.html: self.fail(_(errmsg[1:])) -- cgit v1.2.3 From 78ca228768eabe5b62a7b1643ad547662ae13115 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 4 Jan 2015 01:37:07 +0100 Subject: [DlProtectCom] Update --- module/plugins/crypter/DlProtectCom.py | 35 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 19 deletions(-) (limited to 'module/plugins/crypter/DlProtectCom.py') 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\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'' - return re.findall(pattern, self.html) + return re.findall(r'', self.html) getInfo = create_getInfo(DlProtectCom) -- cgit v1.2.3 From 7979d0833573a107baae8c45330b8b5874630a76 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 4 Jan 2015 20:26:13 +0100 Subject: Spare code improvements --- module/plugins/crypter/DlProtectCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/DlProtectCom.py') diff --git a/module/plugins/crypter/DlProtectCom.py b/module/plugins/crypter/DlProtectCom.py index 052e8303f..4a188aa83 100644 --- a/module/plugins/crypter/DlProtectCom.py +++ b/module/plugins/crypter/DlProtectCom.py @@ -37,7 +37,7 @@ class DlProtectCom(SimpleCrypter): if "Please click on continue to see the content" in self.html: post_req['submitform'] = "Continue" - self.wait(5) + self.wait(2) else: mstime = int(round(time() * 1000)) -- cgit v1.2.3 From e65d19ee3a1e435bf2896ed829e5581eeef92dd2 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 14 Mar 2015 11:07:54 +0100 Subject: Import cleanup for datetime and time modules --- module/plugins/crypter/DlProtectCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/crypter/DlProtectCom.py') diff --git a/module/plugins/crypter/DlProtectCom.py b/module/plugins/crypter/DlProtectCom.py index 4a188aa83..5c20942ff 100644 --- a/module/plugins/crypter/DlProtectCom.py +++ b/module/plugins/crypter/DlProtectCom.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- import re +import time from base64 import urlsafe_b64encode -from time import time from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo @@ -40,7 +40,7 @@ class DlProtectCom(SimpleCrypter): self.wait(2) else: - mstime = int(round(time() * 1000)) + mstime = int(round(time.time() * 1000)) b64time = "_" + urlsafe_b64encode(str(mstime)).replace("=", "%3D") post_req.update({'i' : b64time, -- cgit v1.2.3 From 7d90803262ccbb4fc5296a4dc3ce30fe98f55631 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 25 Mar 2015 23:10:07 +0100 Subject: __config__ cosmetics --- module/plugins/crypter/DlProtectCom.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'module/plugins/crypter/DlProtectCom.py') diff --git a/module/plugins/crypter/DlProtectCom.py b/module/plugins/crypter/DlProtectCom.py index 5c20942ff..a9f39c6f3 100644 --- a/module/plugins/crypter/DlProtectCom.py +++ b/module/plugins/crypter/DlProtectCom.py @@ -14,8 +14,9 @@ class DlProtectCom(SimpleCrypter): __version__ = "0.03" __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)] + __config__ = [("use_premium" , "bool", "Use premium account if available" , True), + ("use_subfolder" , "bool", "Save package to subfolder" , True), + ("subfolder_per_pack", "bool", "Create a subfolder for each package", True)] __description__ = """Dl-protect.com decrypter plugin""" __license__ = "GPLv3" -- cgit v1.2.3