summaryrefslogtreecommitdiffstats
path: root/module/plugins/crypter/HoerbuchIn.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/crypter/HoerbuchIn.py')
-rw-r--r--module/plugins/crypter/HoerbuchIn.py30
1 files changed, 18 insertions, 12 deletions
diff --git a/module/plugins/crypter/HoerbuchIn.py b/module/plugins/crypter/HoerbuchIn.py
index 88fc57244..a347e4232 100644
--- a/module/plugins/crypter/HoerbuchIn.py
+++ b/module/plugins/crypter/HoerbuchIn.py
@@ -2,20 +2,25 @@
import re
+from BeautifulSoup import BeautifulSoup, BeautifulStoneSoup
+
from module.plugins.Crypter import Crypter
-from module.lib.BeautifulSoup import BeautifulSoup, BeautifulStoneSoup
class HoerbuchIn(Crypter):
- __name__ = "HoerbuchIn"
- __version__ = "0.6"
- __type__ = "crypter"
+ __name__ = "HoerbuchIn"
+ __type__ = "crypter"
+ __version__ = "0.60"
- __pattern__ = r'http://(?:www\.)?hoerbuch\.in/(wp/horbucher/\d+/.+/|tp/out.php\?.+|protection/folder_\d+\.html)'
+ __pattern__ = r'http://(?:www\.)?hoerbuch\.in/(wp/horbucher/\d+/.+/|tp/out\.php\?.+|protection/folder_\d+\.html)'
+ __config__ = [("use_subfolder", "bool", "Save package to subfolder", True),
+ ("subfolder_per_package", "bool", "Create a subfolder for each package", True)]
__description__ = """Hoerbuch.in decrypter plugin"""
- __author_name__ = ("spoob", "mkaay")
- __author_mail__ = ("spoob@pyload.org", "mkaay@mkaay.de")
+ __license__ = "GPLv3"
+ __authors__ = [("spoob", "spoob@pyload.org"),
+ ("mkaay", "mkaay@mkaay.de")]
+
article = re.compile("http://(?:www\.)?hoerbuch\.in/wp/horbucher/\d+/.+/")
protection = re.compile("http://(?:www\.)?hoerbuch\.in/protection/folder_\d+.html")
@@ -25,8 +30,8 @@ class HoerbuchIn(Crypter):
self.pyfile = pyfile
if self.article.match(pyfile.url):
- src = self.load(pyfile.url)
- soup = BeautifulSoup(src, convertEntities=BeautifulStoneSoup.HTML_ENTITIES)
+ html = self.load(pyfile.url)
+ soup = BeautifulSoup(html, convertEntities=BeautifulStoneSoup.HTML_ENTITIES)
abookname = soup.find("a", attrs={"rel": "bookmark"}).text
for a in soup.findAll("a", attrs={"href": self.protection}):
@@ -37,18 +42,19 @@ class HoerbuchIn(Crypter):
else:
self.urls = self.decryptFolder(pyfile.url)
+
def decryptFolder(self, url):
m = self.protection.search(url)
if m is None:
- self.fail("Bad URL")
+ self.fail(_("Bad URL"))
url = m.group(0)
self.pyfile.url = url
- src = self.req.load(url, post={"viewed": "adpg"})
+ html = self.load(url, post={"viewed": "adpg"})
links = []
pattern = re.compile("http://www\.hoerbuch\.in/protection/(\w+)/(.*?)\"")
- for hoster, lid in pattern.findall(src):
+ for hoster, lid in pattern.findall(html):
self.req.lastURL = url
self.load("http://www.hoerbuch.in/protection/%s/%s" % (hoster, lid))
links.append(self.req.lastEffectiveURL)