diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-06-09 01:54:40 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-06-09 01:54:40 +0200 |
commit | a86f7e287bdc5d9583e121c0010b708899971140 (patch) | |
tree | 576e971c77554028056f1e4d1059cfc8a326c5f3 /module/plugins | |
parent | [SimpleHoster] Improve checkFile (diff) | |
parent | New Crypter plugin: pasted.co (diff) | |
download | pyload-a86f7e287bdc5d9583e121c0010b708899971140.tar.xz |
Merge pull request #1469 from frederikmoellers/stable
2 new Crypter plugins: sh.st and pasted.co
Diffstat (limited to 'module/plugins')
-rw-r--r-- | module/plugins/crypter/PastedCo.py | 43 | ||||
-rw-r--r-- | module/plugins/crypter/ShSt.py | 28 |
2 files changed, 71 insertions, 0 deletions
diff --git a/module/plugins/crypter/PastedCo.py b/module/plugins/crypter/PastedCo.py new file mode 100644 index 000000000..8236345cc --- /dev/null +++ b/module/plugins/crypter/PastedCo.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- + +from module.plugins.internal.Crypter import Crypter + +import re + + +class PastedCo(Crypter): + __name__ = "PastedCo" + __type__ = "crypter" + __version__ = "0.01" + + __pattern__ = r'http://pasted\.co/\w+' + + __description__ = """Pasted.co decrypter plugin""" + __license__ = "GPLv3" + __authors__ = [("Frederik Möllers", "fred-public@posteo.de")] + + + NAME_PATTERN = r'<title>(?P<N>.+?) - .+</title>' + NAME_PATTERN = r"'save_paste' href=\"(http://pasted.co/[0-9a-f]+)/info" + + FS_URL_PREFIX = '<pre id=\'thepaste\' class="prettyprint">' + FS_URL_SUFFIX = '</pre>' + + def decrypt(self, pyfile): + package = pyfile.package() + package_name = package.name + package_folder = package.folder + html = self.load(pyfile.url, decode = True).splitlines() + fs_url = None + FS_URL_RE = re.compile('%s/fullscreen\.php\?hash=[0-9a-f]*' % pyfile.url) + for line in html: + match = FS_URL_RE.search(line) + if match: + fs_url = match.group() + break + if not fs_url: + raise Exception("Could not find pasted.co fullscreen URL!") + urls = self.load(fs_url, decode = True) + urls = urls[urls.find(PastedCo.FS_URL_PREFIX) + len(PastedCo.FS_URL_PREFIX):] + urls = urls[:urls.find(PastedCo.FS_URL_SUFFIX)].splitlines() + self.packages.append((package_name, urls, package_folder)) diff --git a/module/plugins/crypter/ShSt.py b/module/plugins/crypter/ShSt.py new file mode 100644 index 000000000..c50a437db --- /dev/null +++ b/module/plugins/crypter/ShSt.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- + +from module.plugins.internal.Crypter import Crypter + +import re + + +class ShSt(Crypter): + __name__ = "ShSt" + __type__ = "crypter" + __version__ = "0.01" + + __pattern__ = r'http://sh\.st/\w+' + + __description__ = """Sh.St decrypter plugin""" + __license__ = "GPLv3" + __authors__ = [("Frederik Möllers", "fred-public@posteo.de")] + + + NAME_PATTERN = r'<title>(?P<N>.+?) - .+</title>' + + + def decrypt(self, pyfile): + package = pyfile.package() + package_name = package.name + package_folder = package.folder + html = self.load("http://deadlockers.com/submit.php", post = { "deadlock" : self.pyfile.url }, decode = True) + self.packages.append((package_name, [html], package_folder)) |