summaryrefslogtreecommitdiffstats
path: root/module/plugins/hooks/SmoozedCom.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2015-01-05 23:51:32 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2015-01-05 23:51:32 +0100
commit905eb08ba4db5eb50971dc4c0c1a1c3367d93885 (patch)
treeaa2b0a6f097a03f75bec3b45eb2904c46b9cf11a /module/plugins/hooks/SmoozedCom.py
parentMerge pull request #1015 from sahilshekhawat/stable (diff)
parentAdded multihoster smoozed.com (diff)
downloadpyload-905eb08ba4db5eb50971dc4c0c1a1c3367d93885.tar.xz
Merge pull request #1013 from smoozed/stable
New plugin: SmoozedCom
Diffstat (limited to 'module/plugins/hooks/SmoozedCom.py')
-rw-r--r--module/plugins/hooks/SmoozedCom.py43
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)