summaryrefslogtreecommitdiffstats
path: root/module/plugins/addons/MultishareCz.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2012-03-06 13:36:39 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2012-03-06 13:36:39 +0100
commit4df2b77fdf42046fe19bd371be7c7255986b5980 (patch)
tree2a7227a0d22e03dc2c085514eaab36a7e5e612c4 /module/plugins/addons/MultishareCz.py
parentssl fix (diff)
downloadpyload-4df2b77fdf42046fe19bd371be7c7255986b5980.tar.xz
renamed hooks to addons, new filemanager and database, many new api methods
you will loose ALL your LINKS, webinterface will NOT work
Diffstat (limited to 'module/plugins/addons/MultishareCz.py')
-rw-r--r--module/plugins/addons/MultishareCz.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/module/plugins/addons/MultishareCz.py b/module/plugins/addons/MultishareCz.py
new file mode 100644
index 000000000..a934f43ef
--- /dev/null
+++ b/module/plugins/addons/MultishareCz.py
@@ -0,0 +1,36 @@
+# -*- coding: utf-8 -*-
+
+from module.network.RequestFactory import getURL
+from module.plugins.internal.MultiHoster import MultiHoster
+import re
+
+def getConfigSet(option):
+ s = set(option.lower().split('|'))
+ s.discard(u'')
+ return s
+
+class MultishareCz(MultiHoster):
+ __name__ = "MultishareCz"
+ __version__ = "0.01"
+ __type__ = "hook"
+ __config__ = [("activated", "bool", "Activated", "False"),
+ ("includeHoster", "str", "Use only for downloads from (bar-separated hosters)", ""),
+ ("excludeHoster", "str", "Do not use for downloads from (bar-separated hosters)", "rapidshare.com|uloz.to")]
+ __description__ = """MultiShare.cz hook plugin"""
+ __author_name__ = ("zoidberg")
+ __author_mail__ = ("zoidberg@mujmail.cz")
+
+ #replacements = [("freakshare.net", "freakshare.com")]
+ HOSTER_PATTERN = r'<img class="logo-shareserveru"[^>]*alt="([^"]+)"></td>\s*<td class="stav"><img src="/img/loga/ok.png" alt="OK">'
+
+ def getHoster(self):
+
+ page = getURL("http://www.multishare.cz/monitoring/")
+ hoster = set(m.group(1).lower() for m in re.finditer(self.HOSTER_PATTERN, page))
+
+ option = self.getConfig('includeHoster').strip()
+ if option: hoster &= getConfigSet(option)
+ option = self.getConfig('excludeHoster').strip()
+ if option: hoster -= getConfigSet(option)
+
+ return list(hoster) \ No newline at end of file