38 lines
1.2 KiB
Python
38 lines
1.2 KiB
Python
import requests
|
|
import uuid
|
|
|
|
|
|
u = uuid.uuid4()
|
|
uuid_with_dash = str(u)
|
|
headers = {
|
|
'Accept': '*/*',
|
|
'Accept-Language': 'zh-CN,zh;q=0.9',
|
|
'Cache-Control': 'no-cache',
|
|
'Connection': 'keep-alive',
|
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
'Origin': 'https://www.dailymotion.com',
|
|
'Pragma': 'no-cache',
|
|
'Referer': 'https://www.dailymotion.com/',
|
|
'Sec-Fetch-Dest': 'empty',
|
|
'Sec-Fetch-Mode': 'cors',
|
|
'Sec-Fetch-Site': 'same-site',
|
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36',
|
|
'sec-ch-ua': '"Google Chrome";v="135", "Not-A.Brand";v="8", "Chromium";v="135"',
|
|
'sec-ch-ua-mobile': '?0',
|
|
'sec-ch-ua-platform': '"Windows"',
|
|
}
|
|
|
|
data = {
|
|
'client_id': 'f1a362d288c1b98099c7',
|
|
'client_secret': 'eea605b96e01c796ff369935357eca920c5da4c5',
|
|
'grant_type': 'client_credentials',
|
|
'traffic_segment': '567786',
|
|
'visitor_id': uuid_with_dash,
|
|
}
|
|
proxies = {
|
|
"http": 'http://127.0.0.1:7890',
|
|
"https": 'http://127.0.0.1:7890',
|
|
}
|
|
response = requests.post('https://graphql.api.dailymotion.com/oauth/token', headers=headers, data=data, proxies=proxies)
|
|
|
|
print(response.json()) |