Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kalkih/passport-appointment-bot

An automated bot designed to seamlessly book appointments for the renewal or creation of Swedish passports or national ID cards.
https://github.com/kalkih/passport-appointment-bot

automation bot nodejs pass passport scraper swedish

Last synced: 6 days ago
JSON representation

An automated bot designed to seamlessly book appointments for the renewal or creation of Swedish passports or national ID cards.

Awesome Lists containing this project

README

        

đŸ€– 🛂 passport-appointment-bot 🛂 đŸ€–

⚠ For educational use only ⚠

> Bot to automatically find and book an appointment for renewal/creation of a Swedish passport or national identity card.

> _Bott som automatiskt söker och bokar första lediga tid för att förnya pass och/eller nationellt id kort._

### What does it do?

The bot searches for available appointments until one is found, it then tries to book the appointment. The bot will run until an appointment is successfully booked.
The bot can be configured to search for appointments in a specific region & in one or more cities at a time.
It can also be configured to run several concurrent booking sessions in order to increase searching speed & search multiple locations at the same time.

### How to run

Download `config.json` & `passport-appointment-bot` for your OS from the [latest release](https://github.com/kalkih/passport-appointment-bot/releases/latest), place them in the same folder.

1. Edit the configuration file downloaded (`config.json`) with any text editor, see [Configuration](#configuration) for information on the options
2. Run the executable downloaded earlier `passport-appointment-bot`
3. The bot will prompt for BankID identification (The booking system now requires BankID idetification to start a booking session)
4. The bot will search until an appointment is found
5. A booking confirmation will be sent to the configured email and/or phone number specified in the config, it will also be displayed in the application

### (Advanced) Run from source

Requires **Nodejs** _(Tested on v17.7.1)_

1. Clone the project, install dependencies with `npm install`
2. Edit configuration values in `config.json`, see [Configuration](#configuration) for information on the options
3. Run the bot with `npm start`
4. The bot will prompt for BankID identification (The booking system now requires BankID idetification to start a booking session)
5. The bot will search until an appointment is found
6. A booking confirmation will be sent to the configured email and/or phone number specified in the config, it will also be displayed in the console

### Configuration

#### Basic configuration options

| Option | Required | Description |
| -------------- | :------: | ------------------------------------------------------------------------------------------------ |
| region | ✅ | Desired region, see [Supported Regions & Locations](#supported-regions--locations) |
| locations | ✅ | One or more cities/locations, see [Supported Regions & Locations](#supported-regions--locations) |
| max_date | ✅ | Latest date to search for appointment (will search all days in the week of the specified date) |
| min_date | ❌ | Earliest date to search for appointment (will search all days in the week of the specified date) |
| booking_number | ❌ | An existing booking number to use when searching for available times. |
| email | ✅ | Email (confirmation will be sent to this address) |
| phone | ✅ | Phone number (confirmation will be sent to this number) |
| passport | ✅ | Set to `true` if the booking appointment is for passport, else `false` |
| id | ✅ | Set to `true` if the booking appointment is for national identity card, else `false` |
| confirmation | ✅ | Method for receiving booking confirmation `email` and/or `sms` |

#### Multiple people booking options

When booking for more than the person identifying with BankID, use these options to provide personal details for the other people (Do not include personal details for the person idetifying with BankID).

| Option | Required | Description |
| ------------------ | :------: | ---------------------------------------------------------------------------------------------------------------------------------- |
| extra_personnummer | ❌ | Additional Personnummer / Social security number(s), when booking for more than one person e.g. `["199401018453", "199601016406"]` |
| extra_firstnames | ❌ | Additional firstname(s), when booking for more than one person e.g. `["John", "Jane"]` |
| extra_lastnames | ❌ | Additional lastname(s), when booking for more than one person e.g. `["Doe", "Doe"]` |

#### Advanced configuration options

| Option | Required | Default | Description |
| ------------ | :------: | :-----: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| sessions | ❌ | `1` | Number of concurrent booking sessions to run, higher number equals faster checking of available times and opens up for checking multiple locations in parallel, (will still just book one appointment in the end) **(max 6)** |
| throttle | ❌ | `0` | The time to wait in **seconds** between searches |
| useProxies | ❌ | `false` | Set to `true` to use proxies for booking sessions, (a proxy list is required, see [Proxy information](#proxy-feature-information) for additional information. |
| proxyTimeout | ❌ | `30` | When using `setProxies` use this option to set the timeout in seconds before a proxy request should timeout and retry. |
| proxyRetries | ❌ | `3` | When using `setProxies` use this option to set the number of request retries with each proxy before switching proxy.. |

### Good to know

- Only one appointment can be booked per email and phone number.
- Both passport & national identity card can be renewed in one appointment, both options can therefore be set to true.
- Searching for appointment for more than one person at a time requires a longer appointment time and are thus harder to find.
- A maximum of 8 people can be booked in one appointment

### Related projects

- [Pass-fur-alle](https://github.com/jonkpirateboy/Pass-fur-alle) - Python & Selenium solution by @jonkpirateboy
- [passport_booker_se](https://github.com/elias123tre/passport_booker_se) - Python based solution by @elias123tre

### Supported Regions & Locations

Supported regions & locations can also be found in the `src/locations.js` file.

#### Blekinge

- Karlshamn
- Karlskrona

#### Dalarna

- Avesta
- BorlÀnge
- Ludvika
- Mora

#### Gotland

- Visby

#### GĂ€vleborg

- BollnÀs
- GĂ€vle
- Hudiksvall

#### Halland

- Falkenberg
- Halmstad
- Kungsbacka
- Varberg

#### JĂ€mtland

- FunÀsdalen
- Strömsund
- Sveg
- Åre
- Östersund

#### Jönköping

- Eksjö
- Jönköping
- VĂ€rnamo

#### Kalmar

- Kalmar
- Oskarshamn
- VĂ€stervik

#### Kronoberg

- Ljungby
- VÀxjö
- Älmhult

#### Norrbotten

- Arvidsjaur
- Boden
- GĂ€llivare
- Haparanda
- Kalix
- Kiruna
- LuleÄ
- PiteÄ

#### SkÄne

- Eslöv
- Helsingborg
- HĂ€ssleholm
- Klippan
- Kristianstad
- Landskrona
- Lund
- Malmö
- Trelleborg
- Ystad
- Ängelholm

#### Stockholm

- Flemingsberg
- Globen
- Haninge
- JĂ€rva
- Nacka
- NorrtÀlje
- Sollentuna
- Solna
- Sthlm City
- SödertÀlje
- Södra Roslagen

#### Södermanland

- Eskilstuna
- Katrineholm
- Nyköping
- Skavsta
- StrÀngnÀs

#### Uppsala

- Enköping
- Tierp
- Uppsala
- Östhammar

#### VĂ€rmland

- Arvika
- Karlstad
- Kristinehamn
- Torsby

#### VĂ€sterbotten

- Lycksele
- SkellefteÄ
- Storuman
- UmeÄ
- Vilhelmina

#### VĂ€sternorrland

- HÀrnösand
- Kramfors
- SollefteÄ
- Sundsvall
- Ånge
- Örnsköldsvik

#### VĂ€stmanland

- Fagersta
- Köping
- Sala
- VÀsterÄs

#### VÀstraGötaland

- AlingsÄs
- BorÄs
- Falköping
- Göteborg
- Lidköping
- Mariestad
- Mark/Kinna
- Mölndal
- Skövde
- Stenungsund
- Strömstad
- TrollhÀttan
- Uddevalla
- Ulricehamn
- ÅmĂ„l

#### Örebro

- Hallsberg
- Karlskoga
- Lindesberg
- Vivalla
- Örebro

#### Östergötland

- Linköping
- Motala
- Norrköping

### Proxy feature information

When setting the `useProxies` option to `true` you are expected to provide a list of proxies to use, the application expects a file named `proxies.txt` to be present in the same directory as the application. This file should include one proxy per line, the proxy should be in the format `[IP]:[PORT]`.

**Example**

```txt
0.0.0.0:6969
1.1.1.1:9999
2.2.2.2:420
```

This feature does currently only support **HTTP**/**HTTPS** proxies.

The application will cycle through the proxies in the list and will retry the request if the proxy is not responding, if a request times out multiple times with the same proxy, the application will switch to the next proxy in the list.
The thresholds for this behaviour can be configured through the `proxyTimeout` and `proxyRetries` configuration options.

For the best results use a list of high quality proxies.