abhinavdc / cowin-pinger

Get notified on your phone when there is a vaccine slot available at your location, by running a script on your computer. Uses Cowin portal's public API.
106 stars 45 forks source link

Error code #5

Closed pinkman160 closed 3 years ago

pinkman160 commented 3 years ago

Request failed with status code: 403

abhinavdc commented 3 years ago

Can you try again with the latest code/version ? I have pushed a fix for the timer, that could be the cause for 403.

Not-an-alt commented 3 years ago

It isn't running now. Stuck here image

abhinavdc commented 3 years ago

@SuicideMonkey Do you get any error ? Try changing the time interval to 5 minutes and wait for 5 minutes to see what happens. If your computer goes to sleep while the script is running it could mess it up.

Not-an-alt commented 3 years ago

No error. But it isn't running either. I changed the district code to a place where vaccines are available and set interval to 2 minutes but it didn't get any notification either. It's stuck on the same message.

abhinavdc commented 3 years ago

Are you sure you tried 2 minutes, because you cannot give an interval less than 5 minutes. image

abhinavdc commented 3 years ago

@SuicideMonkey I tired running the script with your district id, age, 15 mins interval etc and the script found a slot and sent me a notification as well just now.

Not-an-alt commented 3 years ago

--> Sorry, typed 2 by mistake, I used 5 minutes.

It's working now - it was a issue in the district I chose, it keeps showing only a single vaccine slot, which then disappears if you try to book. Same issue persists even after a re-search.

Screenshot_20210507-150257

abhinavdc commented 3 years ago

@SuicideMonkey Great, yes could be some data issue at the Cowin portal end. This isn't something we can fix from our end. But you could clone the repo and run it by adding a check in the code for the particular center that is causing the issue here.

abhinavdc commented 3 years ago

@pinkman160 Has your issue with 403 error code been resolved ?

amarflybot commented 3 years ago

the issue for 403 still exists but come after some time.. I used nohup command to run this in the background and redirected the output. But I find 403 after first ping count... The error for 403 happens if we run the script from a cloud provider.

anoopjb commented 3 years ago

I noticed that Cowin Server allows connections only from India. @amarflybot, I think when you use a cloud provider, the region from where the script runs should be in India. For example you need to use Mumbai(asia-south1) for GCP. IMHO, You might also face this if you are in VPN with gateway other than India.

abhinavdc commented 3 years ago

Thanks @anoopjb, that could be the reason why some people get the forbidden error while running the script. @amarflybot I hope you were able to resolve the issue.

amarflybot commented 3 years ago

Yeah, moving it to India region does solve the issue.. thanks ..