diff options
| author | 2014-10-18 16:29:41 +0200 | |
|---|---|---|
| committer | 2014-10-18 16:29:41 +0200 | |
| commit | 8edb5481e04da44a227e18c76fc4073297721f4f (patch) | |
| tree | 5671cc00785a3945d0001e56567f8063057e38cf /module | |
| parent | [XFileSharingPro][XFileSharingProFolder] Account pairing routine (diff) | |
| download | pyload-8edb5481e04da44a227e18c76fc4073297721f4f.tar.xz | |
[XFileSharingPro] Fixes
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): | 
