Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
8b39721
Delete config.ini.example
Soroosh-N Jan 28, 2023
cc12fb6
Delete requirements.txt
Soroosh-N Jan 28, 2023
0d90deb
Requirement installer!
Soroosh-N Jan 28, 2023
a5a0018
New version
Soroosh-N Jan 28, 2023
bde7661
Your Server Pusher
Soroosh-N Jan 28, 2023
3794762
Update visa.py
Soroosh-N Jan 28, 2023
e113837
Update README.md
Soroosh-N Jan 28, 2023
c151abe
Update README.md
Soroosh-N Jan 28, 2023
68611bc
Update README.md
Soroosh-N Jan 28, 2023
df2c801
Delete .gitignore
Soroosh-N Jan 28, 2023
1526855
Update README.md
Soroosh-N Jan 28, 2023
038c7cf
Update visa.py
Soroosh-N Jan 28, 2023
479996e
Update README.md
Soroosh-N Jan 28, 2023
bbe4419
Update README.md
Soroosh-N Jan 28, 2023
c9bc5a0
Update README.md
Soroosh-N Jan 28, 2023
63bf5c4
Update visa.py
Soroosh-N Jan 29, 2023
c4ea3ac
Update visa.py
Soroosh-N Jan 29, 2023
0af44db
Update README.md
Soroosh-N Jan 29, 2023
6e81e3e
Add files via upload
Soroosh-N Jan 31, 2023
5b5942f
Update README.md
Soroosh-N Jan 31, 2023
ac7dd22
Update config.ini.example
Soroosh-N Jan 31, 2023
2474e4a
Update README.md
Soroosh-N Feb 1, 2023
e9dcf25
Update embassy.py
Soroosh-N Feb 14, 2023
e9740ee
Update config.ini.example
Soroosh-N Feb 14, 2023
5f9a56d
Update embassy.py
Soroosh-N Feb 14, 2023
e14ae2d
Update config.ini.example
Soroosh-N Feb 14, 2023
3d9dee7
Update embassy.py
Soroosh-N Feb 14, 2023
3fa3221
Update README.md
Soroosh-N Feb 14, 2023
824459d
Update README.md
Soroosh-N Feb 14, 2023
d5c64f5
Update README.md
Soroosh-N Feb 15, 2023
45fbd79
Add files via upload
Soroosh-N Feb 21, 2023
d65338d
Update README.md
Soroosh-N Feb 21, 2023
058d580
Update README.md
Soroosh-N Feb 21, 2023
868b4f2
Update README.md
Soroosh-N Feb 22, 2023
e501d7e
Update visa.py
Soroosh-N Apr 9, 2023
05c71ae
Add files via upload
Soroosh-N Apr 9, 2023
930fc7e
Merge branch 'main' into main
Soroosh-N Apr 9, 2023
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
1 change: 0 additions & 1 deletion .gitignore

This file was deleted.

41 changes: 30 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,39 @@
# visa_rescheduler
US VISA (ais.usvisa-info.com) appointment re-scheduler - Colombian adaptation
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
- Google Chrome installed (to be controlled by the script)
- Python v3 installed (for running the script)
- API token from Pushover and/or a Sendgrid (for notifications)
- 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)

