Coder Social home page Coder Social logo

cowin-vaccination-auto-schedule's Introduction

CoWin-Vaccination-Auto-Schedule

A Python 3 Script to Continuously Monitor Vaccine Availability and Schedule CoWin Vaccination Appointment. This supports Capcha.

Please add/change REGISTERED_MOBILE_NUMBER, Beneficiaries_Ids, DOSE, VACCINE and PINCODES as per your choice before following below steps.

Requirements: Python 3.5+ and requests library

Steps:

  1. execute book.py script using python book.py command

    Once you start the script, it will iterate over the given PINCODES indefinately and would check the availability of vaccines.

    you will get log message given below

    Checking for pincode: 411001
    
    Checking for pincode: 411006
    
    Checking for pincode: 411002
    
    Checking for pincode: 411011
    
    Checking for pincode: 411017
    
    Checking for pincode: 411026
    
    Checking for pincode: 425412
    
    Checking for pincode: 411001
    
    Checking for pincode: 411006
    
    Checking for pincode: 411002
    
    Checking for pincode: 411011
    
    Checking for pincode: 411017
    
    Checking for pincode: 411026
    
    Checking for pincode: 425412
    

    As soon as vaccine slots becomes available to any of the given pincodes script would first attemp to login

    you will get log message given below

    sending otp..........
    OTP SENT SUCCESSFULLY
    Transaction ID: {'txnId': 'b09b5a70-f381-43ae-8393-88c638af5f3e'}
    Press y/Y to continue if you received OTP.
    Press n/N to retry. Max Retry limit:3
    ===>
    
    • Once you get OTP on your registered number then press y or Y and then enter key to continue. You will see log message like shown below.

      Enter OTP received on 1234567890: 
      

      Enter the OTP and press enter key

    • If you don't get OTP within 3 minutes then press n or N and then enter key to retry. Limit is 3. If you don't get OTP in 3 trials then script will continue to monitor pincodes.

  2. Once you enter correct OTP you will see below message.

    OTP SENT SUCCESSFULLY
    Transaction ID: {'txnId': 'b09b5a70-f381-43ae-8393-88c638af5f3e'}
    Press y/Y to continue if you received OTP.
    Press n/N to retry. Max Retry limit:3
    ===>y      
    Enter OTP received on 1234567890: 380906
    OTP SUCCESSFULLY VERIFIED
    
  3. After successfull login, script will try to book the slot. Script won't ask you to choose center/slots/vaccine or any of the parameter if its first dose and for 2nd dose it will choose the vaccine given by you in config.py file. API needs capcha output as well. Script will download capcha in html format as svg.html in same working directory as book.py. Script will ask you to enter the captcha. Open svg.html in browser and enter the capcha and press enter(capcha is case sensitive)

    You will get log message given below

    Trying to book: {'center_id': 687758, 'session_id': '0d66a93e-7325-48a9-8375-1b5f3bc5fddd', 'beneficiaries': ['19403282229890'], 'slot': '09:00AM-11:00AM', 'dose': 1}
    captcha downloaded successfully
    Enter Captcha:5muwy
    Scheduled Successfully.
    response: {'appointment_confirmation_no': '32c5b4d3-abcf-42fd-8913-da98898bac11'}
    booking successfull
    

Note:

This Script will book appointment for next day by default. If you wish to change this behaviour you can edit DATE variable in config.py

It is very basic script. Use it on your own risk.

1 2 3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.