SRvSaha / CoWinVaccineSlotFinder

Cross-Platform Software to Fetch the Available Slots & Book the Appointment for COVID-19 Vaccination
https://shawt.io/r/sYv
MIT License
81 stars 32 forks source link

Not booking slot for 18+ criteria #97

Closed 520rahul closed 3 years ago

520rahul commented 3 years ago

@SRvSaha as mentioned in issue #96 and #71 i tried to book slot today for 45 plus age and for a new age criteria slots were open i.e. 18+ it means all person 18+ but in front of me 5 centres came And gone but repo did not detected a single centre. I had to book it manually. I put minimum ag aa 18 and max as 99. I think there is a bug in repo because i always failed to book slot for 45+ using repo. But for 18-44 its very easy using repo. Plz look into repo and test why tis repo is not working on 45+. And plz check dose type and dose name criteria also may be there must b some bug

SRvSaha commented 3 years ago

@520rahul You may check the logic here:

https://github.com/SRvSaha/CoWinVaccineSlotFinder/blob/9d5010f536cba994a939757c1b96b66ca309a322/CoWin.Core/Models/CovidVaccinationCenter.cs#L387-L406

On High Level, logic is:

Consider Only those Centres where:

  1. Slots are open for MIN_AGE >= MIN_AGE_SET_IN_CONFIG and MIN_AGE < MAX_AGE_SET_IN_CONFIG (https://github.com/SRvSaha/CoWinVaccineSlotFinder/blob/9d5010f536cba994a939757c1b96b66ca309a322/CoWin.Core/Models/CovidVaccinationCenter.cs#L427-L432)
  2. Slot Availability for DOSE TYPE : DOSE_TYPE_MENTIONED_IN_CONFIG (https://github.com/SRvSaha/CoWinVaccineSlotFinder/blob/9d5010f536cba994a939757c1b96b66ca309a322/CoWin.Core/Models/CovidVaccinationCenter.cs#L434-L440)
  3. Slot Check Based on VACCINE_TYPE_IN_CONFIG (Optional) (https://github.com/SRvSaha/CoWinVaccineSlotFinder/blob/9d5010f536cba994a939757c1b96b66ca309a322/CoWin.Core/Models/CovidVaccinationCenter.cs#L416-L419)
  4. Slot Check Based on VACCINE_FEE_TYPE (Optional) (https://github.com/SRvSaha/CoWinVaccineSlotFinder/blob/9d5010f536cba994a939757c1b96b66ca309a322/CoWin.Core/Models/CovidVaccinationCenter.cs#L421-L425)

I think it should work for 45+ as well. Only thing is that if slots open for say 18+ & above, in that case the Min Age is 18 and Max should be say 99. If Min is set to 45, no slots will get found.

Need to check that. You can check that part at your end also for the above logic shared.

520rahul commented 3 years ago

@SRvSaha i put the same age criteria as mentioned by you i.e minimum 18 max 99 during booking but repo did not detected any centres. I have checked all my settings, still not able to find where is the problem for 45+ appointments

SRvSaha commented 3 years ago

Okay I will check @520rahul Share your config after removing the Confidential Info

Tnu02 commented 3 years ago

I tried booking for 2nd dose for 45+ with dosetype 2 and age between 18 to 60, it worked in my case.

520rahul commented 3 years ago

I tried booking for 2nd dose for 45+ with dosetype 2 and age between 18 to 60, it worked in my case.

@Tnu02 can u share your configuration plz. And what kind of slot it was whether 18+ or 18-44 or 45+

SRvSaha commented 3 years ago

@520rahul Because of #96 related changes, there are changes in the way data is being returned. Earlier, both min_age and max_age used to get returned even though max_age was useless and was never used in any computations.

Now, they send min_age and allow_all_age and as such there are three possiblilities:

image

image

image

So, I feel majority of the time you need to be using Option 1 unless you are sure that slots will be opened for Option 3 specifically, in case you are trying to booking for 45+ age group.

Tnu02 commented 3 years ago

@520rahul I did it for 18+ and above, now 45+ slots are also opening under the same at my location. You should also check once.

"MinAgeLimit": 18, "MaxAgeLimit": 60, "MinimumVaccineAvailability": 1, "VaccineType": "", "DoseType": 2, "VaccineFeeType": "Free", "SlotPreference": "Random",

520rahul commented 3 years ago

Okay I will check @520rahul Share your config after removing the Confidential Info

@SRvSaha this is my settings:- { "CoWinAPI": { "PublicAPI": { "FetchByDistrictUrl": "https://cdn-api.co-vin.in/api/v2/appointment/sessions/public/findByDistrict", "FetchByPINUrl": "https://cdn-api.co-vin.in/api/v2/appointment/sessions/public/findByPin" }, "ProtectedAPI": { "IsToBeUsed": false, // Set this to false if you want to search slots using Public API "FetchByDistrictUrl": "https://cdn-api.co-vin.in/api/v2/appointment/sessions/findByDistrict", "FetchByPINUrl": "https://cdn-api.co-vin.in/api/v2/appointment/sessions/findByPin", "ScheduleAppointmentUrl": "https://cdn-api.co-vin.in/api/v2/appointment/schedule", "AppointmentSlipUrl": "https://cdn-api.co-vin.in/api/v2/appointment/appointmentslip/download", "BeneficiaryIds": [ "11112222333344" ] }, "Auth": { "IsToBeUsed": true, "OTPGeneratorUrl": "https://cdn-api.co-vin.in/api/v2/auth/generateMobileOTP", "OTPValidatorUrl": "https://cdn-api.co-vin.in/api/v2/auth/validateMobileOtp", "Secret": "U2FsdGVkX18vDwDor+oOIG7vSUnINtlc/pxQcNiBulCm8LT5Sza+aIISKLqImbpMnRYgsN2QACPhggLWgZEpQg==", "Mobile": "9999999999" }, "SleepIntervalInMilliseconds": 1000, "IsThrottlingToBeUsed": true, // Use either true or false; By default true; True means IP throttling is inplace, False means IP throttling has been removed "ThrottlingThreshold": 10000, //Number of request per IP allowed for ThrottlingInterval "ThrottlingIntervalInMinutes": 50, "ThrottlingRefreshTimeInSeconds": 1, // Waiting Time when IP is throttled, before resuming the application again. Set the value Higher if you want more wait time when you IP is throttled, or Lower if you are in hurry to book (with chances of getting IP throttled more frequently) "TotalIterations": 10000, "SelfRegistrationPortal": "https://selfregistration.cowin.gov.in", "MinAgeLimit": 18, "MaxAgeLimit": 99, "MinimumVaccineAvailability": 1, "VaccineType": "COVISHIELD", // Blank Implies Any VaccineType: COVISHIELD OR COVAXIN OR SPUTNIK V; Default is any type of Vaccine "DoseType": 2, "VaccineFeeType": "Free", // Blank Implies Any VaccineFeeType: Free or Paid; Default is Free
"SlotPreference": "Last", // Preference of Slot of Booking, use either First or Last or Random; Default is Last (due to higher changes of getting the slot)
"IsSearchToBeDoneForVaccinationCentreName": false, // Set this is true if you want to search for specific Centres within your PINCode/District "VaccinationCentreNames": [ // Don't change me if you are not setting IsSearchToBeDoneForVaccinationCentreName as true "REPLACE_ME_WITH_YOUR_VACCINATION_CENTER_NAME_1", "REPLACE_ME_WITH_YOUR_VACCINATION_CENTER_NAME_2" ], // You need to put the exact names of the Vaccination Centres for which you want to search. You'll get that from CoWIN Portal "IsSearchToBeDoneByPINCode": true, // Set this as true if you want to set by PINCode "PINCodes": [ "301001" ], "IsSearchToBeDoneByDistrict": false, // Set this is true if you want to search By District "Districts": [ // Don't change me if you are not setting IsSearchToBeDoneByDistrict as true "REPLACE_ME_WITH_YOUR_DISTRICT_CODE_1", "REPLACE_ME_WITH_YOUR_DISTRICT_CODE_2" ], "DateToSearch": "" // DD-MM-YYYY Format, Blank implies tomorrow's day; Slots are searched ONLY FOR THE DATE in DateToSearch }, "Proxy": { "IsToBeUsed": "false", "Address": "" } }

govindasomani commented 3 years ago

@SRvSaha i put the same age criteria as mentioned by you i.e minimum 18 max 99 during booking but repo did not detected any centres. I have checked all my settings, still not able to find where is the problem for 45+ appointments

I have successfully booked 2nd doses using min 18 max 99 for 45+ individuals

520rahul commented 3 years ago

@SRvSaha sorry bother. I found my mistake. Slots were opened for today but i forgot to put date of today therefore repo searched for tomorrow’s slot. Sorry for my mistake. And thanks for giving your precious time. And thanks to @Tnu02 and @govindasomani also.

SRvSaha commented 3 years ago

Okay great. @520rahul Thanks @govindasomani @Tnu02 for inputs.

To overcome this kind of issue I am planning to create a proper full fledged FAQ.

It is in progress, contributions are welcome. See if you can contribute.

FAQs: https://github.com/SRvSaha/CoWinVaccineSlotFinder#faqs

520rahul commented 3 years ago

Okay great. @520rahul Thanks @govindasomani @Tnu02 for inputs.

To overcome this kind of issue I am planning to create a proper full fledged FAQ.

It is in progress, contributions are welcome. See if you can contribute.

FAQs: https://github.com/SRvSaha/CoWinVaccineSlotFinder#faqs

@SRvSaha your faq clears all the doubts. I have one point to share in point 2 where slot open for 18-44 u have mentioned max age to keep is 45 i think it would b 44. Plz check

SRvSaha commented 3 years ago

@520rahul No, 45 would work since it's not taking the Max Value. It's like Check it is less than Max Value. Yet, to be on the safer side, I am changing it to 44. Thanks

You may Add more Questions for FAQs which are usually the problems faced by end users or your faced, along with different possibilities to use the App.

@520rahul @Tnu02 @govindasomani Help Wanted