diff options
Diffstat (limited to 'module/plugins/hooks')
-rw-r--r-- | module/plugins/hooks/EasybytezCom.py | 5 | ||||
-rw-r--r-- | module/plugins/hooks/PremiumizeMe.py | 20 | ||||
-rw-r--r-- | module/plugins/hooks/RPNetBiz.py | 20 | ||||
-rw-r--r-- | module/plugins/hooks/RehostTo.py | 15 |
4 files changed, 10 insertions, 50 deletions
diff --git a/module/plugins/hooks/EasybytezCom.py b/module/plugins/hooks/EasybytezCom.py index 16149580c..1606c9f30 100644 --- a/module/plugins/hooks/EasybytezCom.py +++ b/module/plugins/hooks/EasybytezCom.py @@ -8,7 +8,7 @@ from module.plugins.internal.MultiHook import MultiHook class EasybytezCom(MultiHook): __name__ = "EasybytezCom" __type__ = "hook" - __version__ = "0.05" + __version__ = "0.06" __config__ = [("mode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("pluginlist", "str", "Hoster list (comma separated)", "")] @@ -19,8 +19,7 @@ class EasybytezCom(MultiHook): def getHosters(self): - self.account = self.core.accountManager.getAccountPlugin(self.__name__) - user = self.account.selectAccount()[0] + user, data = self.account.selectAccount() try: req = self.account.getAccountRequest(user) diff --git a/module/plugins/hooks/PremiumizeMe.py b/module/plugins/hooks/PremiumizeMe.py index c0717afc7..d334ddd25 100644 --- a/module/plugins/hooks/PremiumizeMe.py +++ b/module/plugins/hooks/PremiumizeMe.py @@ -7,7 +7,7 @@ from module.plugins.internal.MultiHook import MultiHook class PremiumizeMe(MultiHook): __name__ = "PremiumizeMe" __type__ = "hook" - __version__ = "0.15" + __version__ = "0.16" __config__ = [("mode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), ("pluginlist", "str", "Hoster list (comma separated)", ""), @@ -20,12 +20,8 @@ class PremiumizeMe(MultiHook): def getHosters(self): - # If no accounts are available there will be no hosters available - if not self.account or not self.account.canUse(): - return [] - # Get account data - (user, data) = self.account.selectAccount() + user, data = self.account.selectAccount() # Get supported hosters list from premiumize.me using the # json API v1 (see https://secure.premiumize.me/?show=api) @@ -39,15 +35,3 @@ class PremiumizeMe(MultiHook): # Extract hosters from json file return data['result']['hosterlist'] - - - def coreReady(self): - # Get account plugin and check if there is a valid account available - self.account = self.core.accountManager.getAccountPlugin("PremiumizeMe") - if not self.account.canUse(): - self.account = None - self.logError(_("Please add a valid premiumize.me account first and restart pyLoad")) - return - - # Run the overwriten core ready which actually enables the multihoster hook - return MultiHook.coreReady(self) diff --git a/module/plugins/hooks/RPNetBiz.py b/module/plugins/hooks/RPNetBiz.py index bbbe8e128..9c88e6c01 100644 --- a/module/plugins/hooks/RPNetBiz.py +++ b/module/plugins/hooks/RPNetBiz.py @@ -7,7 +7,7 @@ from module.plugins.internal.MultiHook import MultiHook class RPNetBiz(MultiHook): __name__ = "RPNetBiz" __type__ = "hook" - __version__ = "0.12" + __version__ = "0.13" __config__ = [("mode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), ("pluginlist", "str", "Hoster list (comma separated)", ""), @@ -20,12 +20,8 @@ class RPNetBiz(MultiHook): def getHosters(self): - # No hosts supported if no account - if not self.account or not self.account.canUse(): - return [] - # Get account data - (user, data) = self.account.selectAccount() + user, data = self.account.selectAccount() res = self.getURL("https://premium.rpnet.biz/client_api.php", get={'username': user, 'password': data['password'], 'action': "showHosterList"}) @@ -37,15 +33,3 @@ class RPNetBiz(MultiHook): # Extract hosters from json file return hoster_list['hosters'] - - - def coreReady(self): - # Get account plugin and check if there is a valid account available - self.account = self.core.accountManager.getAccountPlugin("RPNetBiz") - if not self.account.canUse(): - self.account = None - self.logError(_("Please enter your %s account or deactivate this plugin") % "rpnet") - return - - # Run the overwriten core ready which actually enables the multihoster hook - return MultiHook.coreReady(self) diff --git a/module/plugins/hooks/RehostTo.py b/module/plugins/hooks/RehostTo.py index c3b626bf7..527770eb6 100644 --- a/module/plugins/hooks/RehostTo.py +++ b/module/plugins/hooks/RehostTo.py @@ -6,7 +6,7 @@ from module.plugins.internal.MultiHook import MultiHook class RehostTo(MultiHook): __name__ = "RehostTo" __type__ = "hook" - __version__ = "0.45" + __version__ = "0.46" __config__ = [("mode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("pluginlist", "str", "Hoster list (comma separated)", ""), @@ -25,16 +25,9 @@ class RehostTo(MultiHook): def coreReady(self): - self.account = self.core.accountManager.getAccountPlugin("RehostTo") + super(RehostTo, self).coreReady() - user = self.account.selectAccount()[0] + user, data = self.account.selectAccount() - if not user: - self.logError(_("Please add your rehost.to account first and restart pyLoad")) - return - - data = self.account.getAccountInfo(user) - self.ses = data['ses'] + self.ses = data['ses'] self.long_ses = data['long_ses'] - - return MultiHook.coreReady(self) |