diff options
author | Walter Purcaro <vuolter@gmail.com> | 2015-01-11 19:02:38 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2015-01-11 19:02:38 +0100 |
commit | 91fb1b93aeda09f35f9c43a40faacf20d6a37c94 (patch) | |
tree | 2df79a4089cb97168180da5d9d52801e12dfde2b | |
parent | Code improvements (diff) | |
parent | AndroidPhoneNotify added (diff) | |
download | pyload-91fb1b93aeda09f35f9c43a40faacf20d6a37c94.tar.xz |
Merge pull request #1034 from k0ssi/stable
AndroidPhoneNotify added
-rw-r--r-- | module/plugins/hooks/AndroidPhoneNotify.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/module/plugins/hooks/AndroidPhoneNotify.py b/module/plugins/hooks/AndroidPhoneNotify.py new file mode 100644 index 000000000..d6bf64db4 --- /dev/null +++ b/module/plugins/hooks/AndroidPhoneNotify.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- + + +from module.plugins.Hook import Hook +from module.network.RequestFactory import getURL + +class AndroidPhoneNotify(Hook): + __name__ = "AndroidPhoneNotify" + __type__ = "hook" + __version__ = "0.01" + + __config__ = [("apikey", "str", "apikey", ""), + ("appname", "str", "ApplicationName", "pyLoad"), + ("notifycaptcha", "bool", "Send captcha notifications (maybe usefull if premium fails)", False)] + + __description__ = """Send push notifications to your Android Phone using notifymyandroid.com""" + __license__ = "GPLv3" + __authors__ = [("Steven Kosyra", "steven.kosyra@gmail.com")] + + + def packageFinished(self, pypack): + self.genUrl("Package finished:",pypack.name) + + + def newCaptchaTask(self, task): + if self.getConfig("notifycaptcha"): + self.genUrl("Captcha","new Captcha request") + + + + def genUrl(self,event, msg): + self.response(event, msg) + + + + def response(self, event, msg): + html = getURL("http://www.notifymyandroid.com/publicapi/notify?apikey=" + self.getConfig("apikey") + "&application=" + self.getConfig("appname") + "&event=" + str(event) + "&description= " + str(msg) + "") |