diff options
-rw-r--r-- | Plugins/HoerbuchIn.py | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/Plugins/HoerbuchIn.py b/Plugins/HoerbuchIn.py index d318f1927..4dd01dac3 100644 --- a/Plugins/HoerbuchIn.py +++ b/Plugins/HoerbuchIn.py @@ -30,16 +30,14 @@ class HoerbuchIn(Plugin): 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: - for i in range(5): + download_container = ("Download", "Mirror #1", "Mirror #2", "Mirror #3") + for container in download_container: + download_content = re.search("<BR><B>" + container + ":</B>(.*?)<BR><B>", html).group(1) + tmp = re.findall('<A HREF="http://www.hoerbuch.in/cj/out.php\?pct=\d+&url=(http://rs\.hoerbuch\.in/.+?)" TARGET="_blank">Part \d+</A>', download_content) + if tmp == []: continue + for link in tmp: 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 + temp_links.append(re.search('<FORM ACTION="(http://.*?)" METHOD="post"', link_html).group(1)) + break self.links = temp_links |