summaryrefslogtreecommitdiffstats
path: root/module/plugins/crypter/XFileSharingProFolder.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/crypter/XFileSharingProFolder.py')
-rw-r--r--module/plugins/crypter/XFileSharingProFolder.py17
1 files changed, 6 insertions, 11 deletions
diff --git a/module/plugins/crypter/XFileSharingProFolder.py b/module/plugins/crypter/XFileSharingProFolder.py
index 55cd41931..70e7365dd 100644
--- a/module/plugins/crypter/XFileSharingProFolder.py
+++ b/module/plugins/crypter/XFileSharingProFolder.py
@@ -8,11 +8,11 @@ from module.plugins.internal.XFSCrypter import XFSCrypter, create_getInfo
class XFileSharingProFolder(XFSCrypter):
__name__ = "XFileSharingProFolder"
__type__ = "crypter"
- __version__ = "0.04"
+ __version__ = "0.08"
- __pattern__ = r'^unmatchable$'
- __config__ = [("use_subfolder", "bool", "Save package to subfolder", True),
- ("subfolder_per_package", "bool", "Create a subfolder for each package", True)]
+ __pattern__ = r'https?://(?:www\.)?(?:\w+\.)*?(?P<DOMAIN>(?:[\d.]+|[\w\-^_]{3,}(?:\.[a-zA-Z]{2,}){1,2})(?:\:\d+)?)/(?:user|folder)s?/\w+'
+ __config__ = [("use_subfolder" , "bool", "Save package to subfolder" , True),
+ ("subfolder_per_pack", "bool", "Create a subfolder for each package", True)]
__description__ = """XFileSharingPro dummy folder decrypter plugin for hook"""
__license__ = "GPLv3"
@@ -20,9 +20,7 @@ class XFileSharingProFolder(XFSCrypter):
def _log(self, type, args):
- msg = " | ".join([str(a).strip() for a in args if a])
- logger = getattr(self.log, type)
- logger("%s: %s: %s" % (self.__name__, self.HOSTER_NAME, msg or _("%s MARK" % type.upper())))
+ return super(XFileSharingProFolder, self)._log(type, (self.HOSTER_NAME,) + args)
def init(self):
@@ -31,10 +29,7 @@ class XFileSharingProFolder(XFSCrypter):
self.__pattern__ = self.core.pluginManager.crypterPlugins[self.__name__]['pattern']
self.HOSTER_DOMAIN = re.match(self.__pattern__, self.pyfile.url).group("DOMAIN").lower()
- self.HOSTER_NAME = "".join([part.capitalize() for part in re.split(r'(\.|\d+)', self.HOSTER_DOMAIN) if part != '.'])
-
- if self.HOSTER_NAME[0].isdigit():
- self.HOSTER_NAME = 'X' + self.HOSTER_NAME
+ self.HOSTER_NAME = "".join(part.capitalize() for part in re.split(r'(\.|\d+)', self.HOSTER_DOMAIN) if part != '.')
account = self.core.accountManager.getAccountPlugin(self.HOSTER_NAME)