CoWIN Vaccination slot booking telegram bot with auto captcha resolver & alerting feature.Now, never miss a slot.

Overview

COWIN VACCINATION SLOT AUTO BOOKING

(Bot with captcha solving & alerting capabilities. Never miss the vaccine slot.)

June-10-2021/ 0030 hrs: 23 successfully booked, 34 still searching. PAN INDIA

Cowin-AutoBot

HOW IT WORKS

  • Your computer will act as a server to update messages & recieve messages from telegram bot.
  • This automation script, gathers the recieved messages from the user & checks the details on COWIN portal.
  • Your phone (Telegram app) will act as a client to recieve messages sent from the computer.
  • If your computer stops or your script stops on computer, you will not see any updates on telegram, neither it will search for any slots.
  • You need to constantly respond if you recieve any alerts on telegram as notification.


Personally, we have used this & we (me, Srishti) got vaccinated, hope it helps you as well.



This automation subscribes to the telegram bot. Once registered mobile number is entered, it gets the cowin-session using otp provided by the user. While maintaining the valid user session, it tries to find a vaccination slot for the selected user & selected calendar. It checks for preferences such as vaccine type, state, pincode, district, paid/free & whether to auto-book the slot or not. Once slot is found, it tries booking it by randomly selecting the slot & resolving the captcha.


Pre-requisites:

  1. Computer/Laptop/CPU - capable of running python & having access to internet.
  2. Internet connection - Only with Indian ISP providers.
  3. Smart phone - with telegram app
  4. Registered on COWIN-portal - Add all the non-vaccinated members in here.

Create BOT (in Telegram)

This is a one time activity. If you already have a bot & its token, you can proceed to Installation step.

  • On Mobile/Phone open telegram app:
    • Search for @BotFather userbot.
      • type /newbot
      • Enter any desired name for the bot
      • Enter the unique username for the bot
      • if username is valid, confirmation message from @BotFather with token should come. If not, keep on trying different usernames until you get the token message. Please see the image for clarification.
    • Once it is created, say hi to your bot.

Installation

This is a one time activity.

  1. Download the source code from the following link- - https://github.com/shashankbafna/cowin-vaccination-book-slot/archive/refs/heads/main.zip
  2. Unzip & Extract the zip downloaded.
  • if you are on windows 10 & have adminitrator rights:
    • right click on setup.ps1 & Run with PowerShell
    • Installation completed, you can skip all the below steps. Proceed to Startup, 2nd step.
  • else if you do not have windows 10 or Admin rights, continue following the below steps.
    1. Go inside the Extracted folder ->src
    2. Install latest python if not already present from the link mentioned in Pre-requisites - Do not forget to check Add Python 3.7 to Path/Environment variable while installing (MANDATORY)
    3. Go inside the Extracted folder ->src
    4. In the The Address bar, which is located at the top of File Explorer as shown below, displays the path of the currently selected folder, type "cmd" - image
    5. This will open the command prompt with the location of script src.
    6. Type the following command in command prompt (just opened in above step) to install the dependent packages to run this script. - pip install -r ../requirements.txt - Optional if you want to run above command to install above dependencies in a virtual env ->Only for advanced python users. - image

STARTUP Script (on computer):

If installation is done manually, proceed with step 1 else contine from step 2.

  1. Type below command in command prompt (already opened during installation) python ./Booking.py

    • Follow the on screen instructions after starting the script. image
  2. Goto Mobile telegram app:

    • Make sure, you have said hi to your newly created bot.
    • Search for user @CowinAutoBot & click or type /start. -> click SubscribeID link.
    • After that it should ask for bot token message, which you have recieved from @BotFather bot Check this screenshot for further clarification.

      MANDATORY (after startup)
  • MAKE SURE THAT SCRIPT Keeps RUNNING ON LAPTOP, else you will not see updates on telegram. You need to follow steps for "Startup" if script exits.
  • ALSO MAKE SURE TO ENTER OTP as asked in the telegram bot, else session will not continue, you may need to follow steps for "Startup" again.

    Now respond to your bot in telegram.


SELECTION & FEATURES:

  • Inputs:
    • In Telegram, your messages act as input to the script. Mind the caps/digits/case of characters while entering.
    • Index numbers are mentioned in front of the selections like in front of your name, in front of states, in front of districts etc.
    • Mostly, the inputs are one time effort, as once entered, this will be saved in a file for future run.
    • If timeout happens, i.e. user doesnot respond within 100 sec from the time when bot's message arrives.
      • Manual input can be given from keyboard but only on computer.
    • Below are the list of Inputs gathered for the first run.
      • Enter the phone number
      • Enter OTP
      • Enter comma seperated index numbers of beneficiares
      • Search using pincode or State/District
        • Enter pincodes/ Index number of State, followed by Index number of Districts.
      • How frequent the request should be sent to COWIN portal to find out the slot availability from APIs.
      • Search for a week from when? today, tomorrow or date?
      • Fee preferences? Free or Paid?
      • Auto booking? yes-please or no

