Repository navigation
Expand file tree
/
Copy pathXFSCrypter.py
More file actions
45 lines (30 loc) · 1.57 KB
/
Copy pathXFSCrypter.py
File metadata and controls
45 lines (30 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# -*- coding: utf-8 -*-
from pyload.plugin.internal.SimpleCrypter import SimpleCrypter
class XFSCrypter(SimpleCrypter):
__name = "XFSCrypter"
__type = "crypter"
__version = "0.09"
__pattern = r'^unmatchable$'
__description = """XFileSharing decrypter plugin"""
__license = "GPLv3"
__authors = [("Walter Purcaro", "vuolter@gmail.com")]
HOSTER_DOMAIN = None
URL_REPLACEMENTS = [(r'&?per_page=\d+', ""), (r'[?/&]+$', ""), (r'(.+/[^?]+)$', r'\1?'), (r'$', r'&per_page=10000')]
LINK_PATTERN = r'<(?:td|TD).*?>\s*(?:<.+>\s*)?<a href="(.+?)".*?>.+?(?:</a>)?\s*(?:<.+>\s*)?</(?:td|TD)>'
NAME_PATTERN = r'<[Tt]itle>.*?\: (?P<N>.+) 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_DOMAIN:
if self.account:
account = self.account
else:
account_name = (self.getClassName() + ".py").replace("Folder.py", "").replace(".py", "")
account = self.pyfile.m.core.accountManager.getAccountPlugin(account_name)
if account and hasattr(account, "HOSTER_DOMAIN") and account.HOSTER_DOMAIN:
self.HOSTER_DOMAIN = account.HOSTER_DOMAIN
else:
self.fail(_("Missing HOSTER_DOMAIN"))
if isinstance(self.COOKIES, list):
self.COOKIES.insert((self.HOSTER_DOMAIN, "lang", "english"))
return super(XFSCrypter, self).prepare()