From 93dd69b3df109e0b909292986b69b8c50d2d7e11 Mon Sep 17 00:00:00 2001 From: mkaay Date: Tue, 1 Feb 2011 01:25:26 +0100 Subject: fixed #206 (HoerbuchIn) --- module/plugins/crypter/HoerbuchIn.py | 72 +++++++++++++++++++----------------- 1 file changed, 39 insertions(+), 33 deletions(-) (limited to 'module/plugins/crypter') diff --git a/module/plugins/crypter/HoerbuchIn.py b/module/plugins/crypter/HoerbuchIn.py index 7dd52ba40..3d876d7fe 100644 --- a/module/plugins/crypter/HoerbuchIn.py +++ b/module/plugins/crypter/HoerbuchIn.py @@ -4,43 +4,49 @@ import re from module.plugins.Crypter import Crypter +from module.lib.BeautifulSoup import BeautifulSoup, BeautifulStoneSoup class HoerbuchIn(Crypter): __name__ = "HoerbuchIn" __type__ = "container" __pattern__ = r"http://(www\.)?hoerbuch\.in/(blog\.php\?id=|download_(.*)\.html)" - __version__ = "0.4" + __version__ = "0.5" __description__ = """Hoerbuch.in Container Plugin""" - __author_name__ = ("spoob") - __author_mail__ = ("spoob@pyload.org") + __author_name__ = ("spoob", "mkaay") + __author_mail__ = ("spoob@pyload.org", "mkaay@mkaay.de") + + def decrypt(self, pyfile): + self.pyfile = pyfile + + self.html = self.req.load(self.pyfile.url) + if re.search(r"Download", self.html) is None: + self.offline() + + soup = BeautifulSoup(self.html, convertEntities=BeautifulStoneSoup.HTML_ENTITIES) + package_base = soup.find("a", attrs={"href": re.compile(self.__pattern__)}).text + + links = {} + out = re.compile("http://www.hoerbuch.in/cj/out.php\?pct=\d+&url=(http://rs\.hoerbuch\.in/.*)") + for a in soup.findAll("a", attrs={"href": out}): + part = int(a.text.replace("Part ", "")) + if not part in links.keys(): + links[part] = [] + links[part].append(out.search(a["href"]).group(1)) + + sortedLinks = {} + for mirrors in links.values(): + decrypted_mirrors = [] + for u in mirrors: + src = self.load(u) + decrypted_mirrors.append(re.search('
" + container + ":(.*?)
", self.html).group(1) - tmp = re.findall('Part \d+', download_content) - if tmp == []: continue - for link in tmp: - link_html = self.req.load(link, cookies=True) - temp_links.append(re.search('