mirror of
https://gitlab.sectorq.eu/jaydee/api_server.git
synced 2026-09-17 02:12:55 +02:00
build
This commit is contained in:
@@ -10,6 +10,7 @@ class LoginError(Exception):
|
||||
|
||||
def get_token(args):
|
||||
"""Get CSRF token and cookies"""
|
||||
print("Logging in to Unifi Controller...")
|
||||
session = requests.Session()
|
||||
login_url = "https://unifi.sectorq.eu/api/auth/login"
|
||||
payload_login = {"username": "jaydee", "password": "l4c1j4yd33Du5lo"}
|
||||
@@ -84,8 +85,8 @@ def ban_ip(args):
|
||||
|
||||
|
||||
def run(data):
|
||||
ban_ip(data)
|
||||
|
||||
|
||||
return f"{data.action} requested {data.ip}"
|
||||
try:
|
||||
ban_ip(data)
|
||||
except:
|
||||
return f"{data.action} requested {data.ip}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user