diff options
author | Christopher <4Christopher@gmx.de> | 2013-03-26 19:23:41 +0100 |
---|---|---|
committer | Christopher <4Christopher@gmx.de> | 2013-03-26 19:23:41 +0100 |
commit | 866d30eb0e6a8868a4f2eb1da3c91734d6b9d716 (patch) | |
tree | 2233ea2329e779761abb5dc8e08afee97973dc61 /module/plugins/crypter | |
parent | Movie2kTo: Added setting for quality in the folder name. (diff) | |
parent | Merge pull request #53 from enkore/stable (diff) | |
download | pyload-866d30eb0e6a8868a4f2eb1da3c91734d6b9d716.tar.xz |
Merge branch 'stable' of git://github.com/pyload/pyload into stable
Diffstat (limited to 'module/plugins/crypter')
-rw-r--r-- | module/plugins/crypter/FourChanOrg.py | 38 | ||||
-rw-r--r-- | module/plugins/crypter/LixIn.py | 19 | ||||
-rw-r--r-- | module/plugins/crypter/TrailerzoneInfo.py | 4 |
3 files changed, 23 insertions, 38 deletions
diff --git a/module/plugins/crypter/FourChanOrg.py b/module/plugins/crypter/FourChanOrg.py index cbcdd920c..5c96e723d 100644 --- a/module/plugins/crypter/FourChanOrg.py +++ b/module/plugins/crypter/FourChanOrg.py @@ -6,34 +6,20 @@ import re from module.plugins.Crypter import Crypter class FourChanOrg(Crypter): + # Based on 4chandl by Roland Beermann + # https://gist.github.com/enkore/3492599 __name__ = "FourChanOrg" __type__ = "container" - __pattern__ = r"http://(www\.)?(img\.)?(zip\.)?4chan.org/\w+/(res/|imgboard\.html)" - __version__ = "0.1" - __description__ = """4chan.org Thread Download Plugin""" - __author_name__ = ("Spoob") - __author_mail__ = ("Spoob@pyload.org") + __version__ = "0.3" + __pattern__ = r"http://boards\.4chan.org/\w+/res/(\d+)" + __description__ = "Downloader for entire 4chan threads" - def __init__(self, parent): - Crypter.__init__(self, parent) - self.parent = parent - self.html = None + def decrypt(self, pyfile): + pagehtml = self.load(pyfile.url) - def file_exists(self): - """ returns True or False - """ - return True + images = set(re.findall(r'(images\.4chan\.org/[^/]*/src/[^"<]*)', pagehtml)) + urls = [] + for image in images: + urls.append("http://" + image) - def proceed(self, url, location): - url = self.parent.url - html = self.req.load(url) - link_pattern = "" - temp_links = [] - if "imagebord.html" in url: - link_pattern = '[<a href="(res/\d*\.html)">Reply</a>]' - temp_links = re.findall(link_pattern, html) - for link in re.findall(link_pattern, html): - temp_links.append(link) - else: - temp_links = re.findall('File : <a href="(http://(?:img\.)?(?:zip\.)?4chan\.org/\w{,3}/src/\d*\..{3})"', html) - self.links = temp_links + self.core.files.addLinks(urls, self.pyfile.package().id) diff --git a/module/plugins/crypter/LixIn.py b/module/plugins/crypter/LixIn.py index 1ed5510fd..e2ee30731 100644 --- a/module/plugins/crypter/LixIn.py +++ b/module/plugins/crypter/LixIn.py @@ -33,7 +33,7 @@ class LixIn(Crypter): matches = re.search(self.SUBMIT_PATTERN,self.html) if not matches: - self.fail("link doesn't seem valid") + self.fail("link doesn't seem valid") matches = re.search(self.CAPTCHA_PATTERN, self.html) if matches: @@ -42,20 +42,19 @@ class LixIn(Crypter): if matches: self.logDebug("trying captcha") captcharesult = self.decryptCaptcha("http://lix.in/"+matches.group("image")) - self.html = self.req.load(url, decode=True, post={"capt" : captcharesult, "submit":"submit","tiny":id}) - else: - self.logDebug("no captcha/captcha solved") - break - else: + self.html = self.req.load(url, decode=True, post={"capt" : captcharesult, "submit":"submit","tiny":id}) + else: + self.logDebug("no captcha/captcha solved") + break + else: self.html = self.req.load(url, decode=True, post={"submit" : "submit", - "tiny" : id}) - + "tiny" : id}) + matches = re.search(self.LINK_PATTERN, self.html) if not matches: - self.fail("can't find destination url") + self.fail("can't find destination url") new_link = matches.group("link") self.logDebug("Found link %s, adding to package" % new_link) self.packages.append((self.pyfile.package().name, [new_link], self.pyfile.package().name)) -
\ No newline at end of file diff --git a/module/plugins/crypter/TrailerzoneInfo.py b/module/plugins/crypter/TrailerzoneInfo.py index 2683c2429..43a4fcce5 100644 --- a/module/plugins/crypter/TrailerzoneInfo.py +++ b/module/plugins/crypter/TrailerzoneInfo.py @@ -22,10 +22,10 @@ class TrailerzoneInfo(Crypter): self.handleProtect(url) elif goPattern.match(url): self.handleGo(url) - + def handleProtect(self, url): self.handleGo("http://trailerzone.info/go.html#:::" + url.split("#:::",1)[1]) - + def handleGo(self, url): src = self.req.load(str(url)) |