From 1047c706d41dec4a49a747496c2ec01ed3bf7801 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 5 Oct 2014 01:54:58 +0200 Subject: Use load instead req.load in all crypters and CaptchaService --- module/plugins/crypter/DDLMusicOrg.py | 4 ++-- module/plugins/crypter/LixIn.py | 6 +++--- module/plugins/crypter/OneKhDe.py | 4 ++-- module/plugins/internal/CaptchaService.py | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) (limited to 'module') diff --git a/module/plugins/crypter/DDLMusicOrg.py b/module/plugins/crypter/DDLMusicOrg.py index f5e7203d3..9d76bf11a 100644 --- a/module/plugins/crypter/DDLMusicOrg.py +++ b/module/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"
", htmlwithlink) diff --git a/module/plugins/crypter/LixIn.py b/module/plugins/crypter/LixIn.py index dec2e02d3..7aedda686 100644 --- a/module/plugins/crypter/LixIn.py +++ b/module/plugins/crypter/LixIn.py @@ -31,7 +31,7 @@ class LixIn(Crypter): 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/module/plugins/crypter/OneKhDe.py b/module/plugins/crypter/OneKhDe.py index ba93278d5..4b22432f8 100644 --- a/module/plugins/crypter/OneKhDe.py +++ b/module/plugins/crypter/OneKhDe.py @@ -30,9 +30,9 @@ 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"", self.req.load("http://1kh.de/l/" + id)).group(1)) + re.search("width=\"100%\" src=\"(.*)\">", self.load("http://1kh.de/l/" + id)).group(1)) self.urls.append(new_link) diff --git a/module/plugins/internal/CaptchaService.py b/module/plugins/internal/CaptchaService.py index b2fba0652..35074bc63 100644 --- a/module/plugins/internal/CaptchaService.py +++ b/module/plugins/internal/CaptchaService.py @@ -92,7 +92,7 @@ class ReCaptcha(CaptchaService): self.plugin.fail(errmsg) raise TypeError(errmsg) - js = self.plugin.req.load("http://www.google.com/recaptcha/api/challenge", get={'k': key}, cookies=True) + js = self.plugin.load("http://www.google.com/recaptcha/api/challenge", get={'k': key}, cookies=True) try: challenge = re.search("challenge : '(.+?)',", js).group(1) @@ -154,7 +154,7 @@ class AdsCaptcha(CaptchaService): CaptchaId, PublicKey = key - js = self.plugin.req.load("http://api.adscaptcha.com/Get.aspx", get={'CaptchaId': CaptchaId, 'PublicKey': PublicKey}, cookies=True) + js = self.plugin.load("http://api.adscaptcha.com/Get.aspx", get={'CaptchaId': CaptchaId, 'PublicKey': PublicKey}, cookies=True) try: challenge = re.search("challenge: '(.+?)',", js).group(1) @@ -193,7 +193,7 @@ class SolveMedia(CaptchaService): self.plugin.fail(errmsg) raise TypeError(errmsg) - html = self.plugin.req.load("http://api.solvemedia.com/papi/challenge.noscript", get={'k': key}, cookies=True) + html = self.plugin.load("http://api.solvemedia.com/papi/challenge.noscript", get={'k': key}, cookies=True) try: challenge = re.search(r'', html).group(1) -- cgit v1.2.3