From f60e99b1091074100e4722bc3b5cd6556377ec42 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sun, 19 Jun 2011 11:32:25 +0200 Subject: cleaned rslayer plugin --- module/plugins/crypter/RSLayerCom.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'module') diff --git a/module/plugins/crypter/RSLayerCom.py b/module/plugins/crypter/RSLayerCom.py index 14d8ced4c..6e4266f2e 100644 --- a/module/plugins/crypter/RSLayerCom.py +++ b/module/plugins/crypter/RSLayerCom.py @@ -20,29 +20,30 @@ class RSLayerCom(Crypter): def decrypt(self, pyfile): url = pyfile.url src = self.req.load(str(url)) - + soup = BeautifulSoup(src) - captchaTag = soup.find("img", attrs={"id":"captcha_image"}) + captchaTag = soup.find("img", attrs={"id": "captcha_image"}) if captchaTag: - captchaUrl = "http://rs-layer.com/"+captchaTag["src"] - self.log.debug("Captcha URL: %s" % captchaUrl) + captchaUrl = "http://rs-layer.com/" + captchaTag["src"] + self.logDebug("Captcha URL: %s" % captchaUrl) result = self.decryptCaptcha(str(captchaUrl), imgtype="png") - captchaInput = soup.find("input", attrs={"id":"captcha"}) + captchaInput = soup.find("input", attrs={"id": "captcha"}) self.req.lastUrl = url src = self.req.load(str(url), post={'captcha_input': result, 'image_name': captchaTag["src"]}) - + link_ids = re.findall(r"onclick=\"getFile\(\'([0-9]{7}-.{8})\'\);changeBackgroundColor", src) if not len(link_ids) > 0: self.retry() - + self.correctCaptcha() - + links = [] for id in link_ids: - self.log.debug("ID: %s" % id) - new_link = unescape(re.search(r"