Benachrichtigungs-Bot für das niedersächische Impfportal / Notification bot for the lower saxony vaccination portal

Overview

Benachrichtigungs-Bot für das niedersächische Impfportal 🐴

GitHub tag (latest by date) codecov Python GitHub license

English version here.

Ein kleines Wochenend-Projekt von mir. Der Bot überwacht die REST-API des niedersächsischen Impfportals (https://impfportal-niedersachsen.de) auf freie Impfslots und sendet eine Benachrichtigung mit deinem bevorzugtem Service. Ab da gilt leider: der Schnellste gewinnt. Bitte missbraucht den Bot nicht und verwendet moderate Intervalle.

🤖 Features

  • Automatisches Suchen von kurzfristigen Impfterminen
  • Benachrichtigungen über E-Mail, Telegram und vielen anderen Services
  • Öffnet deinen Browser automatisch wenn ein Termin gefunden wurde. Du musst nur noch deine Daten eingeben!
  • Einfaches Einrichten mit GUI-Interface

Was der impfbot nicht macht: Dem Termin für dich reservieren und/oder deine Daten automatisch eingeben.

⚙️ Setup

Voraussetzungen

📝 Anleitung - Schritt für Schritt

Am Beispiel von Windows:

  1. Python von hier runderladen und installieren: https://www.python.org/downloads/
  2. Den Bot runterladen (Rechts bei den Releases oder hier)
  3. Das Archiv (Die Zip-Datei) entpacken
  4. config.example.ini nach config.ini umbennen und deine Daten eintragen (PLZ, Geburtstag, Email-Server-Daten
  5. Doppelklick auf windows_validate.bat, um die Einstellungen zu prüfen
  6. Doppelklick auf windows_start.bat

Wer den Impfbot auf seinem Android-Smartphone laufen lassen möchte, liest hier weiter.

Für Fortgeschrittene steht alternativ auch ein Docker-Container zur Verfügung. Siehe dazu docker. Das Validieren der Config funktioniert über den Befehl docker exec impfbot python src/validate_config.py -a.

📣 Einrichten von Telegram

  1. https://t.me/BotFather anschreiben und Bot erstellen. Den Token dann in die config.ini kopieren.

Folgende Schritte muss für jeden ausgeführt werden, der Nachrichten empfangen will

  1. https://t.me/userinfobot anschreiben und "Id"-Nummer in die config.ini kopieren (mehrere Nummern mit , getrennt).
  2. Mit dem eigenen Bot muss vorher eine Konversation begonnen werden! (URL steht in der Botfather-Nachricht, dort /start drücken)
  3. Validieren, dass auch alles funktioniert: Doppelklick auf windows_validate.bat

🛠️ config.ini Parameter

Deine Daten werden nur lokal gespeichert!

  • [COMMON]: Allgemeine Einstellungen
    • birthdate - Dein Geburtstag - Da die Verteilung vom Alter abhängig ist, ist dieser zwingend notwendig. Beispiel: 23.06.1912
    • group_size - Gruppengröße - Wenn du lieber einen Gruppentermin suchen möchtest musst du birthdate auskommentieren und eine Gruppengröße angeben (zwischen 2 und 15). Es darf nur eins von beiden in der Config sein! Beispiel: 5
    • zip_code - Fünfstellige PLZ für das Impfzentrum, das der Bot überwachen soll. Beispiel: 49123
  • [EMAIL]: E-Mail-Einstellungen. Bei manchen Anbietern müssen vorher bestimmte Einstellungen gemacht werden, eine Sammlung von Anleitungen findet ihr hier.
    • enable - Legt fest, ob E-Mails versendet werden sollen. true wenn ja, sonst false.
    • sender - Die E-Mail-Adresse, von der die Benachrichtigungen versendet werden sollen. Beispiel: [email protected]
    • user - Login Name für den SMTP-Server (in den meisten Fällen identisch mit der Absender Adresse)
    • password - Das Passwort für die Absender-E-Mail-Adresse.
    • server - Der SMTP-Server. Beispiel: smtp.server.tld
    • port - Der Port für den SMTP-Server. Beispiel: 465
    • receivers - E-Mail Empfänger Liste - Trag hier auch deine Absender-Adresse ein, wenn du selber Mails empfangen möchtest (Mit Kommata getrennt). Beispiel: [email protected],[email protected],[email protected] oder (nur an sich selbst) [email protected]
  • [TELEGRAM]:Telegram-Einstellungen
    • enable - Legt fest, ob Telegram-Nachrichten versendet werden sollen. true wenn ja, sonst false.
    • token - Bot-Token - Dieser zunächst beim BotFather generiert werden: https://t.me/BotFather
    • chat_ids - User-IDs der Empfänger - Die bekommst du am einfachsten wenn du den User-Info-Bot anschreibst https://t.me/userinfobot. Da bekommst du eine Id, die hier eingetragen werden muss. Mehrere Id's durch Kommata trennen.
  • [WEBBROWSER]: Webbrowser-Einstellungen
    • enable - Legt fest, ob der Browser automatisch geöffnet werden soll. (Nur auf Desktop-Systemen) true wenn ja, sonst false.
  • [APPRISE] Verschiedene Benachrichtigungsservices (So ziemlich alles was man sich vorstellen kann).
    • enable - 'true' wenn Apprise verwendet werden soll, sonst 'false'
    • service_uris - Service URIs. Für mehr Informationen: Apprise Documentation (Mehrere URIs durch Kommata trennen)
  • [ADVANCED]: Einstellungen für Fortgeschrittene, hier wird's experimentell
    • cooldown_between_requests - Wartezeit zwischen den Abfragen; Eine zu kleine Wartezeit führt zu einem IP-Ban (Default: 1 min, kann aber empirisch verkleinert werden)
    • cooldown_between_failed_requests - Wartezeit zwischen fehlgeschlagenen Versuchen. Bei jedem weiteren wird die Wartezeit nochmal hinzuaddiert, um einen IP Ban zu verhindern. D.h. fünf Fehlschläge = Wartezeit von 5*15s bis zum nächsen Aufruf
    • cooldown_after_ip_ban - Wenn eine Abfrage 10x fehlschlaegt, ist die IP vermutlich gebannt. Standardmaeßig wird dann 3 h gewartet.
    • cooldown_after_success - Cooldown, nachdem ein Impftermin gefunden wurde. Standardmaeßig wird dann 15 min gewartet (in Sekunden)
    • jitter - Zufällige Zeitspanne von 0-jtter Sekunden, die auf die Wartezeiten addiert wird (Default: 5)
    • sleep_at_night - Legt fest, ob der Bot nachts schlafen soll (Default: true, da eh keine Termine veröffentlicht werden)
    • user_agent- Der User Agent, der im Header übermittelt wird (Default: impfbot)

Beispiel Config:

[COMMON]
zip_code=42042
birthdate=23.06.1912

[EMAIL]
enable=true
sender[email protected]
user=username
password=xxxxxx
server=smtp.server.de
port=465
receivers[email protected],[email protected],[email protected]

[TELEGRAM]
enable=true
token=TOKEN
chat_ids=123456789,987654321

[WEBBROWSER]
enable=true

[APPRISE]
enable=false
service_uris=discord://webhook_id/webhook_token,matrix://hostname

[ADVANCED]
cooldown_between_requests=60
cooldown_between_failed_requests=10
cooldown_after_ip_ban=10800
cooldown_after_success=900
jitter=5
sleep_at_night=true
user_agent=impfbot

Sonstiges

🙋 Feedback & Probleme beim Einrichten

Schreib hier oder twitter mich an.

Sponsoring

Dir hat der impfbot geholfen und du möchtest monetär etwas beitragen? Dann spende doch unter dieser Spendenaktion an Ärzte ohne Grenzen. (Ja, etwas abgekupfert von vaccipy. Aber ich fand die Idee gut.)

🙏 Vielen Dank an:

  • paulypeter - Telegram Integration, Config-GUI & mehr
Comments
  • raspberry pi

    raspberry pi

    under raspberry pi4 i get the following errors by starting linux_validate.sh: File "src/validate_config.py", line 3, in from alerts import alert File "/usr/lib/impfbot-main/src/alerts.py", line 4, in from telegram.ext import Updater File "/home/pi/.local/lib/python3.7/site-packages/telegram/ext/init.py", line 21, in from .basepersistence import BasePersistence File "/home/pi/.local/lib/python3.7/site-packages/telegram/ext/basepersistence.py", line 25, in from telegram import Bot ImportError: cannot import name 'Bot' from 'telegram' (/home/pi/.local/lib/python3.7/site-packages/telegram/init.py)

    need more information 
    opened by tkurzer 14
  • Config creation interface if no config is provided

    Config creation interface if no config is provided

    A guided config setup via cli or even better gui, would great for inexperienced users.

    Features

    • generating config file
    • easy to use & understand
    • step by step
    • integrated check (no validation script needed afterwards)
    enhancement help wanted 
    opened by sibalzer 10
  • Auto booking enhancement

    Auto booking enhancement

    Good day,

    Is it possible to add auto booking code which only requires you to add the code you receive via mobile when promted? Even after reacting immediatley to the notification an appointment is available, it took me ~30 seconds to get to the booking page but not dates are clickable, see image.

    image

    You need some kind of super human speed to pull this off.

    Please let me know if this possible.

    Kinf regards

    wontfix discussion 
    opened by treichold 6
  • Running on android (termux)

    Running on android (termux)

    It's just a hint, that might be added to README: it's surprisingly easy to run the bot on android smartphones.

    All you need is termux (https://termux.com/), install python and maybe openssh to copy files and test everything from pc. Works for me without trouble, but maybe energy saving will make some in the future, I will see.

    documentation 
    opened by ronizzel 5
  • Running on server causes crash at import of configurator gui

    Running on server causes crash at import of configurator gui

    I am running the application on a server. When running version 3.0.0 it does crash when starting. Stacktrace:

    File "/mnt/user/opensoftware/impfbot/src/config_generator.py", line 2, in <module>
        import tkinter as tk
      File "/usr/lib64/python3.9/tkinter/__init__.py", line 37, in <module>
        import _tkinter # If this fails your Python may not be configured for Tk
    

    An easy fix is by only import the config generator and thereby tkinter, when needed.

    bug 
    opened by Muehli25 4
  • Document new config structure in README.md

    Document new config structure in README.md

    This is also required for v3.0.0!

    We should update README.md to explain the (new) config structure and options.

    TODO:

    • [x] Update README.md
    • [x] Create separate README in English
    • [x] move Contributing section to separate file CONTRIBUTING.md
    documentation 
    opened by paulypeter 4
  • Apprise Implementation

    Apprise Implementation

    Hello, for several different and easier ways of receiving notifications we could consider implementing Apprise (Discord, Telegram, etc.)

    https://pypi.org/project/apprise/

    enhancement help wanted 
    opened by ToHindahl 4
  • Printing of settings with a list value misses a delimiter

    Printing of settings with a list value misses a delimiter

    When printing the settings, every list value is just a concatenated string of the list entries, without any delimiter.

    Please replace this part of the code within settings.py with a simple join...

                    if isinstance(value, list):
                        value = ', '.join(value)
    #                    list_str = ""
    #                    for entry in value:
    #                        list_str += str(entry)
    #                    value = list_str
    

    The line behind the "isinstance" is the new one. Old lines which should be deleted are commented out.

    opened by andy71 3
  • Config properties in the example do not match requirements in Docker-Compose

    Config properties in the example do not match requirements in Docker-Compose

    I copied and modified the provided config.example.ini but the log of docker-compose tells me that fields are missing that are in the config with either slightly different name or in a different language.

    He wants geburtstag but the config says birthdate (same for zipcode).

    He wants enable_telegram but the config only has enable under [TELEGRAM]

    opened by MaggiWuerze 3
  • Error 'Could not send Email' during validation [gmail.com]

    Error 'Could not send Email' during validation [gmail.com]

    ### I am getting following error when i ran windows_validate.bat

    D:\impfbot-main\impfbot-main>py -3 -m pip install -q -r requirements.txt WARNING: You are using pip version 21.1.1; however, version 21.1.2 is available. You should consider upgrading via the 'C:\Program Files\Python39\python.exe -m pip install --upgrade pip' command.

    D:\impfbot-main\impfbot-main>py -3 src/validate_config.py 2021-06-07 14:13:41 [INFO] validate config.ini 2021-06-07 14:13:41 [INFO] settings validation finished Do you want to send a test message? yes/no y 2021-06-07 14:13:42 [INFO] [EMAIL] try to send e-mail 2021-06-07 14:13:42 [ERROR] Couldn't send mail: [Errno 11001] getaddrinfo failed 2021-06-07 14:13:42 [INFO] [TELEGRAM] send_telegram_msg is not set to true skipping 2021-06-07 14:13:42 [INFO] [WEBBROWSER] try to open browser 2021-06-07 14:13:42 [INFO] [WEBBROWSER] open browser was successful 2021-06-07 14:13:42 [INFO] Finished: Sending test massages 2021-06-07 14:13:42 [INFO] finished validation script

    ### Input in config:

    [EMAIL] ; true wenn eine Benachrichtigung via Mail gesendet werden soll sonst false enable=true ; Absender Adresse [email protected] ; Login Passwort password=xxxxxx ; smtp Server server=smpt.gmail.com ; smtp Port - derzeit kann nur an SSL Server gesendet werden port=465 ; E-Mail Empfaenger Liste [email protected],[email protected]

    support 
    opened by mbaudibmwvw 3
  • Docker image for Raspberry Pi (arm64) missing

    Docker image for Raspberry Pi (arm64) missing

    Hello,

    I was just about to set up the project on my Raspberry Pi, but found that the image is only provided for the amd64 architecture:

    [email protected]:~/impfbot/docker$ docker image inspect ghcr.io/sibalzer/impfbot:latest | grep "amd" "Architecture": "amd64",

    Since I believe that this application scenario could easily be made possible I have prepared a PR: https://github.com/sibalzer/impfbot/pull/76

    I used this to enable a multi-arch build: https://github.com/docker/build-push-action

    Since I have never worked with GitHub workflows before, I can't verify if this works.

    enhancement help wanted 
    opened by pixiono 3
  • Automatisierte Impfterminbuchung

    Automatisierte Impfterminbuchung

    Hallo, erst mal vielen Dank für dieses tolles Projekt. Jetzt meine Frage, AFAIK kann vaccipy automatisch buchen, wäre so was in Niedersachsen möglich?, hast du schon Erfahrungen gesammelt?, was wäre deine Einschätzung, wie viel Zeit würde man für dieses feature benötigen? Danke im Voraus.

    duplicate wontfix 
    opened by fer1975 13
  • add admin mail notifications

    add admin mail notifications

    Another feature that I would like to see, is a notification mail in case there is an IP ban. There should be an option to send this mail to a different set of addresses to avoid spamming the group.

    Originally posted by @DennisWilken in https://github.com/sibalzer/impfbot/issues/5#issuecomment-857055799

    enhancement 
    opened by sibalzer 1
  • Optimize interval timings

    Optimize interval timings

    Example for Contribution:

    No Shadowban after 2 Days:

    Settings

    • sleep_between_requests_in_s=300
    • sleep_between_failed_requests_in_s=30
    • sleep_after_ipban_in_min=180
    • jitter=15
    opened by sibalzer 5
Releases(v3.4.0)
Owner
sibalzer
Computer science and engineering student
sibalzer
The AWS Lambda Serverless Blind XSS App

Ass The AWS Lambda Serverless Blind XSS App 利用VPS配置XSS平台太麻烦了,如果利用AWS的Lambda那不就是一个域名的事情么?剩下的环境配置、HTTPS证书、隐私性、VPS续费都不用管了, 所以根据xless重写了Lambda平台的XSS,利用sla

cocokey 2 Dec 27, 2021
AminoAutoRegFxck/AutoReg For AminoApps.com

AminoAutoRegFxck AminoAutoRegFxck/AutoReg For AminoApps.com Termux apt update -y apt upgrade -y pkg install python git clone https://github.com/deluvs

3 Jan 18, 2022
veez music bot is a telegram music bot project, allow you to play music on voice chat group telegram.

🎶 VEEZ MUSIC BOT Veez Music is a telegram bot project that's allow you to play music on telegram voice chat group. Requirements 📝 FFmpeg NodeJS node

levina 143 Jun 19, 2022
Python linting made easy. Also a casual yet honorific way to address individuals who have entered an organization prior to you.

pysen What is pysen? pysen aims to provide a unified platform to configure and run day-to-day development tools. We envision the following scenarios i

Preferred Networks, Inc. 452 Jan 05, 2023
Salmanul Farisx Bot With Python

Salman_Farisx_Bot How To Deploy Video Subscribe YouTube Channel Added Features Imdb posters for autofilter. Imdb rating for autofilter. Custom caption

1 Dec 23, 2021
This repository contains the best Data Science free hand-picked resources to equip you with all the industry-driven skills and interview preparation kit.

Best Data Science Resources Hey, Data Enthusiasts out there! Finally, after lots of requests from the community I finally came up with the best free D

Mohit Kumar 415 Dec 31, 2022
A basic API to scrape Craigslist.

CLAPI A basic API to scrape Craigslist. Most useful for viewing posts across a broad geographic area or for viewing posts within a specific timeframe.

45 Jan 05, 2023
A Matrix-Instagram DM puppeting bridge

mautrix-instagram A Matrix-Instagram DM puppeting bridge. Documentation All setup and usage instructions are located on docs.mau.fi. Some quick links:

89 Dec 14, 2022
Process your transactions from etherscan (and other forks) into excel file for easier manipulation.

DEGEN TRACKER Read first This is my first Python open source project and it is very likely full of bad practices and security issues. You should not u

1 Oct 13, 2022
Mass-unscrobble Last.fm scrobbles based on artist, track title, or time of day of the scrobble.

Unscrobbler This program is designed to mass-unscrobble Last.fm scrobbles based on artist, track title, or time of day of the scrobble. For example, i

Nathan 6 Nov 04, 2022
A modular Telegram Python bot running on python3 with a sqlalchemy, redislab, mongo database, telethon, and pyrogram.

Zeldris Robot A modular Telegram Python bot running on python3 with a sqlalchemy, redislab, mongo database, telethon, and pyrogram. How to set up/depl

IDNCoderX 42 Dec 21, 2022
SIGIT - Simple Information Gathering Toolkit

SIGIT - Simple Information Gathering Toolkit Features userrecon - username reconnaissance facedumper - dump facebook information mailfinder - find ema

Termux Hackers 437 Dec 29, 2022
Evernote SDK for Python

Evernote SDK for Python Evernote API version 1.28 This SDK is intended for use with Python 2.X For Evernote's beta Python 3 SDK see https://github.com

Evernote 612 Dec 30, 2022
gnosis safe tx builder

Ape Safe: Gnosis Safe tx builder Ape Safe allows you to iteratively build complex multi-step Gnosis Safe transactions and safely preview their side ef

228 Dec 22, 2022
Python Discord Server Nuker

Untitled Nuker Python Discord Server Nuker Features: Ban Everyone Kick Everyone Rename Everyone Spam To All Channels Delete All Channels Delete All Ro

22 Dec 22, 2022
A discord bot that will help you browse/download nhentai sources.

Risa Introduction Risa is an nHentai discord bot that will help you browse and download your favorite doujin inside your own discord server. Hosting M

markee7 14 Oct 25, 2021
Pls give vaccine.

Pls Give Vaccine A script to spam yourself with vaccine notifications. Explore the docs » View Demo · Report Bug · Request Feature Table of Contents A

Rohan Mukherjee 3 Oct 27, 2021
💀 The first raid tool of its kind. Inject Deadcord and raid servers directly from the Discord client.

💀 Deadcord The next upcoming Discord raid tool, the best for free. 🎉 Early Beta Released We have released an early version of Deadcord, please keep

Galaxzy 157 May 24, 2022
Use GitHub Actions to create a serverless service.

ActionServerless - Use GitHub Actions to create a serverless service ActionServerless is an action to do some computing and then generate a string/JSO

107 Oct 28, 2022
An integrated information collection tool

infoscaner 环境配置 目前infoscaner仅支持在linux上运行,建议运行在最新版本的kali中 infoscaner是基于python3版本实现的,运行之前首先安装python库 如果同时存在python2和python3,请输入以下命令 pip3 install -r requi

CMACCKK 74 Sep 13, 2021