## Initial Setup
- Create a `config.ini` file with all the details required
- Install the required python packages: `pip3 install -r requirements.txt`
- 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
pip install webdriver-manager==3.7.0
pip install sendgrid==6.9.7
```

## Executing the script
- Simply run `python3 visa.py`
- That's it!
## How to use
- Initial setup!
- Edit information [config.ini.example file]. Then remove the ".example" from file name.
- [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 @yaojialyu for creating the initial script and to @cejaramillof for adapting it to Colombia!
Thanks to everyone who participated in this repo. Lots of people are using your excellent product without even appreciating you.
Binary file added _img.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 28 additions & 13 deletions config.ini.example
Original file line number Diff line number Diff line change
@@ -1,25 +1,40 @@
[USVISA]
[PERSONAL_INFO]
; Account and current appointment info from https://ais.usvisa-info.com
USERNAME = example@example.com
PASSWORD = xxxxxxxxxx
USERNAME = account@gmail.com
PASSWORD = account_pass
; Find SCHEDULE_ID in re-schedule page link:
; https://ais.usvisa-info.com/en-am/niv/schedule/{SCHEDULE_ID}/appointment
SCHEDULE_ID = 99999999
MY_SCHEDULE_DATE = 2024-01-01
; Spanish - Colombia
COUNTRY_CODE = es-co
; Bogotá
FACILITY_ID = 25
; Target Period:
PRIOD_START = 2023-03-20
PRIOD_END = 2023-06-01
; Change "en-am-yer", based on your embassy Abbreviation in embassy.py list.
YOUR_EMBASSY = en-am-yer

[CHROMEDRIVER]
; Details for the script to control Chrome
LOCAL_USE = True
; Optional: HUB_ADDRESS is mandatory only when LOCAL_USE = False
HUB_ADDRESS = http://localhost:9515/wd/hub

[PUSHOVER]
[NOTIFICATION]
; Get push notifications via https://pushover.net/ (optional)
PUSH_TOKEN = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
PUSH_USER = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

[SENDGRID]
PUSHOVER_TOKEN =
PUSHOVER_USER =
; Get email notifications via https://sendgrid.com/ (optional)
SENDGRID_API_KEY =
; Get push notifications via PERSONAL WEBSITE http://yoursite.com (Optional)
PERSONAL_SITE_USER = *********
PERSONAL_SITE_PASS = *********
PUSH_TARGET_EMAIL = notifyemail@gmail.com
PERSONAL_PUSHER_URL = https://yoursite.com/api/esender.php

[TIME]
; Time between retries/checks for available dates (seconds)
RETRY_TIME_L_BOUND = 10
RETRY_TIME_U_BOUND = 120
; Cooling down after WORK_LIMIT_TIME hours of work (Avoiding Ban)(hours)
WORK_LIMIT_TIME = 1.5
WORK_COOLDOWN_TIME = 2.25
; Temporary Banned (empty list): wait COOLDOWN_TIME (hours)
BAN_COOLDOWN_TIME = 5
13 changes: 13 additions & 0 deletions embassy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 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
}
35 changes: 35 additions & 0 deletions esender.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php
$USER = "XXXXXX";
$PASS = "XXXXXX";

// Visitor data:
$v_ip = $_SERVER['REMOTE_ADDR'];
$time = date('l jS \of F Y h:i:s A', $_SERVER['REQUEST_TIME']);
$json = file_get_contents('https://geolocation-db.com/json/'.$_SERVER['REMOTE_ADDR']);
$data = json_decode($json);

function test_input($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}

// Visitor sends an email:
if (isset($_POST["user"]) && $_POST["user"]==$USER){
if (isset($_POST["pass"]) && $_POST["pass"]==$PASS){
$email = test_input($_POST["email"]);
$title = test_input($_POST["title"]);
$msg = test_input($_POST["msg"]);
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
// Wrong Email Format
}else{
$content = test_input($_POST['msg']);
$msg = "Incoming email in $time:\nVisitor IP: $v_ip\nCountryName: ".$data->country_name."\nStateName: ".$data->state."\nCityName: ".$data->city."\n\nMessage:\n\n".$msg;
// send email
$headers = "From: pusher@your_website.com";
mail($email, "YOURSITE PUSH - ".$title, $msg, $headers);
}
}
}
?>
4 changes: 4 additions & 0 deletions req_installer.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pip install requests==2.27.1
pip install selenium==4.2.0
pip install webdriver-manager==3.7.0
pip install sendgrid==6.9.7
4 changes: 0 additions & 4 deletions requirements.txt

This file was deleted.

Loading