summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar spoob <spoob@gmx.de> 2009-06-14 03:04:48 +0200
committerGravatar spoob <spoob@gmx.de> 2009-06-14 03:04:48 +0200
commit361b11aeac893136fea1ce19b32c1579dca5e6a4 (patch)
treebf9961c1752c017bd889302392e91e4d4d60d7be
parentadded 1kh.de container plugin (diff)
downloadpyload-361b11aeac893136fea1ce19b32c1579dca5e6a4.tar.xz
third try
-rw-r--r--Plugins/OneKhDe.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/Plugins/OneKhDe.py b/Plugins/OneKhDe.py
new file mode 100644
index 000000000..466143b34
--- /dev/null
+++ b/Plugins/OneKhDe.py
@@ -0,0 +1,38 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import re
+
+from module.unescape import unescape
+from Plugin import Plugin
+
+class OneKhDe(Plugin):
+
+ def __init__(self, parent):
+ Plugin.__init__(self, parent)
+ props = {}
+ props['name'] = "OneKhDe"
+ props['type'] = "container"
+ props['pattern'] = r"http://(www\.)?1kh.de/f/"
+ props['version'] = "0.1"
+ props['description'] = """kh.de Container Plugin"""
+ props['author_name'] = ("spoob")
+ props['author_mail'] = ("spoob@pyload.org")
+ self.props = props
+ 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
+ self.html = self.req.load(url)
+ temp_links = []
+ link_ids = re.findall(r"<a id=\"DownloadLink_(\d*)\" href=\"http://1kh.de/", self.html)
+ for id in link_ids:
+ new_link = unescape(re.search("width=\"100%\" src=\"(.*)\"></iframe>", self.req.load("http://1kh.de/l/" + id)).group(1))
+ temp_links.append(new_link)
+ self.links = temp_links