diff options
author | Smoozed <github@smoozed.com> | 2015-01-05 16:49:39 +0100 |
---|---|---|
committer | Smoozed <github@smoozed.com> | 2015-01-05 16:49:39 +0100 |
commit | 75b6540be746d66d3fba3ab364c78addbc50c485 (patch) | |
tree | d6a53dfdd8d50605d28cb5e9301c5d3e025b77b5 /module/plugins/hooks | |
parent | Spare code improvements (diff) | |
download | pyload-75b6540be746d66d3fba3ab364c78addbc50c485.tar.xz |
Added multihoster smoozed.com
Diffstat (limited to 'module/plugins/hooks')
-rw-r--r-- | module/plugins/hooks/SmoozedCom.py | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/module/plugins/hooks/SmoozedCom.py b/module/plugins/hooks/SmoozedCom.py new file mode 100644 index 000000000..0aff36c0f --- /dev/null +++ b/module/plugins/hooks/SmoozedCom.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- + +from module.plugins.internal.MultiHook import MultiHook + + +class SmoozedCom(MultiHook): + __name__ = "SmoozedCom" + __type__ = "hook" + __version__ = "0.01" + + __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), + ("hosterList", "str", "Hoster list (comma separated)", ""), + ("unloadFailing", "bool", "Revert to stanard download if download fails", False), + ("interval", "int", "Reload interval in hours (0 to disable)", 24)] + + __description__ = """Smoozed.com hook plugin""" + __license__ = "GPLv3" + __authors__ = [] + + + 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() + account_info = self.account.getAccountInfo(user, True) + + # Return hoster list + return account_info["hoster"] + + + def coreReady(self): + # Get account plugin and check if there is a valid account available + self.account = self.core.accountManager.getAccountPlugin("SmoozedCom") + 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 multihook hook + return MultiHook.coreReady(self) |