VFS Appointment Bot - This script automates checking for appointments at VFS Global offices in a specified country.
Project description
VFS Appointment Bot
This Python script(vfs-appointment-bot) automates checking for appointments at VFS Global portal in a specified country.
Installation
The vfs-appointment-bot
script can be installed using two methods:
1. Using pip
It is the preferred method for installing vfs-appointment-bot
. Here's how to do it:
-
Create a virtual environment (Recommended):
python3 -m venv venv
This creates a virtual environment named
venv
to isolate project dependencies from your system-wide Python installation (recommended). -
Activate the virtual environment:
Linux/macOS:
source venv/bin/activate
Windows:
venv\Scripts\activate
-
Install using pip:
pip install vfs-appointment-bot
This will download and install the
vfs-appointment-bot
package and its dependencies into your Python environment.
2. Manual Installation
For an alternative installation method, clone the source code from the project repository and install it manually.
-
Clone the repository:
git clone https://github.com/ranjan-mohanty/vfs-appointment-bot
-
Navigate to the project directory:
cd vfs-appointment-bot
-
Create a virtual environment (Recommended):
python3 -m venv venv
This creates a virtual environment named
venv
to isolate project dependencies from your system-wide Python installation (recommended). -
Activate the virtual environment:
Linux/macOS:
source venv/bin/activate
Windows:
venv\Scripts\activate
-
Install dependencies:
pip install poetry poetry install
-
Install playwright dependencies:
playwright install
Configuration
-
Download the
config/config.ini
template.curl -L https://raw.githubusercontent.com/ranjan-mohanty/vfs-appointment-bot/main/config/config.ini -o config.ini
-
Update the vfs credentials and notification channel preferences. See the Notification Channels section for details on configuring email, Twilio, and Telegram notifications.
-
Export the path of the config file to the environment variable
VFS_BOT_CONFIG_PATH
export VFS_BOT_CONFIG_PATH=<your-config-path>/config.ini
If you installed the script by cloning the repository (manual installation), you can directly edit the values in config/config.ini
.
Usage
-
Command-Line Argument:
The script requires the source and destination country code (as per ISO 3166-1 alpha-2) to be provided as a command-line argument using the
-sc
or--source-country-code
and-dc
or--destination-country-code
option. -
Running the Script:
There are two ways to provide required appointment details:
-
Responding to User Prompts (recommended):
vfs-appointment-bot -sc IN -dc DE
The script will prompt you to enter the required apponitment parameters for the specified country.
-
Using
-ap
or--appointment-params
:Specify appointment details in a comma-separated (not space-separated) key-value format:
vfs-appointment-bot -sc IN -dc DE -ap visa_center=X,visa_category=Y,visa_sub_category=Z
The script will then connect to the VFS Global website for the specified country, search for available appointments using the provided or entered parameters, and potentially send notifications (depending on your configuration).
-
Notification Channels
It currently supports three notification channels to keep you informed about appointment availability:
- Email: Sends notifications via a Gmail account.
- Twilio (SMS & Voice Call): Enables alerts through text messages and phone calls using Twilio's services.
- Telegram: Sends notifications directly to your Telegram account through a bot.
Configuring Notifications:
Email:
-
Email Account: You'll need a Gmail account for sending notifications.
-
App Password: Generate an app password for your Gmail account instead of your regular password. Refer to Google's guide for generating app passwords: https://support.google.com/accounts/answer/185833?hl=en.
-
Configuration File: Update your application's configuration file (
config.ini
) with the following details:email
(Required): Your Gmail address.password
(Required): Your generated Gmail app password.
Twilio:
-
Create a Twilio Account (if needed): Sign up for a free Twilio account at https://www.twilio.com/en-us to obtain account credentials and phone numbers.
-
Retrieve Credentials: Locate your account SID, auth token, and phone numbers within your Twilio account dashboard.
-
Configuration File: Update your application's configuration file (
config.ini
) with:auth_token
(Required): Your Twilio auth tokenaccount_sid
(Required): Your Twilio account SIDsms_enabled
(Optional): Enables SMS notifications (default: True)call_enabled
(Optional): Enables voice call notifications (default: False)url
(Optional): Twilio API URL (Only needed if call is enabled)to_num
(Required): Recipient phone number for notificationsfrom_num
(Required): Twilio phone number you'll use for sending messages
Telegram:
-
Create a Telegram Bot: Visit https://telegram.me/BotFather to create a Telegram bot. Follow the on-screen instructions to obtain your bot's token.
-
Configuration File: Update your application's configuration file (
config.ini
) with:bot_token
(Required): Your Telegram bot token obtained from BotFather.chat_id
(Optional): The specific Telegram chat ID where you want to receive notifications. If omitted, the bot will send notifications to the chat where it was messaged from. To find your chat ID, you can create a group chat with just yourself and then use the/my_id
command within the bot.
Supported Countries and Appointment Parameters
The following table lists currently supported countries and their corresponding appointment parameters:
Country | Appointment Parameters |
---|---|
India(IN) - Germany(DE) | visa_category, visa_sub_category, visa_center |
Iraq(IQ) - Germany(DE) | visa_category, visa_sub_category, visa_center |
Morocco(MA) - Italy(IT) | visa_category, visa_sub_category, visa_center, payment_mode |
Azerbaijan(AZ) - Italy(IT) | visa_category, visa_sub_category, visa_center |
Notes:
- Appointment parameters might vary depending on the specific country and visa type. Always consult VFS Global's website for the latest information.
Known Issues
1. Login Failures After Frequent Requests:
If the bot makes login requests to the VFS website too frequently, the VFS system might temporarily block your access due to suspected automation. This can lead to login failures.
- Workaround:
- Reduce request frequency: Consider increasing the delay between bot runs to avoid triggering VFS's blocking mechanisms. You can adjust the interval in the configuration or code.
- Retry after 2 hours: If you encounter a login failure, wait for at least 2 hours before retrying. The VFS block should expire within this timeframe.
2. Occasional Captcha Verification:
The VFS website requires a CAPTCHA verification step during login. Currently, the bot does not have a built-in CAPTCHA solver.
- Workaround:
- Wait and Retry: Sometimes, CAPTCHAs appear due to temporary website issues. Wait for a while and try again later.
- Retry in another browser: CAPTCHAs are often solved automatically in the Firefox browser. If it still fails, retry the login process in another browser by setting
browser_type
to"chromium" or "webkit"
in yourconfig.ini
file.
Note: We are constantly working to improve the bot's functionality. Future updates might include integrated CAPTCHA solving capabilities.
Extending Country Support
This script is currently designed to work with the VFS Global website for Germany. It might be possible to extend support for other countries by modifying the script to handle potential variations in website structure and parameter requirements across different VFS Global country pages.
Contributing
We welcome contributions from the community to improve this project! Here's how you can get involved:
- Report issues: If you encounter any bugs or problems with the script, please create an issue on the project's repository.
- Suggest improvements: Do you have ideas for making the script more user-friendly or feature-rich? Feel free to create an issue or pull request on the repository.
- Submit pull requests: If you've made code changes that you think would benefit the project, create a pull request on the repository. Please follow any contribution guidelines outlined in a CONTRIBUTING.md file.
Star History
Disclaimer
This script is provided as-is and is not affiliated with VFS Global. It's your responsibility to ensure you're complying with VFS Global's terms and conditions when using this script. Be aware that website structures and appointment availability mechanisms might change over time.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file vfs_appointment_bot-1.1.1.tar.gz
.
File metadata
- Download URL: vfs_appointment_bot-1.1.1.tar.gz
- Upload date:
- Size: 18.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 220d098920606ee69081559b6912762525dcd58ad8372f79ba72beb037ad5279 |
|
MD5 | 4607303cb2504ef6449f9285cd669715 |
|
BLAKE2b-256 | 0632ae8d4c3f4785ea62f00afd6e8183cebd9e57ea664bd95306415325926a58 |
File details
Details for the file vfs_appointment_bot-1.1.1-py3-none-any.whl
.
File metadata
- Download URL: vfs_appointment_bot-1.1.1-py3-none-any.whl
- Upload date:
- Size: 22.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02810b822ea9c52d422d3b7d565f9eb1edafddf92c07994cc1ca6a9bfb22d116 |
|
MD5 | 93982caab4b0227b94a58e4431c61933 |
|
BLAKE2b-256 | fa75f8e57bdfa43254c393b8325b62afed02f3398f1f283405eb0b5498d4e94f |