diff options
author | Walter Purcaro <vuolter@gmail.com> | 2015-01-08 23:34:54 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2015-01-08 23:34:54 +0100 |
commit | 29079852619040ef862554ec261b03b34cbed852 (patch) | |
tree | d84c81c727d9af6f93b9e2a2d66ecd85b5f26785 /module/plugins/crypter/XFileSharingProFolder.py | |
parent | "New Year" Update: account plugins (diff) | |
download | pyload-29079852619040ef862554ec261b03b34cbed852.tar.xz |
"New Year" Update: crypter plugins
Diffstat (limited to 'module/plugins/crypter/XFileSharingProFolder.py')
-rw-r--r-- | module/plugins/crypter/XFileSharingProFolder.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/module/plugins/crypter/XFileSharingProFolder.py b/module/plugins/crypter/XFileSharingProFolder.py index 10e4d8c83..5ad9f7678 100644 --- a/module/plugins/crypter/XFileSharingProFolder.py +++ b/module/plugins/crypter/XFileSharingProFolder.py @@ -8,7 +8,7 @@ from module.plugins.internal.XFSCrypter import XFSCrypter, create_getInfo class XFileSharingProFolder(XFSCrypter): __name__ = "XFileSharingProFolder" __type__ = "crypter" - __version__ = "0.03" + __version__ = "0.04" __pattern__ = r'^unmatchable$' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), @@ -30,21 +30,26 @@ class XFileSharingProFolder(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 = '_' + 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) |