kijk_DL/get_lic.py

44 lines
1.2 KiB
Python
Raw Permalink Normal View History

2025-10-12 18:46:12 +02:00
import requests
import json
# Define the API URL
url = "https://api.prd.video.talpa.network/graphql"
# Prepare the headers
headers = {
"Accept": "*/*",
"Accept-Language": "nl-NL,nl;q=0.9,en-US;q=0.8,en;q=0.7",
"Content-Type": "text/plain;charset=UTF-8",
"Priority": "u=1, i",
"Sec-CH-UA": "\"Google Chrome\";v=\"141\", \"Not?A_Brand\";v=\"8\", \"Chromium\";v=\"141\"",
"Sec-CH-UA-Mobile": "?0",
"Sec-CH-UA-Platform": "\"Windows\"",
"Sec-Fetch-Dest": "empty",
"Sec-Fetch-Mode": "cors",
"Sec-Fetch-Site": "cross-site",
}
# Prepare the body of the request
query = {
"query": """query DrmTokenQuery($provider: DrmProvider) {
drmToken(drmProvider: $provider) {
expiration
token
}
}""",
"variables": {
"provider": "JWP"
}
}
# Send the POST request
response = requests.post(url, headers=headers, data=json.dumps(query))
# Print the output
if response.status_code == 200:
# Extract the token
token = response.json()['data']['drmToken']['token']
print("Token:", token)
else:
print("Error:", response.status_code, response.text)