summaryrefslogtreecommitdiffstats
path: root/module/plugins/hooks/NoPremiumPl.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hooks/NoPremiumPl.py')
-rw-r--r--module/plugins/hooks/NoPremiumPl.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/module/plugins/hooks/NoPremiumPl.py b/module/plugins/hooks/NoPremiumPl.py
new file mode 100644
index 000000000..154d748f1
--- /dev/null
+++ b/module/plugins/hooks/NoPremiumPl.py
@@ -0,0 +1,39 @@
+# !/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+"""
+@author: Pawel W. <dev@nopremium.pl>
+"""
+
+from module.plugins.internal.MultiHoster import MultiHoster
+from module.network.RequestFactory import getURL
+
+try:
+ from json import loads
+except ImportError:
+ from simplejson import loads
+
+class NoPremiumPl(MultiHoster):
+ __name__ = "NoPremiumPl"
+ __version__ = "0.01"
+ __type__ = "hook"
+
+ __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")]
+
+ __description__ = "NoPremium.pl hook"
+ __author_name__ = ("goddie")
+ __author_mail__ = ("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()
+
+