Share and Feedback

I will not mind sharing a cup of coffee TEA

Must Read - 1st Para: https://apisetu.gov.in/public/marketplace/api/cowin/cowin-public-v2

Futurescope:

  1. As I had an ios phone, It was not possible to automate otps, however, it is possible to automate otp transmission via android.
    • This results in entering the otp every 15 mins, to continue the session for searching the slots.
    • This requires constant response from the user when notified either via computer beep or telegram notification.
  2. Inputs & outputs on telegram can be beautified, right now, I have just pushed them from console.
  3. Exception handling for inputs & url requests.

Special thanks to:

  1. pallupz: For sourcing the raw python code. : https://github.com/pallupz/covid-vaccine-booking/
  2. COWIN: For providing open APIs. : https://www.cowin.gov.in/
  3. Telegram: For providing open APIs. : https://web.telegram.org/
  4. Python: Life without you is not possible. : https://www.python.org/
  5. Lastly my wife: Srishti (@ournotesfromtheroads): For being my guinea pig :(https://www.instagram.com/ournotesfromtheroads/)

DISCLAIMER: USE IT AT YOUR OWN RISK.

  • This is a make-shift automation for booking the slot which was not possible manually due to the significant ratio for availability of vaccines & People in our country.
  • I am not a developer but an engineer/ Script writer. Consider this before making any comments or giving any advices.
  • Feel free to give suggestions, Also, please copy & enhance the code if you want.
    • Make sure to let me know, hopefully, I can also help.

Lastly, goes without saying: once you get your shot, please do help out any underprivileged people around you who may not have a laptop or the know-how. For instance any sort of domestic help, or the staff in your local grocery store, or literally the thousands of people who don't have the knowledge or luxury we do.

SCREENSHOTS:

You might also like...
Python wrapper for CoWin API's

Cowin Tracker Python API wrapper for CoWin, India's digital platform launched by the government to help citizens register themselves for the vaccinati

Is the CoWin website updated for registration?

CoWin-Update Is the CoWin website updated for registration? This is a very hacky PYTHON3 script to lookup the CoWin portal if they re-deployed their J

AHA is an incident management & communication framework to provide real-time alert customers when there are active AWS event(s). For customers with AWS Organizations, customers can get aggregated active account level events of all the accounts in the Organization. Customers not using AWS Organizations still benefit alerting at the account level.
Código que Utiliza Programação Dinâmica para resolver o problema da Moeda

Programação Dinâmica: Modelo baseado em recursão Utiliza a técnica de Memorização Não pode ser aplicada quando existe dependência entre as respostas G

Benachrichtigungs-Bot für das niedersächische Impfportal / Notification bot for the lower saxony vaccination portal

Ein kleines Wochenend-Projekt von mir. Der Bot überwacht die REST-API des niedersächsischen Impfportals auf freie Impfslots und sendet eine Benachrichtigung mit deinem bevorzugtem Service. Ab da gilt leider: der Schnellste gewinnt. Bitte missbraucht den Bot nicht und verwendet moderate Intervalle.

A Telegram Filter Bot, Support Unlimited Filter. Also, The Bot can auto-filter telegram File | video

A Telegram Filter Bot, Support Unlimited Filter. Also, The Bot can auto-filter telegram File | video

Telegram bot that search for the classrooms status of the chosen day and then return all the free classrooms using your preferred time slot
Telegram bot that search for the classrooms status of the chosen day and then return all the free classrooms using your preferred time slot

Aule Libere Polimi Since the PoliMi site no longer allows people to search for free classrooms this bot was necessary! It simply search for the classr

An Inline Telegram YouTube Downloader bot with custom, permanent thumbnail support and cancel upload facility. Make your fork now.

Inline-Tube-Mate (YouTube Downloader) An Inline Telegram bot that can download YouTube videos with permanent thumbnail support Bot need to be in Inlin

Cytotron - A unique discord bot like never before. Add it to your server to keep it active, motiviated, and amazing!!

Cytotron - Take your server to the next level Most of the details are in the website. Go to https://cytotron-bot.gq for more information. If that link

Comments
  • how to use it on windows 10

    how to use it on windows 10

    I read your #readme for installing it on windows. I am unable to install the dependencies. I am a novice, so I would require your help. I am learning this so that I can help underprivileged people.

    opened by saihivarkar 2
  • Error on startup : 'telegram_chatbot' object has no attribute 'selfid'

    Error on startup : 'telegram_chatbot' object has no attribute 'selfid'

    Hello, great app. I tried it once but after that it is throwing me error if I am trying it on another number. Can you please look into it?

    `

    Steps to subscribe
    1. Open telegram app
    2. Search for user (@CowinAutoBot) in the app
    3. Send this message within 5 minutes from now: Subscribe 174188 Traceback (most recent call last): File "C:\Users\Yash\Downloads\cowin-vaccination-book-slot-main\src\cowinVaccinationSlotAutoBooking.py", line 6, in from utils import generate_token_OTP, check_and_book, beep, BENEFICIARIES_URL, WARNING_BEEP_DURATION,
      File "C:\Users\Yash\Downloads\cowin-vaccination-book-slot-main\src\utils.py", line 11, in bot = telegram_chatbot(r"config.cfg") File "C:\Users\Yash\Downloads\cowin-vaccination-book-slot-main\src\telegramBot.py", line 15, in init self.selfid = self.read_selfid_from_config_file() File "C:\Users\Yash\Downloads\cowin-vaccination-book-slot-main\src\telegramBot.py", line 79, in read_selfid_from_config_file self.subscribe_To_Telegram() File "C:\Users\Yash\Downloads\cowin-vaccination-book-slot-main\src\telegramBot.py", line 60, in subscribe_To_Telegram self.selfid=self.recieveFromBot(timeout=300,isFirst=True,subsCap=f"Subscribe {captchSub}") File "C:\Users\Yash\Downloads\cowin-vaccination-book-slot-main\src\telegramBot.py", line 137, in recieveFromBot from_ = self.selfid AttributeError: 'telegram_chatbot' object has no attribute 'selfid'`
    opened by YashGovekar 2
  • Errror

    Errror

    D:\Cowin\cowin-vaccination-book-slot-main\src>python ./cowinVaccinationSlotAutoBooking.py Traceback (most recent call last): File "D:\Cowin\cowin-vaccination-book-slot-main\src\cowinVaccinationSlotAutoBooking.py", line 6, in from utils import generate_token_OTP, check_and_book, beep, BENEFICIARIES_URL, WARNING_BEEP_DURATION,
    File "D:\Cowin\cowin-vaccination-book-slot-main\src\utils.py", line 205 """Search by Pincode? Or by State/District? \nEnter 1 for Pincode or 2 for State/District. (Default 2) : """) ^ SyntaxError: unmatched ')

    opened by arunjyoti-ec 1
