41 lines
1.4 KiB
Python

import requests
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/136.0.0.0 Safari/537.36',
'sec-ch-ua': '"Chromium";v="136", "Google Chrome";v="136", "Not.A/Brand";v="99"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
}
proxies = {
'http': 'http://127.0.0.1:10808',
'https': 'http://127.0.0.1:10808',
}
data = {
'client_id': 'f1a362d288c1b98099c7',
'client_secret': 'eea605b96e01c796ff369935357eca920c5da4c5',
'grant_type': 'password',
'username': 'dewujie64@gmail.com',
'password': 'fKW8pF_CPh4#q%y',
'scope': 'userinfo,email,manage_subscriptions,manage_history,manage_likes,manage_playlists,manage_videos',
'version': '2',
'traffic_segment': '440397',
'visitor_id': 'e1ce77f1-0d3e-493f-89bc-2f22669f8985',
}
response = requests.post('https://graphql.api.dailymotion.com/oauth/token', headers=headers, data=data, proxies=proxies)
json_data = response.json()
access_token = json_data.get('access_token')
print()