Untitled

mail@pastecode.io avatar
unknown
python
a year ago
5.2 kB
0
Indexable
Never
REQUEST THAT GETS BACK THE DATADOME COOKIES

import requests

headers = {
    'authority': 'api-js.datadome.co',
    'accept': '*/*',
    'accept-language': 'en-US,en;q=0.9',
    'content-type': 'application/x-www-form-urlencoded',
    'origin': 'https://www.reddit.com',
    'referer': 'https://www.reddit.com/',
    'sec-ch-ua': '"Google Chrome";v="113", "Chromium";v="113", "Not-A.Brand";v="24"',
    'sec-ch-ua-mobile': '?0',
    'sec-ch-ua-platform': '"Windows"',
    'sec-fetch-dest': 'empty',
    'sec-fetch-mode': 'cors',
    'sec-fetch-site': 'cross-site',
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36',
}

data = 'jsData=%7B%22opts%22%3A%22ajaxListenerPath%22%2C%22ttst%22%3A184.6999999731779%2C%22ifov%22%3Afalse%2C%22tagpu%22%3A22.464481108584188%2C%22glvd%22%3A%22Google%20Inc.%20(AMD)%22%2C%22glrd%22%3A%22ANGLE%20(AMD%2C%20AMD%20Radeon(TM)%20RX%20Vega%2010%20Graphics%20Direct3D11%20vs_5_0%20ps_5_0%2C%20D3D11)%22%2C%22hc%22%3A8%2C%22br_oh%22%3A816%2C%22br_ow%22%3A1536%2C%22ua%22%3A%22Mozilla%2F5.0%20(Windows%20NT%2010.0%3B%20Win64%3B%20x64)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F113.0.0.0%20Safari%2F537.36%22%2C%22wbd%22%3Afalse%2C%22wdif%22%3Afalse%2C%22wdifrm%22%3Afalse%2C%22npmtm%22%3Afalse%2C%22br_h%22%3A596%2C%22br_w%22%3A792%2C%22nddc%22%3A0%2C%22rs_h%22%3A864%2C%22rs_w%22%3A1536%2C%22rs_cd%22%3A24%2C%22phe%22%3Afalse%2C%22nm%22%3Afalse%2C%22jsf%22%3Afalse%2C%22lg%22%3A%22en-US%22%2C%22pr%22%3A1.5625%2C%22ars_h%22%3A816%2C%22ars_w%22%3A1536%2C%22tz%22%3A-180%2C%22str_ss%22%3Atrue%2C%22str_ls%22%3Atrue%2C%22str_idb%22%3Atrue%2C%22str_odb%22%3Atrue%2C%22plgod%22%3Afalse%2C%22plg%22%3A5%2C%22plgne%22%3Atrue%2C%22plgre%22%3Atrue%2C%22plgof%22%3Afalse%2C%22plggt%22%3Afalse%2C%22pltod%22%3Afalse%2C%22hcovdr%22%3Afalse%2C%22hcovdr2%22%3Afalse%2C%22plovdr%22%3Afalse%2C%22plovdr2%22%3Afalse%2C%22ftsovdr%22%3Afalse%2C%22ftsovdr2%22%3Afalse%2C%22lb%22%3Afalse%2C%22eva%22%3A33%2C%22lo%22%3Afalse%2C%22ts_mtp%22%3A0%2C%22ts_tec%22%3Afalse%2C%22ts_tsa%22%3Afalse%2C%22vnd%22%3A%22Google%20Inc.%22%2C%22bid%22%3A%22NA%22%2C%22mmt%22%3A%22application%2Fpdf%2Ctext%2Fpdf%22%2C%22plu%22%3A%22PDF%20Viewer%2CChrome%20PDF%20Viewer%2CChromium%20PDF%20Viewer%2CMicrosoft%20Edge%20PDF%20Viewer%2CWebKit%20built-in%20PDF%22%2C%22hdn%22%3Afalse%2C%22awe%22%3Afalse%2C%22geb%22%3Afalse%2C%22dat%22%3Afalse%2C%22med%22%3A%22defined%22%2C%22aco%22%3A%22probably%22%2C%22acots%22%3Afalse%2C%22acmp%22%3A%22probably%22%2C%22acmpts%22%3Atrue%2C%22acw%22%3A%22probably%22%2C%22acwts%22%3Afalse%2C%22acma%22%3A%22maybe%22%2C%22acmats%22%3Afalse%2C%22acaa%22%3A%22probably%22%2C%22acaats%22%3Atrue%2C%22ac3%22%3A%22%22%2C%22ac3ts%22%3Afalse%2C%22acf%22%3A%22probably%22%2C%22acfts%22%3Afalse%2C%22acmp4%22%3A%22maybe%22%2C%22acmp4ts%22%3Afalse%2C%22acmp3%22%3A%22probably%22%2C%22acmp3ts%22%3Afalse%2C%22acwm%22%3A%22maybe%22%2C%22acwmts%22%3Afalse%2C%22ocpt%22%3Afalse%2C%22vco%22%3A%22NA%22%2C%22vch%22%3A%22NA%22%2C%22vcw%22%3A%22NA%22%2C%22vc3%22%3A%22NA%22%2C%22vcmp%22%3A%22NA%22%2C%22vcq%22%3A%22NA%22%2C%22vc1%22%3A%22NA%22%2C%22vcots%22%3A%22NA%22%2C%22vchts%22%3A%22NA%22%2C%22vcwts%22%3A%22NA%22%2C%22vc3ts%22%3A%22NA%22%2C%22vcmpts%22%3A%22NA%22%2C%22vcqts%22%3A%22NA%22%2C%22vc1ts%22%3A%22NA%22%2C%22dvm%22%3A4%2C%22sqt%22%3Afalse%2C%22so%22%3A%22landscape-primary%22%2C%22wdw%22%3Atrue%2C%22cokys%22%3A%22bG9hZFRpbWVzY3NpYXBwL%3D%22%2C%22ecpc%22%3Afalse%2C%22lgs%22%3Atrue%2C%22lgsod%22%3Afalse%2C%22psn%22%3Atrue%2C%22edp%22%3Atrue%2C%22addt%22%3Atrue%2C%22wsdc%22%3Atrue%2C%22ccsr%22%3Atrue%2C%22nuad%22%3Atrue%2C%22bcda%22%3Afalse%2C%22idn%22%3Atrue%2C%22capi%22%3Afalse%2C%22svde%22%3Afalse%2C%22vpbq%22%3Atrue%2C%22ucdv%22%3Afalse%2C%22spwn%22%3Afalse%2C%22emt%22%3Afalse%2C%22bfr%22%3Afalse%2C%22dbov%22%3Afalse%2C%22prm%22%3Atrue%2C%22tzp%22%3A%22Africa%2FCairo%22%2C%22cvs%22%3Atrue%2C%22usb%22%3A%22defined%22%2C%22jset%22%3A1685928963%2C%22dcok%22%3A%22.reddit.com%22%2C%22tbce%22%3A69%2C%22es_sigmdn%22%3A0.0009308667203218658%2C%22es_mumdn%22%3A9.890631594778784%2C%22es_distmdn%22%3A378.7254942567242%2C%22es_angsmdn%22%3A1.8301280711955814%2C%22es_angemdn%22%3A2.5652174329986095%2C%22m_s_c%22%3A0%2C%22m_m_c%22%3A259%2C%22m_c_c%22%3A3%2C%22m_cm_r%22%3A0.011583011583011582%2C%22m_ms_r%22%3A-1%7D&eventCounters=%7B%22mousemove%22%3A259%2C%22click%22%3A3%2C%22scroll%22%3A0%2C%22touchstart%22%3A0%2C%22touchend%22%3A0%2C%22touchmove%22%3A0%2C%22keydown%22%3A0%2C%22keyup%22%3A0%7D&jsType=le&cid=7QgkCIzEctWmNkuqhpnpLT94Cr9eGXaHN0Ymz0w251xIqJx~unvEQUuolc3QlJe_~NbxWPEreYzNJZMvejCtrO1Mm-tbNpcJyhadOyCcu_yHkctemqBqhbghEl07Peh_&ddk=288922D4BE1987530B4E5D4A17952C&Referer=https%253A%252F%252Fwww.reddit.com%252F%253Fsignup_survey%253Dtrue&request=%252F%253Fsignup_survey%253Dtrue&responsePage=origin&ddv=4.10.2'

response = requests.post('https://api-js.datadome.co/js/', headers=headers, data=data)

{"status":200,"cookie":"datadome=5BwXWccaiv1oKrAVbJ1_k39OQzNj3S8bxOr_HMkkO8RAU5kv-uDUM2BBUWxrzyYW~mQzXJ_RnxmkwzqCbv1iwnXMw_K5ZEv9fsOHuTLmia0X8xQQv-H6V5smD3Lyo0Dw; Max-Age=31536000; Domain=.reddit.com; Path=/; Secure; SameSite=Lax"}