try to fix script check
This commit is contained in:
parent
fa75a6b218
commit
d18f70961d
2 changed files with 19 additions and 14 deletions
|
|
@ -1,7 +1,8 @@
|
|||
import requests
|
||||
|
||||
# API endpoint for login
|
||||
url = "https://api-eu.libreview.io/llu/auth/login" # Replace with the actual API URL
|
||||
#url = "https://api-eu.libreview.io/llu/auth/login" # Replace with the actual API URL
|
||||
url = "https://libreview-proxy.onrender.com/eu/llu/auth/login" # Replace with the actual API URL
|
||||
|
||||
# Login credentials
|
||||
payload = {
|
||||
|
|
@ -14,9 +15,9 @@ headers = {
|
|||
'accept-encoding': 'gzip',
|
||||
'cache-control': 'no-cache',
|
||||
'connection': 'Keep-Alive',
|
||||
'content-type': 'application/json',
|
||||
'Accept': 'application/json',
|
||||
'product': 'llu.android',
|
||||
'version': '4.7'
|
||||
'version': '4.16'
|
||||
}
|
||||
|
||||
# Send the POST request
|
||||
|
|
@ -24,7 +25,7 @@ response = requests.post(url, json=payload, headers=headers)
|
|||
|
||||
if response.status_code == 200:
|
||||
data = response.json()
|
||||
|
||||
|
||||
# Ensure the response contains the expected structure
|
||||
if data.get("status") == 0 and "authTicket" in data.get("data", {}):
|
||||
jwt_token = data["data"]["authTicket"]["token"]
|
||||
|
|
@ -33,4 +34,4 @@ if response.status_code == 200:
|
|||
print("Status = ", data.get("status"))
|
||||
print("Login failed: Unexpected response format")
|
||||
else:
|
||||
print("Login failed:", response.status_code, response.text)
|
||||
print("Login failed:", response.status_code, response.text)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue