diff options
Diffstat (limited to 'pyload/plugins/crypter/DuckCryptInfo.py')
-rw-r--r-- | pyload/plugins/crypter/DuckCryptInfo.py | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/pyload/plugins/crypter/DuckCryptInfo.py b/pyload/plugins/crypter/DuckCryptInfo.py index fc917929a..6873fd5d3 100644 --- a/pyload/plugins/crypter/DuckCryptInfo.py +++ b/pyload/plugins/crypter/DuckCryptInfo.py @@ -8,14 +8,17 @@ from pyload.plugins.base.Crypter import Crypter class DuckCryptInfo(Crypter): - __name__ = "DuckCryptInfo" - __type__ = "crypter" + __name__ = "DuckCryptInfo" + __type__ = "crypter" __version__ = "0.02" - __pattern__ = r'http://(?:www\.)?duckcrypt.info/(folder|wait|link)/(\w+)/?(\w*)' + __pattern__ = r'http://(?:www\.)?duckcrypt\.info/(folder|wait|link)/(\w+)/?(\w*)' + __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), + ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] __description__ = """DuckCrypt.info decrypter plugin""" - __authors__ = [("godofdream", "soilfiction@gmail.com")] + __license__ = "GPLv3" + __authors__ = [("godofdream", "soilfiction@gmail.com")] TIMER_PATTERN = r'<span id="timer">(.*)</span>' @@ -26,29 +29,31 @@ class DuckCryptInfo(Crypter): m = re.match(self.__pattern__, url) if m is None: - self.fail('Weird error in link') + self.fail(_("Weird error in link")) if str(m.group(1)) == "link": self.handleLink(url) else: self.handleFolder(m) + def handleFolder(self, m): - src = self.load("http://duckcrypt.info/ajax/auth.php?hash=" + str(m.group(2))) - m = re.match(self.__pattern__, src) + html = self.load("http://duckcrypt.info/ajax/auth.php?hash=" + str(m.group(2))) + m = re.match(self.__pattern__, html) self.logDebug("Redirectet to " + str(m.group(0))) - src = self.load(str(m.group(0))) - soup = BeautifulSoup(src) + html = self.load(str(m.group(0))) + soup = BeautifulSoup(html) cryptlinks = soup.findAll("div", attrs={"class": "folderbox"}) self.logDebug("Redirectet to " + str(cryptlinks)) if not cryptlinks: - self.fail('no links m - (Plugin out of date?)') + self.error(_("No link found")) for clink in cryptlinks: if clink.find("a"): self.handleLink(clink.find("a")['href']) + def handleLink(self, url): - src = self.load(url) - soup = BeautifulSoup(src) + html = self.load(url) + soup = BeautifulSoup(html) self.urls = [soup.find("iframe")['src']] if not self.urls: - self.logDebug("No link found - (Plugin out of date?)") + self.logInfo(_("No link found")) |