import requests
domain = '****'
header = {
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
'Accept-Encoding': 'gzip, deflate, br',
'Accept-Language': 'ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7',
'Cache-Control': 'max-age=0',
'Connection': 'keep-alive',
'Content-Length': '406',
'Content-Type': 'multipart/form-data; boundary=----WebKitFormBoundaryL9whdwvPm7n5tAuT',
'Cookie': '_ym_uid=1673347722418692089; _ym_d=1673347722; csrf__token=uVDrE4ethIzvkxb6ihglmzk8P5yDlYNG; _ym_isad=2; _ym_visorc=w; sessionid_session=".eJxNi8sORTAQQH9FZk3TmQq5XfIhE48RDRfRdiX-HYmF7XkcwE0MI0cvO7serClyIky_uG26SZbbQS9hcrzt6-BmUS_3qo4-rP_qzVLwG49uCfIspMlkGjPEBH-WSqtJFZSjKeG8AKgoKCE:1pFaC6:-BT2LSKBYi-kpjoU1e4-ZxXP55k"',
'Host': 'www.kemdetki.ru',
'Origin': f'https://www{domain}',
'Referer': f'https://www{domain}/sp/mode/163209/threads/422416/',
'sec-ch-ua': '"Not_A Brand";v="99", "Google Chrome";v="109", "Chromium";v="109"',
'sec-ch-ua-mobile':'?0',
'sec-ch-ua-platform':'"Windows"',
'Sec-Fetch-Dest': 'document',
'Sec-Fetch-Mode': 'navigate',
'Sec-Fetch-Site': 'same-origin',
'Sec-Fetch-User': '?1',
'Upgrade-Insecure-Requests': '1',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36'
}
data_forum = {'csrfmiddlewaretoken': 'uVDrE4ethIzvkxb6ihglmzk8P5yDlYNG', 'backurl': '/sp/mode/163209/threads/422416/',
'text': ':novgod:'}
request_url = f'https://www{domain}/forum/thread/422416/reply/'
response = requests.post(request_url, data=data_forum, headers=header)
print(response)
print(response.text)
CSRF verification failed. Request aborted.
More information is available with DEBUG=True