summaryrefslogtreecommitdiffstats
path: root/module/plugins/crypter/XFileSharingPro.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/crypter/XFileSharingPro.py')
-rw-r--r--module/plugins/crypter/XFileSharingPro.py22
1 files changed, 15 insertions, 7 deletions
diff --git a/module/plugins/crypter/XFileSharingPro.py b/module/plugins/crypter/XFileSharingPro.py
index 7cf3cde57..a965f0c48 100644
--- a/module/plugins/crypter/XFileSharingPro.py
+++ b/module/plugins/crypter/XFileSharingPro.py
@@ -2,13 +2,13 @@
import re
-from pyload.plugin.internal.XFSCrypter import XFSCrypter
+from module.plugins.internal.XFSCrypter import XFSCrypter, create_getInfo
class XFileSharingPro(XFSCrypter):
__name__ = "XFileSharingPro"
__type__ = "crypter"
- __version__ = "0.03"
+ __version__ = "0.04"
__pattern__ = r'^unmatchable$'
__config__ = [("use_subfolder", "bool", "Save package to subfolder", True),
@@ -20,7 +20,7 @@ class XFileSharingPro(XFSCrypter):
def _log(self, type, args):
- msg = " | ".join([str(a).strip() for a in args if a])
+ 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())))
@@ -30,18 +30,26 @@ class XFileSharingPro(XFSCrypter):
self.__pattern__ = self.core.pluginManager.crypterPlugins[self.__name__]['pattern']
- self.HOSTER_DOMAIN = re.match(self.__pattern__, self.pyfile.url).group(1).lower()
- self.HOSTER_NAME = "".join([str.capitalize() for str in self.HOSTER_DOMAIN.split('.')])
+ 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
account = self.core.accountManager.getAccountPlugin(self.HOSTER_NAME)
if account and account.canUse():
self.account = account
+
elif self.account:
self.account.HOSTER_DOMAIN = self.HOSTER_DOMAIN
+
else:
return
self.user, data = self.account.selectAccount()
- self.req = self.account.getAccountRequest(self.user)
- self.premium = self.account.isPremium(self.user)
+ self.req = self.account.getAccountRequest(self.user)
+ self.premium = self.account.isPremium(self.user)
+
+
+getInfo = create_getInfo(XFileSharingProFolder)