From 1195fb68b638b05a912d2074cd62d9e75bb7508b Mon Sep 17 00:00:00 2001 From: godofdream Date: Wed, 29 Aug 2012 01:58:17 +0200 Subject: Added DuckcryptInfo decrypter, smaller fixes --- module/plugins/crypter/DuckCryptInfo.py | 57 +++++++++++++++++++++++++++++++ module/plugins/crypter/TrailerzoneInfo.py | 4 +-- 2 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 module/plugins/crypter/DuckCryptInfo.py (limited to 'module/plugins/crypter') diff --git a/module/plugins/crypter/DuckCryptInfo.py b/module/plugins/crypter/DuckCryptInfo.py new file mode 100644 index 000000000..6e7166ff8 --- /dev/null +++ b/module/plugins/crypter/DuckCryptInfo.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- + +import re +from module.lib.BeautifulSoup import BeautifulSoup +from module.plugins.Crypter import Crypter + +class DuckCryptInfo(Crypter): + __name__ = "DuckCryptInfo" + __type__ = "container" + __pattern__ = r"http://(?:www\.)?duckcrypt.info/(folder|wait|link)/(\w+)/?(\w*)" + __version__ = "0.01" + __description__ = """DuckCrypt.Info Container Plugin""" + __author_name__ = ("godofdream") + __author_mail__ = ("soilfiction@gmail.com") + + TIMER_PATTERN = r'(.*)' + + def decrypt(self, pyfile): + url = pyfile.url + # seems we don't need to wait + #src = self.req.load(str(url)) + #found = re.search(self.TIMER_PATTERN, src) + #if found: + # self.logDebug("Sleeping for" % found.group(1)) + # self.setWait(int(found.group(1)) ,False) + found = re.search(self.__pattern__, url) + if not found: + self.fail('Weird error in link') + if str(found.group(1)) == "link": + self.handleLink(url) + else: + self.handleFolder(found) + + + + def handleFolder(self, found): + src = self.load("http://duckcrypt.info/ajax/auth.php?hash=" + str(found.group(2))) + found = re.search(self.__pattern__, src) + self.logDebug("Redirectet to " + str(found.group(0))) + src = self.load(str(found.group(0))) + soup = BeautifulSoup(src) + cryptlinks = soup.find("div", attrs={"class": "folderbox"}).findAll("a") + self.logDebug("Redirectet to " + str(cryptlinks)) + if not cryptlinks: + self.fail('no links found - (Plugin out of date?)') + for clink in cryptlinks: + self.handleLink(clink['href']) + + def handleLink(self, url): + src = self.load(url) + soup = BeautifulSoup(src) + link = soup.find("iframe")["src"] + if not link: + self.logDebug('no links found - (Plugin out of date?)') + else: + self.core.files.addLinks([link], self.pyfile.package().id) + diff --git a/module/plugins/crypter/TrailerzoneInfo.py b/module/plugins/crypter/TrailerzoneInfo.py index e52c5429c..2683c2429 100644 --- a/module/plugins/crypter/TrailerzoneInfo.py +++ b/module/plugins/crypter/TrailerzoneInfo.py @@ -5,9 +5,9 @@ from module.plugins.Crypter import Crypter class TrailerzoneInfo(Crypter): __name__ = "TrailerzoneInfo" - __type__ = "container" + __type__ = "crypter" __pattern__ = r"http://(www\.)?trailerzone.info/.*?" - __version__ = "0.01" + __version__ = "0.02" __description__ = """TrailerZone.info Crypter Plugin""" __author_name__ = ("godofdream") __author_mail__ = ("soilfiction@gmail.com") -- cgit v1.2.3