From b94736fb2eb60bf2346c2adcd697799e5705a462 Mon Sep 17 00:00:00 2001 From: Stefano Date: Mon, 18 Feb 2013 12:28:21 -0800 Subject: Crypter for SpeedLoadOrg Folders --- module/plugins/crypter/SpeedLoadOrgFolder.py | 47 ++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 module/plugins/crypter/SpeedLoadOrgFolder.py diff --git a/module/plugins/crypter/SpeedLoadOrgFolder.py b/module/plugins/crypter/SpeedLoadOrgFolder.py new file mode 100644 index 000000000..002605233 --- /dev/null +++ b/module/plugins/crypter/SpeedLoadOrgFolder.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- + +from module.plugins.Crypter import Crypter +import re + +class SpeedLoadOrgFolder(Crypter): + __name__ = "SpeedLoadOrgFolder" + __type__ = "crypter" + __pattern__ = r"http://(www\.)?speedload\.org/(?P\w+)~f$" + __version__ = "0.1" + __description__ = """Speedload Crypter Plugin""" + __author_name__ = ("stickell") + __author_mail__ = ("l.stickell@yahoo.it") + + def decrypt(self, pyfile): + self.html = self.load(pyfile.url) + (package_name, folder_name) = self.getPackageNameAndFolder() + package_links = self.getLinks() + + self.packages = [(package_name, package_links, folder_name)] + + def getPackageNameAndFolder(self): + title_re = r"Files Within Folder '(?P.+)'" + m = re.search(title_re, self.html) + if m is not None: + name = folder = m.group('title') + self.logDebug("Found name [%s] and folder [%s] in package info" % (name, folder)) + return name, folder + else: + name = self.pyfile.package().name + folder = self.pyfile.package().folder + self.logDebug("Package info not found, defaulting to pyfile name [%s] and folder [%s]" % (name, folder)) + return name, folder + + def getLinks(self): + pages = int(re.search('Total Pages (\d)', self.html).group(1)) + + link_regex = re.compile('<a href="(http://speedload.org/\w+)"') + links = link_regex.findall(self.html) + + if pages > 1: + for p in range(2, pages + 1): + self.html = self.load(self.pyfile.url + '?page=%d' % p) + links += link_regex.findall(self.html) + + self.logDebug("Package has %d links" % len(links)) + return links -- cgit v1.2.3