diff options
Diffstat (limited to 'module')
-rw-r--r-- | module/plugins/accounts/XFileSharingPro.py | 18 | ||||
-rw-r--r-- | module/plugins/crypter/XFileSharingProFolder.py | 14 | ||||
-rw-r--r-- | module/plugins/hoster/XFileSharingPro.py | 14 |
3 files changed, 32 insertions, 14 deletions
diff --git a/module/plugins/accounts/XFileSharingPro.py b/module/plugins/accounts/XFileSharingPro.py index d5a62c3a4..5be377c40 100644 --- a/module/plugins/accounts/XFileSharingPro.py +++ b/module/plugins/accounts/XFileSharingPro.py @@ -10,11 +10,21 @@ class XFileSharingPro(XFSPAccount): __type__ = "account" __version__ = "0.02" - __description__ = """XFileSharingPro multi-purpose account plugin""" + __description__ = """XFileSharingPro dummy account plugin""" __license__ = "GPLv3" __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - def init(self): - pattern = self.core.pluginManager.hosterPlugins[self.__name__]['pattern'] - self.HOSTER_NAME = re.match(pattern, self.pyfile.url).group(1).lower() + HOSTER_NAME = None + + + def loadAccountInfo(self, user, req): + if self.HOSTER_NAME: + return super(XFileSharingPro, self).loadAccountInfo(user, req) + else: + return {'validuntil': None, 'trafficleft': None, 'premium': None} + + + def login(self, user, data, req): + if self.HOSTER_NAME: + return super(XFileSharingPro, self).login(user, data, req) diff --git a/module/plugins/crypter/XFileSharingProFolder.py b/module/plugins/crypter/XFileSharingProFolder.py index ba8c7b8b7..e6fb2a7a5 100644 --- a/module/plugins/crypter/XFileSharingProFolder.py +++ b/module/plugins/crypter/XFileSharingProFolder.py @@ -22,9 +22,13 @@ class XFileSharingProFolder(XFSPCrypter): self.HOSTER_NAME = re.match(self.__pattern__, self.pyfile.url).group(1).lower() account_name = "".join([str.capitalize() for str in self.HOSTER_NAME.split('.')]) - self.account = self.core.accountManager.getAccountPlugin(account_name) + account = self.core.accountManager.getAccountPlugin(account_name) - if self.account and self.account.canUse(): - self.user, data = self.account.selectAccount() - self.req = self.account.getAccountRequest(self.user) - self.premium = self.account.isPremium(self.user) + if account and account.canUse(): + self.user, data = account.selectAccount() + self.req = account.getAccountRequest(self.user) + self.premium = account.isPremium(self.user) + + self.account = account + else: + self.account.HOSTER_NAME = self.HOSTER_NAME diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index 4eb6e95d3..fc348c90f 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -25,12 +25,16 @@ class XFileSharingPro(XFSPHoster): self.HOSTER_NAME = re.match(self.__pattern__, self.pyfile.url).group(1).lower() account_name = "".join([str.capitalize() for str in self.HOSTER_NAME.split('.')]) - self.account = self.core.accountManager.getAccountPlugin(account_name) + account = self.core.accountManager.getAccountPlugin(account_name) - if self.account and self.account.canUse(): - self.user, data = self.account.selectAccount() - self.req = self.account.getAccountRequest(self.user) - self.premium = self.account.isPremium(self.user) + if account and account.canUse(): + self.user, data = account.selectAccount() + self.req = account.getAccountRequest(self.user) + self.premium = account.isPremium(self.user) + + self.account = account + else: + self.account.HOSTER_NAME = self.HOSTER_NAME def setup(self): |