diff options
author | Walter Purcaro <vuolter@gmail.com> | 2015-01-10 00:13:01 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2015-01-10 00:13:01 +0100 |
commit | 9f427186b8e1c1d5b7cc2e16a7087271568e4390 (patch) | |
tree | a69110149cec22e82d6dd53134198d2dc204ff0c /module/plugins/crypter | |
parent | [BasePlugin] Bump up version (diff) | |
download | pyload-9f427186b8e1c1d5b7cc2e16a7087271568e4390.tar.xz |
[MegaCoNz][MegaCoNzFolder] Improve __pattern__
Diffstat (limited to 'module/plugins/crypter')
-rw-r--r-- | module/plugins/crypter/MegaCoNzFolder.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/module/plugins/crypter/MegaCoNzFolder.py b/module/plugins/crypter/MegaCoNzFolder.py index caa2ab563..bec4eba22 100644 --- a/module/plugins/crypter/MegaCoNzFolder.py +++ b/module/plugins/crypter/MegaCoNzFolder.py @@ -1,14 +1,16 @@ # -*- coding: utf-8 -*- +import re + from module.plugins.internal.Crypter import Crypter class MegaCoNzFolder(Crypter): __name__ = "MegaCoNzFolder" __type__ = "crypter" - __version__ = "0.02" + __version__ = "0.03" - __pattern__ = r'https?://(?:www\.)?mega\.co\.nz/#F![\w+^_]![\w,\\-]+' + __pattern__ = r'(?:https?://(?:www\.)?mega\.co\.nz/|mega:|chrome:.+?)#F!(?P<ID>[\w+^_])!(?P<KEY>[\w,\\-]+)' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] @@ -22,7 +24,8 @@ class MegaCoNzFolder(Crypter): def decrypt(self, pyfile): - self.html = self.load("http://rapidgen.org/linkfinder", post={'linklisturl': self.pyfile.url}) + url = "https://mega.co.nz/#F!%s!%s" % re.match(self.__pattern__, pyfile.url).groups() + self.html = self.load("http://rapidgen.org/linkfinder", post={'linklisturl': url}) self.urls = re.findall(r'(https://mega.co.nz/#N!.+?)<', self.html) if not self.urls: #@TODO: Remove in 0.4.10 |