From 9d0fef4d50c9f46daf00e50814a57b3000097ac8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 27 May 2015 23:17:33 +0200 Subject: Fix https://github.com/pyload/pyload/issues/1428 --- module/plugins/hooks/AndroidPhoneNotify.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'module/plugins/hooks/AndroidPhoneNotify.py') diff --git a/module/plugins/hooks/AndroidPhoneNotify.py b/module/plugins/hooks/AndroidPhoneNotify.py index 67a0ea4f0..9fea0b8e6 100644 --- a/module/plugins/hooks/AndroidPhoneNotify.py +++ b/module/plugins/hooks/AndroidPhoneNotify.py @@ -9,7 +9,7 @@ from module.plugins.Hook import Hook, Expose class AndroidPhoneNotify(Hook): __name__ = "AndroidPhoneNotify" __type__ = "hook" - __version__ = "0.07" + __version__ = "0.08" __config__ = [("apikey" , "str" , "API key" , "" ), ("notifycaptcha" , "bool", "Notify captcha request" , True ), @@ -44,6 +44,10 @@ class AndroidPhoneNotify(Hook): self.notify(_("Plugins updated"), str(type_plugins)) + def coreReady(self): + self.key = self.getConfig('apikey') + + def coreExiting(self): if not self.getConfig('notifyexit'): return @@ -80,8 +84,9 @@ class AndroidPhoneNotify(Hook): def notify(self, event, msg="", - key=self.getConfig('apikey')): + key=None): + key = key or self.key if not key: return @@ -99,7 +104,6 @@ class AndroidPhoneNotify(Hook): elif self.notifications >= self.getConf("sendpermin"): return - getURL("http://www.notifymyandroid.com/publicapi/notify", get={'apikey' : key, 'application': "pyLoad", @@ -108,3 +112,5 @@ class AndroidPhoneNotify(Hook): self.last_notify = time.time() self.notifications += 1 + + return True -- cgit v1.2.3