summaryrefslogtreecommitdiffstats
path: root/module/plugins
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2015-01-10 00:13:01 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2015-01-10 00:13:01 +0100
commit9f427186b8e1c1d5b7cc2e16a7087271568e4390 (patch)
treea69110149cec22e82d6dd53134198d2dc204ff0c /module/plugins
parent[BasePlugin] Bump up version (diff)
downloadpyload-9f427186b8e1c1d5b7cc2e16a7087271568e4390.tar.xz
[MegaCoNz][MegaCoNzFolder] Improve __pattern__
Diffstat (limited to 'module/plugins')
-rw-r--r--module/plugins/crypter/MegaCoNzFolder.py9
-rw-r--r--module/plugins/hoster/MegaCoNz.py4
2 files changed, 8 insertions, 5 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
diff --git a/module/plugins/hoster/MegaCoNz.py b/module/plugins/hoster/MegaCoNz.py
index ed334601a..9e23e0361 100644
--- a/module/plugins/hoster/MegaCoNz.py
+++ b/module/plugins/hoster/MegaCoNz.py
@@ -49,9 +49,9 @@ from module.utils import decode, fs_decode, fs_encode
class MegaCoNz(Hoster):
__name__ = "MegaCoNz"
__type__ = "hoster"
- __version__ = "0.24"
+ __version__ = "0.25"
- __pattern__ = r'https?://(?:www\.)?mega\.co\.nz/#(?P<TYPE>N|)!(?P<ID>[\w^_]+)!(?P<KEY>[\w,\\-]+)'
+ __pattern__ = r'(?:https?://(?:www\.)?mega\.co\.nz/|mega:|chrome:.+?)#(?P<TYPE>N|)!(?P<ID>[\w^_]+)!(?P<KEY>[\w,\\-]+)'
__description__ = """Mega.co.nz hoster plugin"""
__license__ = "GPLv3"