forked from pyload/pyload
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAndroidPhoneNotify.py
More file actions
49 lines (43 loc) · 1.83 KB
/
AndroidPhoneNotify.py
File metadata and controls
49 lines (43 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
from ..base.notifier import Notifier
class AndroidPhoneNotify(Notifier):
__name__ = "AndroidPhoneNotify"
__type__ = "addon"
__version__ = "0.17"
__status__ = "testing"
__config__ = [
("enabled", "bool", "Activated", False),
("apikey", "str", "API key", ""),
("captcha", "bool", "Notify captcha request", True),
("reconnection", "bool", "Notify reconnection request", False),
("downloadfinished", "bool", "Notify download finished", True),
("downloadfailed", "bool", "Notify download failed", True),
("alldownloadsfinished", "bool", "Notify all downloads finished", True),
("alldownloadsprocessed", "bool", "Notify all downloads processed", True),
("packagefinished", "bool", "Notify package finished", True),
("packagefailed", "bool", "Notify package failed", True),
("update", "bool", "Notify pyLoad update", False),
("exit", "bool", "Notify pyLoad shutdown/restart", False),
("sendinterval", "int", "Interval in seconds between notifications", 1),
("sendpermin", "int", "Max notifications per minute", 60),
("ignoreclient", "bool", "Send notifications if client is connected", True),
]
__description__ = (
"""Send push notifications to your Android Phone using notifymyandroid.com"""
)
__license__ = "GPLv3"
__authors__ = [
("Steven Kosyra", "steven.kosyra@gmail.com"),
("Walter Purcaro", "vuolter@gmail.com"),
]
def get_key(self):
return self.config.get("apikey")
def send(self, event, msg, key):
self.load(
"http://www.notifymyandroid.com/publicapi/notify",
get={
"apikey": key,
"application": "pyLoad",
"event": event,
"description": msg,
},
)