From 9a4aa10da480d9bb07592352fb22ebd2acf5dc84 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 17 Oct 2014 20:51:35 +0200 Subject: New internal plugin XFSPCrypter --- module/plugins/internal/XFSPCrypter.py | 39 ++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 module/plugins/internal/XFSPCrypter.py (limited to 'module/plugins/internal') 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' + + 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'.+?(?:)?\s*' + self.LINK_PATTERN = pattern % self.HOSTER_NAME + + super(XFSPCrypter, self).prepare() -- cgit v1.2.3