pallupz / covid-vaccine-booking Goto Github PK
View Code? Open in Web Editor NEWThis tool can be used to automate booking slots on Co-WIN Platform.
License: MIT License
This tool can be used to automate booking slots on Co-WIN Platform.
License: MIT License
'beep' function does not work on MacOS. An alternate to beep
system command on MacOS would be say
https://ss64.com/osx/say.html
Eg:
say "ATTENTION: check now.."
Is there a way we can restrict the search only for 18-44 age group?
Works fine after removing import msvcrt for Linux
Few of the hospitals offer their slots early in the morning for the same day. The current script starts looking for slots from tomorrow, so we will need to change "check_calendar_by_district" and "check_calendar_by_pincode" to "today" instead of "tomorrow".
Nice work on automating the booking process. But I think this is unfair. This puts programmers and people with technical expertise at an advantage over everyone else. Currently the cowin platform appointment is based on luck for everyone. With a script, programmers have edge over everyone else.
But at some point, someone would have made this anyway and kept it private. At least you made it open source. Thanks for that!
It would be more equitable if this is a website for python-terminal-illiterate people. An alternative frontend for Cowin with these features you added.
I am getting this below error after enterring the registered phone number.
Enter the registered mobile number: ******
Requesting OTP with mobile number ******..
HTTPSConnectionPool(host='cdn-api.co-vin.in', port=443): Max retries exceeded with url: /api/v2/auth/generateMobileOTP (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1091)')))
Exiting Script
Press any key to continue . . .
covid-vaccine-booking/src/utils.py
Line 418 in cb0ce56
Tried running the script, but it broke with:
File "src/covid-vaccine-slot-booking.py", line 20
request_header = {"Authorization": f"Bearer {token}"}
^
SyntaxError: invalid syntax
Don't know enough python to fix this :|
I'm facing an error while running your code :
Here is a snippet of it: (Occurs right after I enter mobile number and it requests for otp)
HTTPSConnectionPool(host='cdn-api.co-vin.in', port=443): Max retries exceeded with url: /api/v2/auth/generateMobileOTP (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')))
Exiting Script'
Please help!! :(
Due to heavy load sometimes the API used for fetching the slots availability returns no response.
As a result the exe program gets exited with beep saying NoneType cannot be iterated.
User have to start whole script again.
`Enter the registered mobile number: 75075XXXXX
Requesting OTP with mobile number 75075XXXXX..
Unable to Create OTP
Generated by cloudfront (CloudFront) Request ID: yc_80Zck48I4dhhO9yh05XeWccrv-5NCqTfq760qr_BCu7I0WGx5yw==`
My main painpoint was that
**Hence I automated the entire thing end-to-end ;) **
Please share your thoughts on it.
Code and steps to install are here. https://github.com/bombardier-gif/covid-vaccine-booking
Its hacky and dirty. Pull requests are welcome ;)
Script was not able to show the available slots which were visible on the cowin website
Is it possible to add support for looking for slots starting from a user provided date ? would be helpful for ppl to book second dose after 28 days
Im getting this error after entering OTP:
Fetching registered beneficiaries..
Unable to fetch beneficiaries
401
Unauthenticated access!
sh: pause: command not found
object of type 'NoneType' has no len()
Exiting Script
sh: pause: command not found
where am I going wrong?
Was it case as mentioned in last issue that same day slot is not included or there is chance slots getting filled within 5 secs thus no prompt at all
Hi,
Thanks for creating this script. I have very limited working knowledge of Python and hence pasting the error I am getting on line 52.
python ./covid-vaccine-slot-booking.py
File "./covid-vaccine-slot-booking.py", line 52
CALENDAR_URL += f"&vaccine={vaccine_type}"
SyntaxError: invalid syntax
It is showing a error on " after } . Could you let me know how to resolve this?
Hi ,
Can we modify this code to make it automatically book the slots , any location , any time , any date?
Regards,
Prasanth
This is what I see when I run the code as is. But when I change 'tomorrow' in this line (in check_calendar() in utils.py) ->
resp = requests.get(base_url.format(district['district_id'], tomorrow), headers=request_header)
to 'today' then that 105 number becomes 0. Not sure why this is happening. I was running this modified version and the slots that opened up did not show up while this was running.
Just want to thank you for the script and the only way I know is to open an issue ๐. The script worked great for us. Really simple to setup and use. Please close the issue once you see it.
Getting the following error :
sh: 1: pause: not found
Unable to Create OTP
Can we have user input for choosing Covaxin vs Covishield?
No beep notification when the token expires. Also what is the time in which the token expires and what does it depend on? is it possible to increase this timer?
Getting below error when trying to get OTP since yesterday evening.
Unable to Create OTP
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>ERROR: The request could not be satisfied</TITLE>
</HEAD><BODY>
<H1>403 ERROR</H1>
<H2>The request could not be satisfied.</H2>
<HR noshade size="1px">
Request blocked.
We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner.
<BR clear="all">
If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.
<BR clear="all">
<HR noshade size="1px">
<PRE>
Generated by cloudfront (CloudFront)
Request ID: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
</PRE>
<ADDRESS>
</ADDRESS>
</BODY></HTML>
Press any key to continue . . .|
Production apis is not open for public uses. So just wanted to check if that is legal?
I am facing issue while generating OTP ,
mot fetching OTP
districts serve very large areas and give vaccination centers that are pretty far away
I see the following error-
python src/covid-vaccine-slot-booking.py
File "src/covid-vaccine-slot-booking.py", line 20
request_header = {"Authorization": f"Bearer {token}"}
^
SyntaxError: invalid syntax
Anyone know why this problem is?
Got 403 ERROR. Does it seem that this has been blocked forever?
P.S. It was working fine and I was able to book an appointment 1 hour ago.
First of all, great job @pallupz! This worked for me after a an hour of tinkering. beep
wasn't beeping so I replaced it with a dog barking sound whenever slots opened. :P
This got me thinking about how its possible to setup a front end and host this so that even laymen can use this service quite easily. Libraries like streamlit allow to easily repurpose python scripts into GUI web apps. Your thoughts?
Following your instruction to run the scripts, I am on Linux.
Getting error when I ran python src/covid-vaccine-slot-booking.py
File "src/covid-vaccine-slot-booking.py", line 20
request_header = {"Authorization": f"Bearer {token}"}
Hi ,
i am able to choose only pincode, not able to select state and district, when i press 2 , 403ERROR comes up
Great job - however, the slot booking mechanism looking at just next 7 days, is quite Kerala specific. In other states, they are opening up slots for 10 days or more at once. We need to give users an option on how many days they want to look for
Edit: I see the 7 days is coming from the API limitations - perhaps a begin date argument?
On this line, you are calculating the district alert frequency. Could you explain how this is calculated?
covid-vaccine-booking/src/utils.py
Line 255 in 66309c4
Thanks!
P.S. Great utility btw, really appreciate your time and effort in creating this! It's the most convenient one I've found out there. I just wish even the (re)authorization could have been automated. But this is the next best thing, so again, kudos!
Hi Pallupz, really appreciate your efforts. Is there any way to reduce the frequency of updates? For some locations the slots get filled up in just a second or so, so it would be great if the slot availability could be checked every second.
After entering mobile no for OTP received following error.
It seems bearer token needs to be used with every request to bypass cloudfront.
======================================================
Unable to Create OTP
Generated by cloudfront (CloudFront) Request ID: TVGQE9XeOlpUHYWQ9dnxHxD9M5x9N_8yS-dRHnFmAnhFLrtakc3raw==
===========================================
The district function is good, but it fetches center from very far, Is there a way, I can sort using pin code?
C:\Users\chamehta\Downloads\Pyscripts>python covid-vaccine-slot-booking.py
Enter the registered mobile number: XXXXXXXXXX
Requesting OTP with mobile number XXXXXXXXXX..
HTTPSConnectionPool(host='cdn-api.co-vin.in', port=443): Max retries exceeded with url: /api/v2/auth/generateMobileOTP (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1076)')))
Exiting Script
Press any key to continue . . .
It's not an issue, re-writing this in GO, with new features.
What is the API key for production access.
Add automatic appointment booking feature for the first available centre & slot
As I was unable to create an OTP through the program, I manually generated the OTP and entered it. This is what I got -
Enter OTP: 903571
Validating OTP..
Object of type Response is not JSON serializable
Exiting Script
There appears to be stray "f" introduced in a few lines
eg: request_header = {"Authorization": f"Bearer {token}"}
Hi , This is a probably new feature that got added in.
After seleting the people who want to get vaccination, this option comes and the app taps out.
I Get this error -
HTTPSConnectionPool(host='cdn-api.co-vin.in', port=443): Max retries exceeded with url: /api/v2/auth/generateMobileOTP (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1091)')))
how to fix it.
Hey, I am trying to use this script for Linux but due to unavailability of winsound for Linux distro, I am unable to run the script.
Here are some of the solution you can try,
bro i was searching for slots in Bangalore and an alert came on one of the telegram bots for 100 slots. But the script didn't show any. Is there something wrong with what i am doing here?
also i tried using it for my family in rajasthan i got a hit yet it didn't auto book it and asked for indexofcentre.indexofslot the availability was just 1(i set minimum number of vaccines required to 1 too). kindly help bro.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.