Owner
Shashank Bafna
Shashank Bafna
Telegram Bot to check covid vaccine slot availability on CoWin site

Cowin Assist Telegram Bot Check the bot here @cowinassistbot. This is a simple Telegram bot to Check slots availability Get an alert when slots become

null 32 Jun 21, 2022
A Python Script to automate searching of available vaccination centers in the city and hence booking

Cowin Vaccine Availability Notifier Cowin Vaccine Availability Notifier takes your City or PIN code as an input and automatically notifies you via ema

Jayesh Padhiar 7 Sep 5, 2021
A Python Script to automate searching of available vaccination centers in the city and hence booking

Cowin Vaccine Availability Notifier Cowin Vaccine Availability Notifier takes your City or PIN code as an input and automatically notifies you via ema

Jayesh Padhiar 7 Sep 5, 2021
Auto Liker, Auto Reaction, Auto Comment, Auto Follower Tool. RajeLiker Credit Hacker.

Auto Liker, Auto Reaction, Auto Comment, Auto Follower Tool. RajeLiker Credit Hacker. Unlimited RajeLiker Credit Hack. Thanks To RajeLiker.

Md. Mehedi Hasan 32 Dec 28, 2022
A Telegram Bot which notifies the user when a vaccine is available on CoWin Platform.

Cowin Vaccine Availability Notifier Telegram Bot A bot that notifies the available vaccines at given district in realtime. Introduction • Requirements

Arham Shah 7 Jul 31, 2021
This script books automatically a slot on Doctolib in one of the public vaccination centers in Berlin.

BOOKING IN BERLINS VACCINATION CENTERS This python script books automatically a slot on Doctolib in one of the public vaccination centers in Berlin. T

null 17 Jan 13, 2022
Auto-Approved-Bot - Auto Approved Invaite Link Request Telegram Bot

?? ????????-??????????????-?????? ?? ℹ️ ?????????? ℹ️ When a join request invita

Muhammed 32 Dec 18, 2022
Telegram bot to check availability of vaccination slots in India.

cowincheckbot Telegram bot to check availability of vaccination slots in India. Setup Install requirements using pip3 install -r requirements.txt Crea

Muhammed Shameem 10 Jun 11, 2022
A Telegram bot that scrapes websites for available vaccination appointments to notify users. (German)

@dachau_impf_bot ???? A Telegram bot to check the contents of https://termin.dachau-med.de for available slots and inform users of the available dates

null 1 Nov 21, 2021
A Telegram Bot which will ask new Group Members to verify them by solving an emoji captcha.

Emoji-Captcha-Bot A Telegram Bot which will ask new Group Members to verify them by solving an emoji captcha. About API: Using api.abirhasan.wtf/captc

Abir Hasan 52 Dec 11, 2022