diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-06-19 11:30:22 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-06-19 11:30:22 +0200 |
commit | d0bd5d1804583551887f13e2df547dfdc9d2bb3a (patch) | |
tree | 576b016995f01b7f4bd526b22bad19233bbc8c70 /module/plugins/crypter/RSLayerCom.py | |
parent | closed #333 (diff) | |
download | pyload-d0bd5d1804583551887f13e2df547dfdc9d2bb3a.tar.xz |
wupload fix, rslayercom update
Diffstat (limited to 'module/plugins/crypter/RSLayerCom.py')
-rw-r--r-- | module/plugins/crypter/RSLayerCom.py | 55 |
1 files changed, 33 insertions, 22 deletions
diff --git a/module/plugins/crypter/RSLayerCom.py b/module/plugins/crypter/RSLayerCom.py index 9ce211aa1..14d8ced4c 100644 --- a/module/plugins/crypter/RSLayerCom.py +++ b/module/plugins/crypter/RSLayerCom.py @@ -3,35 +3,46 @@ import re -from module.unescape import unescape from module.plugins.Crypter import Crypter +from module.lib.BeautifulSoup import BeautifulSoup +from module.unescape import unescape class RSLayerCom(Crypter): __name__ = "RSLayerCom" __type__ = "container" __pattern__ = r"http://(www\.)?rs-layer.com/directory-" - __version__ = "0.1" + __config__ = [] + __version__ = "0.2" __description__ = """RS-Layer.com Container Plugin""" - __author_name__ = ("spoob") - __author_mail__ = ("spoob@pyload.org") + __author_name__ = ("hzpz") + __author_mail__ = ("none") - def __init__(self, parent): - Crypter.__init__(self, parent) - self.parent = parent - self.html = None + def decrypt(self, pyfile): + url = pyfile.url + src = self.req.load(str(url)) + + soup = BeautifulSoup(src) + captchaTag = soup.find("img", attrs={"id":"captcha_image"}) + if captchaTag: + captchaUrl = "http://rs-layer.com/"+captchaTag["src"] + self.log.debug("Captcha URL: %s" % captchaUrl) + result = self.decryptCaptcha(str(captchaUrl), imgtype="png") + 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) - def file_exists(self): - """ returns True or False - """ - return True - - def proceed(self, url, location): - url = self.parent.url - self.html = self.req.load(url) - temp_links = [] - link_ids = re.findall(r"onclick=\"getFile\(\'([0-9]{7}-.{8})\'\);changeBackgroundColor", self.html) + if not len(link_ids) > 0: + self.retry() + + self.correctCaptcha() + + links = [] for id in link_ids: - new_link = unescape(re.search(r"name=\"file\" src=\"(.*)\"></frame>", self.req.load("http://rs-layer.com/link-" + id + ".html")).group(1)) - print new_link - temp_links.append(new_link) - self.links = temp_links + self.log.debug("ID: %s" % id) + new_link = unescape(re.search(r"<iframe style=\"width: 100%; height: 100%;\" src=\"(.*)\"></frame>", self.req.load("http://rs-layer.com/link-" + id + ".html")).group(1)) + self.log.debug("Link: %s" % new_link) + links.append(new_link) + + self.packages.append((self.pyfile.package().name, links, self.pyfile.package().folder)) |