Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

London embassy and endless search support #7

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
# visa_rescheduler

The visa_rescheduler is a bot for US VISA (usvisa-info.com) appointment rescheduling. This bot can help you reschedule your appointment to your desired time period.

## Prerequisites

- Having a US VISA appointment scheduled already.
- [Optional] API token from Pushover and/or a Sendgrid (for notifications)(You also can use the esender.php file in this repo as an email pusher on your website)

## Attention

- Right now, there are lots of unsupported embassies in our repository. A list of supported embassies is presented in the 'embassy.py' file.
- To add a new embassy (using English), you should find the embassy's "facility id." To do this, using google chrome, on the booking page of your account, right-click on the location section, then click "inspect." Then the right-hand window will be opened, highlighting the "select" item. You can find the "facility id" here and add this facility id in the 'embassy.py' file. There might be several facility ids for several different embassies. They can be added too. Please use the picture below as an illustration of the process.
![Finding Facility id](https://github.com/Soroosh-N/us_visa_scheduler/blob/main/_img.png?raw=true)
![Finding Facility id](https://github.com/Soroosh-N/us_visa_scheduler/blob/main/_img.png?raw=true)

## Initial Setup

- Install Google Chrome [for install goto: https://www.google.com/chrome/]
- Install Python v3 [for install goto: https://www.python.org/downloads/]
- Install the required python packages: Just run the bat file in the Microsoft Windows. Or run the below commands:

```
pip install requests==2.27.1
pip install selenium==4.2.0
Expand All @@ -22,18 +27,21 @@ pip install sendgrid==6.9.7
```

## How to use

- Initial setup!
- Edit information [config.ini.example file]. Then remove the ".example" from file name.
- Edit information [config.ini.example file]. Then remove the ".example" from file name. Setting ENDLESS_SEARCH to True will make bot keep searching for an earlier date after the meeting was rescheduled to a date within specified range.
- [Optional] Edit your push notification accounts information [config.ini.example file].
- [Optional] Edit your website push notification [config.ini.example and esender.php files].
- Run visa.py file, using `python3 visa.py`

## TODO

- Make timing optimum. (There are lots of unanswered questions. How is the banning algorithm? How can we avoid it? etc.)
- Adding a GUI (Based on PyQt)
- Multi-account support (switching between accounts in Resting times)
- Add a sound alert for different events.
- Extend the embassies list.

## Acknowledgement

Thanks to everyone who participated in this repo. Lots of people are using your excellent product without even appreciating you.
6 changes: 4 additions & 2 deletions config.ini.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ PASSWORD = account_pass
SCHEDULE_ID = 99999999
; Target Period:
PRIOD_START = 2023-03-20
PRIOD_END = 2023-06-01
PRIOD_END = 2023-11-31
; Change to true if you want to continue searching for earier time in a time period after a time is found
ENDLESS_SEARCH = True
; Change "en-am-yer", based on your embassy Abbreviation in embassy.py list.
YOUR_EMBASSY = en-am-yer

Expand Down Expand Up @@ -37,4 +39,4 @@ RETRY_TIME_U_BOUND = 120
WORK_LIMIT_TIME = 1.5
WORK_COOLDOWN_TIME = 2.25
; Temporary Banned (empty list): wait COOLDOWN_TIME (hours)
BAN_COOLDOWN_TIME = 5
BAN_COOLDOWN_TIME = 5
19 changes: 10 additions & 9 deletions embassy.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# Embassy List
Embassies = {
# [EMBASSY (COUNTRY CODE), FACILITY_ID (EMBASSY ID), "Continue in different languages"],
"en-am-yer": ["en-am", 122, "Continue"], # English - Armenia - YEREVAN
"es-co-bog": ["es-co", 25, "Continuar"], # Spanish - Colombia - Bogotá
"en-ca-cal": ["en-ca", 89, "Continue"], # English - Canada - Calgary
"en-ca-hal": ["en-ca", 90, "Continue"], # English - Canada - Halifax
"en-ca-mon": ["en-ca", 91, "Continue"], # English - Canada - Montreal
"en-ca-ott": ["en-ca", 92, "Continue"], # English - Canada - Ottawa
"en-ca-que": ["en-ca", 93, "Continue"], # English - Canada - Quebec City
"en-ca-tor": ["en-ca", 94, "Continue"], # English - Canada - Toronto
"en-ca-van": ["en-ca", 95, "Continue"], # English - Canada - Vancouver
"en-am-yer": ["en-am", 122, "Continue"], # English - Armenia - YEREVAN
"es-co-bog": ["es-co", 25, "Continuar"], # Spanish - Colombia - Bogotá
"en-ca-cal": ["en-ca", 89, "Continue"], # English - Canada - Calgary
"en-ca-hal": ["en-ca", 90, "Continue"], # English - Canada - Halifax
"en-ca-mon": ["en-ca", 91, "Continue"], # English - Canada - Montreal
"en-ca-ott": ["en-ca", 92, "Continue"], # English - Canada - Ottawa
"en-ca-que": ["en-ca", 93, "Continue"], # English - Canada - Quebec City
"en-ca-tor": ["en-ca", 94, "Continue"], # English - Canada - Toronto
"en-ca-van": ["en-ca", 95, "Continue"], # English - Canada - Vancouver
"en-gb-ldn": ["en-gb", 17, "Continue"], # English - UK - London
}
Loading