pallupz / covid-vaccine-booking

This tool can be used to automate booking slots on Co-WIN Platform.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Endpoint Request Timeout

Dugdudada opened this issue · comments

getting Endpoint Request Timeout error when validating OTP

Inside utils.py generate_token_otp function

add request_header={.....} part given below just after data={....} lines
change the request_header in requests.post to given below

`

while not valid_token:

    try:

        data = {"mobile": mobile,
                "secret": "U2FsdGVkX1+Co0Y47weon+N6VW49nH9oa8wv4KZBaBMt4vD7yhGuncYMK5R4Q6l7O9Nn/VFTmguVTEx+lFVLvw=="
        }

        request_header={"accept": "application/json, text/plain, */*",
                        "accept-encoding": "gzip, deflate, br",
                        "accept-language": "en-GB,en-US;q=0.9,en;q=0.8",
                        "content-length": "121",
                        "content-type": "application/json",
                        "origin": "https://selfregistration.cowin.gov.in",
                        "referer": "https://selfregistration.cowin.gov.in/",
                        "sec-fetch-dest": "empty",
                        "sec-fetch-mode": "cors",
                        "sec-fetch-site": "cross-site",
                        "sec-gpc": "1",
                        "user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36"}

        txnId = requests.post(url=OTP_PRO_URL, json=data, headers=request_header, timeout=None)

`
Solves the issue for me
@pallupz @Dugdudada

yea this issue is resolved in the latest code