diff options
Diffstat (limited to 'module/plugins/internal')
| -rw-r--r-- | module/plugins/internal/SimpleCrypter.py | 2 | ||||
| -rw-r--r-- | module/plugins/internal/XFSPCrypter.py | 39 | 
2 files changed, 41 insertions, 0 deletions
| diff --git a/module/plugins/internal/SimpleCrypter.py b/module/plugins/internal/SimpleCrypter.py index 8139d661d..73329ed65 100644 --- a/module/plugins/internal/SimpleCrypter.py +++ b/module/plugins/internal/SimpleCrypter.py @@ -51,6 +51,8 @@ class SimpleCrypter(Crypter):            return the html of the page number page_n      """ +    LINK_PATTERN = None +      TITLE_REPLACEMENTS = [("&#?\w+;", fixup)]      URL_REPLACEMENTS = [] 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() | 
