summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-06-19 11:30:22 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-06-19 11:30:22 +0200
commitd0bd5d1804583551887f13e2df547dfdc9d2bb3a (patch)
tree576b016995f01b7f4bd526b22bad19233bbc8c70
parentclosed #333 (diff)
downloadpyload-d0bd5d1804583551887f13e2df547dfdc9d2bb3a.tar.xz
wupload fix, rslayercom update
-rw-r--r--module/plugins/crypter/RSLayerCom.py55
-rw-r--r--module/plugins/hoster/FilesonicCom.py4
2 files changed, 35 insertions, 24 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))
diff --git a/module/plugins/hoster/FilesonicCom.py b/module/plugins/hoster/FilesonicCom.py
index d9d8340e3..6535b04f1 100644
--- a/module/plugins/hoster/FilesonicCom.py
+++ b/module/plugins/hoster/FilesonicCom.py
@@ -49,7 +49,7 @@ class FilesonicCom(Hoster):
__name__ = "FilesonicCom"
__type__ = "hoster"
__pattern__ = r"http://[\w\.]*?(sharingmatrix|filesonic)\..*?/file/(([a-z][0-9]+/)?[0-9]+)(/.*)?"
- __version__ = "0.32"
+ __version__ = "0.33"
__description__ = """FilesonicCom und Sharingmatrix Download Hoster"""
__author_name__ = ("jeix", "paulking")
__author_mail__ = ("jeix@hasnomail.de", "")
@@ -132,7 +132,7 @@ class FilesonicCom(Hoster):
if type(links) == dict:
dl = links.values()[0]["url"]
else:
- dl = [0]["url"]
+ dl = links[0]["url"]
self.download(dl)