37 lines
1,000 B
Python
37 lines
1,000 B
Python
import requests
|
|
|
|
# API endpoint for login
|
|
url = "https://api-eu.libreview.io/llu/auth/login"
|
|
|
|
# Login credentials
|
|
payload = {
|
|
"email": "gjkoolen@gmail.com",
|
|
"password": "VropZup#3x"
|
|
}
|
|
|
|
# Headers
|
|
headers = {
|
|
'accept-encoding': 'gzip',
|
|
'cache-control': 'no-cache',
|
|
'connection': 'Keep-Alive',
|
|
'Accept': 'application/json',
|
|
'product': 'llu.android',
|
|
'version': '4.16'
|
|
}
|
|
|
|
# Send the POST request
|
|
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"]
|
|
print("Login successful! JWT Token:", jwt_token)
|
|
print(data);
|
|
else:
|
|
print("Status = ", data.get("status"))
|
|
print("Login failed: Unexpected response format")
|
|
else:
|
|
print("Login failed:", response.status_code, response.text)
|