summaryrefslogtreecommitdiffstats
path: root/core/module/plugins/crypter/FourChanOrg.py
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2010-08-25 16:48:55 +0200
committerGravatar mkaay <mkaay@mkaay.de> 2010-08-25 16:48:55 +0200
commit3c9f55270a83b0e88ec0dc516f9d9921e4d7b6ea (patch)
treec5b2b1bfeb7eb8df2b97be118f6cbcec4e29cb3b /core/module/plugins/crypter/FourChanOrg.py
parentul.to fetching, so.biz expire (diff)
downloadpyload-3c9f55270a83b0e88ec0dc516f9d9921e4d7b6ea.tar.xz
merged gui
Diffstat (limited to 'core/module/plugins/crypter/FourChanOrg.py')
-rw-r--r--core/module/plugins/crypter/FourChanOrg.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/core/module/plugins/crypter/FourChanOrg.py b/core/module/plugins/crypter/FourChanOrg.py
new file mode 100644
index 000000000..cbcdd920c
--- /dev/null
+++ b/core/module/plugins/crypter/FourChanOrg.py
@@ -0,0 +1,39 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import re
+
+from module.plugins.Crypter import Crypter
+
+class FourChanOrg(Crypter):
+ __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")
+
+ def __init__(self, parent):
+ Crypter.__init__(self, parent)
+ self.parent = parent
+ self.html = None
+
+ def file_exists(self):
+ """ returns True or False
+ """
+ return True
+
+ 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