diff options
author | synweap15 <shamdog+github@gmail.com> | 2014-12-30 21:37:20 +0100 |
---|---|---|
committer | synweap15 <shamdog+github@gmail.com> | 2014-12-30 21:37:20 +0100 |
commit | 90383d08cfc77253a645f10e56dd3ac322cb8507 (patch) | |
tree | e83860f4ce17bc01adbfe1a0e52209d523061742 /module/plugins/hooks/RapideoPl.py | |
parent | Merge pull request #1 from pyload/stable (diff) | |
download | pyload-90383d08cfc77253a645f10e56dd3ac322cb8507.tar.xz |
transition to multihook fix
Diffstat (limited to 'module/plugins/hooks/RapideoPl.py')
-rw-r--r-- | module/plugins/hooks/RapideoPl.py | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/module/plugins/hooks/RapideoPl.py b/module/plugins/hooks/RapideoPl.py index a5d7a34a5..9eb454897 100644 --- a/module/plugins/hooks/RapideoPl.py +++ b/module/plugins/hooks/RapideoPl.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 RapideoPl(MultiHoster): +class RapideoPl(MultiHook): __name__ = "RapideoPl" - __version__ = "0.01" + __version__ = "0.02" __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__ = "Rapideo.pl hook" __license__ = "GPLv3" __authors__ = [("goddie", "dev@rapideo.pl")] - def getHoster(self): - hostings = loads(getURL("https://www.rapideo.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.rapideo.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 |