-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpanel_api.py
46 lines (41 loc) · 1.07 KB
/
panel_api.py
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
import requests
def api(additional_data):
url = 'https://panel.(YOUR_WEBSITE_DOMAIN_NAME):2083/api/'
username = '' #Add Panel username
domain = '' # Add Domain name Here
data = {
'hash': '', #Add API here
'arg1': username,
'arg2': domain,
} | additional_data
response = requests.post(url, data=data)
return response.text
def add_mail(username, password):
command = 'v-add-mail-account'
data = {
'cmd': command,
'arg3': username,
'arg4': password
}
return api(data)
def delete_mail(username):
command = 'v-delete-mail-account'
data = {
'cmd': command,
'arg3': username,
}
return api(data)
def change_pass(username, password):
command = 'v-change-mail-account-password'
data = {
'cmd': command,
'arg3': username,
'arg4': password
}
return api(data)
def list_mail():
command = 'v-list-mail-accounts'
data = {
'cmd': command,
}
return api(data)