summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-10-17 20:51:35 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-10-17 20:51:35 +0200
commit9a4aa10da480d9bb07592352fb22ebd2acf5dc84 (patch)
tree539947cf715bd944d2b09c765d850cb809ed1a25 /module
parentFix trafficleft size in some account plugins (diff)
downloadpyload-9a4aa10da480d9bb07592352fb22ebd2acf5dc84.tar.xz
New internal plugin XFSPCrypter
Diffstat (limited to 'module')
-rw-r--r--module/plugins/internal/XFSPCrypter.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/module/plugins/internal/XFSPCrypter.py b/module/plugins/internal/XFSPCrypter.py
new file mode 100644
index 000000000..4c5fff4f3
--- /dev/null
+++ b/module/plugins/internal/XFSPCrypter.py
@@ -0,0 +1,39 @@
+# -*- coding: utf-8 -*-
+
+from module.plugins.internal.SimpleCrypter import SimpleCrypter
+
+
+class XFSPCrypter(SimpleCrypter):
+ __name__ = "XFSPCrypter"
+ __type__ = "crypter"
+ __version__ = "0.01"
+
+ __pattern__ = None
+
+ __description__ = """XFileSharingPro decrypter plugin"""
+ __license__ = "GPLv3"
+ __authors__ = [("Walter Purcaro", "vuolter@gmail.com")]
+
+
+ HOSTER_NAME = None
+
+ URL_REPLACEMENTS = [(r'[?/&]+$', r''), (r'(.+/[^?]*)$', r'\1?'), (r'$', r'&per_page=10000')]
+
+ COOKIES = [(HOSTER_NAME, "lang", "english")]
+
+ LINK_PATTERN = None
+ TITLE_PATTERN = r'<[tT]itle>.*?\: (.+) folder</[tT]itle>'
+
+ OFFLINE_PATTERN = r'>\s*\w+ (Not Found|file (was|has been) removed)'
+ TEMP_OFFLINE_PATTERN = r'>\s*\w+ server (is in )?(maintenance|maintainance)'
+
+
+ def prepare(self):
+ if not self.HOSTER_NAME:
+ self.fail("Missing HOSTER_NAME")
+
+ if not self.LINK_PATTERN:
+ pattern = r'<a href="(.+?)" target="_blank">.+?(?:</a>)?\s*</(?:td|TD)>'
+ self.LINK_PATTERN = pattern % self.HOSTER_NAME
+
+ super(XFSPCrypter, self).prepare()