From b9c2bcfc1862b4bef6feff224603420ab2eed6d9 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Tue, 30 Dec 2014 21:25:24 +0100 Subject: fix MultiHoster to MultiHook transition --- module/plugins/hooks/NoPremiumPl.py | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/module/plugins/hooks/NoPremiumPl.py b/module/plugins/hooks/NoPremiumPl.py index 84a019b8d..7742e03f7 100644 --- a/module/plugins/hooks/NoPremiumPl.py +++ b/module/plugins/hooks/NoPremiumPl.py @@ -1,31 +1,28 @@ # -*- coding: utf-8 -*- -from module.plugins.internal.MultiHoster import MultiHoster -from module.network.RequestFactory import getURL +from module.plugins.internal.MultiHook import MultiHook from module.common.json_layer import json_loads as loads -class NoPremiumPl(MultiHoster): +class NoPremiumPl(MultiHook): __name__ = "NoPremiumPl" __version__ = "0.01" __type__ = "hook" - __config__ = [("activated", "bool", "Activated", "False"), + __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), ("hosterList", "str", "Hoster list (comma separated)", ""), - ("unloadFailing", "bool", "Try standard download if download fails", "False"), - ("interval", "int", "Reload supported hosts interval in hours (0 to disable)", "24")] + ("unloadFailing", "bool", "Try standard download if download fails", False), + ("interval", "int", "Reload supported hosts interval in hours (0 to disable)", 24)] __description__ = "NoPremium.pl hook" __license__ = "GPLv3" __authors__ = [("goddie", "dev@nopremium.pl")] - def getHoster(self): - hostings = loads(getURL("https://www.nopremium.pl/clipboard.php?json=3").strip()) - - return [domain for row in hostings for domain in row["domains"] if row["sdownload"] == "0"] - - def getHosterCached(self): - return self.getHoster() + def getHosters(self): + hostings = loads(self.getURL("https://www.nopremium.pl/clipboard.php?json=3").strip()) + hostings_domains = [domain for row in hostings for domain in row["domains"] if row["sdownload"] == "0"] + self.logDebug(hostings_domains) + return hostings_domains -- cgit v1.2.3 From 2a6404851c5ce4e9421b183805fd3c55cd5641f3 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Tue, 30 Dec 2014 21:28:40 +0100 Subject: version bump --- module/plugins/hooks/NoPremiumPl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/plugins/hooks/NoPremiumPl.py b/module/plugins/hooks/NoPremiumPl.py index 7742e03f7..2347fc58a 100644 --- a/module/plugins/hooks/NoPremiumPl.py +++ b/module/plugins/hooks/NoPremiumPl.py @@ -6,7 +6,7 @@ from module.common.json_layer import json_loads as loads class NoPremiumPl(MultiHook): __name__ = "NoPremiumPl" - __version__ = "0.01" + __version__ = "0.02" __type__ = "hook" __config__ = [("activated", "bool", "Activated", False), -- cgit v1.2.3