Fixed api_get_status

Signed-off-by: fly <merspieler@airmail.cc>
This commit is contained in:
fly 2021-05-27 09:21:48 +02:00
parent f872846244
commit f36c656e0e

View file

@ -219,9 +219,9 @@ def api_get_status(name, api, api_token):
try:
match = re.match(r"[ew]\d{3}[ns]\d{2}", name)
if match != None:
response = requests.post(api, data={'auth': token, 'action': 'status', 'area': name}, headers={"lAccept": "application/json", "Content-Type": "application/x-www-form-urlencoded"})
response = requests.post(api, data={'auth': api_token, 'action': 'status', 'area': name}, headers={"lAccept": "application/json", "Content-Type": "application/x-www-form-urlencoded"})
else:
response = requests.post(api, data={'auth': token, 'action': 'status', 'tile': name}, headers={"lAccept": "application/json", "Content-Type": "application/x-www-form-urlencoded"})
response = requests.post(api, data={'auth': api_token, 'action': 'status', 'tile': name}, headers={"lAccept": "application/json", "Content-Type": "application/x-www-form-urlencoded"})
if response.ok and response.json()["success"] == True:
match = re.match(r"pending|done|rebuild|skip|started|packaged", response.json()["status"])
if match != None: