From 75b6540be746d66d3fba3ab364c78addbc50c485 Mon Sep 17 00:00:00 2001 From: Smoozed Date: Mon, 5 Jan 2015 16:49:39 +0100 Subject: Added multihoster smoozed.com --- module/plugins/hooks/SmoozedCom.py | 43 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 module/plugins/hooks/SmoozedCom.py (limited to 'module/plugins/hooks/SmoozedCom.py') 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) -- cgit v1.2.3 From e977be3c78ea9d976e9b2338244b214a4b3a5199 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 8 Jan 2015 23:40:17 +0100 Subject: "New Year" Update: hook plugins --- module/plugins/hooks/SmoozedCom.py | 39 +++++++++++--------------------------- 1 file changed, 11 insertions(+), 28 deletions(-) (limited to 'module/plugins/hooks/SmoozedCom.py') diff --git a/module/plugins/hooks/SmoozedCom.py b/module/plugins/hooks/SmoozedCom.py index 0aff36c0f..4e706c959 100644 --- a/module/plugins/hooks/SmoozedCom.py +++ b/module/plugins/hooks/SmoozedCom.py @@ -6,38 +6,21 @@ from module.plugins.internal.MultiHook import MultiHook class SmoozedCom(MultiHook): __name__ = "SmoozedCom" __type__ = "hook" - __version__ = "0.01" + __version__ = "0.02" - __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)] + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), + ("revertfailed" , "bool" , "Revert to standard download if fails", True ), + ("retry" , "int" , "Number of retries before revert" , 10 ), + ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] __description__ = """Smoozed.com hook plugin""" __license__ = "GPLv3" - __authors__ = [] + __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) + user, data = self.account.selectAccount() + return self.account.getAccountData(user)["hosters"] -- cgit v1.2.3 From 187586c77f750340c2d8c84781c82a3e612f17c3 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 11 Jan 2015 20:20:43 +0100 Subject: Fix getAccount in some plugins --- module/plugins/hooks/SmoozedCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks/SmoozedCom.py') diff --git a/module/plugins/hooks/SmoozedCom.py b/module/plugins/hooks/SmoozedCom.py index 4e706c959..9ba2daac9 100644 --- a/module/plugins/hooks/SmoozedCom.py +++ b/module/plugins/hooks/SmoozedCom.py @@ -6,7 +6,7 @@ from module.plugins.internal.MultiHook import MultiHook class SmoozedCom(MultiHook): __name__ = "SmoozedCom" __type__ = "hook" - __version__ = "0.02" + __version__ = "0.03" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), @@ -23,4 +23,4 @@ class SmoozedCom(MultiHook): def getHosters(self): user, data = self.account.selectAccount() - return self.account.getAccountData(user)["hosters"] + return self.account.getAccountInfo(user)["hosters"] -- cgit v1.2.3