diff options
author | spoob <spoob@gmx.de> | 2009-08-02 15:08:22 +0200 |
---|---|---|
committer | spoob <spoob@gmx.de> | 2009-08-02 15:08:22 +0200 |
commit | e9a2e0825e1c2650f51559f0eeedf4135527716b (patch) | |
tree | 34a762e324efcb6de452b26955d3adf2735acac2 /Plugins/HoerbuchIn.py | |
parent | added hoerbuch.in container plugin (diff) | |
download | pyload-e9a2e0825e1c2650f51559f0eeedf4135527716b.tar.xz |
added hoerbuch.in container plugin
Diffstat (limited to 'Plugins/HoerbuchIn.py')
-rw-r--r-- | Plugins/HoerbuchIn.py | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/Plugins/HoerbuchIn.py b/Plugins/HoerbuchIn.py new file mode 100644 index 000000000..bf6711461 --- /dev/null +++ b/Plugins/HoerbuchIn.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re + +from Plugin import Plugin + +class HoerbuchIn(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "HoerbuchIn" + props['type'] = "container" + props['pattern'] = r"http://(www\.)?hoerbuch\.in/blog\.php\?id=" + props['version'] = "0.1" + props['description'] = """Hoerbuch.in 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 + html = self.req.load(url) + temp_links = [] + download_content = re.search("<BR><B>Download:</B>(.*?)<BR><B>", html).group(1) + tmp = re.findall('<A HREF="(http://www.hoerbuch.in/cj/out.php\?pct=.*?)" TARGET="_blank">Part \d+</A>', download_content) + + for link in tmp: + i = 0 + for i in range(5): + link_html = self.req.load(link, cookies=True) + link_name = link.split("/")[-1] + if re.search("<TITLE>(.*)</TITLE>", link_html).group(1) == link_name: + link_url = re.search('<FORM ACTION="(http://.*?)" METHOD="post"', link_html).group(1) + temp_links.append(link_url) + break + + self.links = temp_links |