All checks were successful
Python tests / tests (push) Successful in 2m18s
check_pa
Monitor the Berlin Perso/Passport portal, crack the audio CAPTCHA with Whisper, and notify a webhook when fresh status information drops.
Features
- Automates Firefox with Selenium to reach the Berlin appointment status page
- Downloads and transcribes audio CAPTCHAs via Whisper, falling back between attempts
- Normalizes the returned status text and emits structured data to any HTTP webhook
- Includes tooling for collecting captcha samples and benchmarking transcription quality
Requirements
- Python 3.12
- Firefox +
geckodriverin$PATHfor Selenium ffmpeg(needed byopenai-whisper)- Optional: Tesseract OCR if you experiment with the image-based approach in
ocr/ - Optional: Python packages from
requirements-ocr.txtwhen working on the OCR experiments
Setup
- Clone the repo and create a virtual environment:
python -m venv .venv && source .venv/bin/activate - Install runtime dependencies:
pip install -r requirements.txt - (Optional) Install OCR extras:
pip install -r requirements-ocr.txt - (Optional) Add tooling such as pytest:
pip install -r dev-requirements.txt - Provide credentials:
- Copy
settings.example.pytosettings.py - Set
DOCUMENT_ID(the identifier embedded in the Berlin status URL) - Set
WEBHOOK_URLpointing to the service that should receive status payloads
- Copy
Usage
Run python main.py to start a polling cycle. The script will:
- Launch Firefox (set
USE_HEADLESS_MODE = Trueinmain.pyfor CI/servers) - Download the audio CAPTCHA into
audio_captchas/ - Transcribe it with Whisper via
transcription.py - Parse the resulting status page and post
{status, last_updated}to your webhook
Helpful utilities:
test_transcription()insidemain.pyevaluates every mp3 inaudio_captchas/and writestranscription_results.csvtest_parse_status_page()parses the fixtures insample_html/to validate the BeautifulSoup logicocr/recognize*.pycontains earlier OCR experiments for the visual CAPTCHA
Testing
- Install dev tooling:
pip install -r dev-requirements.txt - Run
pytest
Data & Artifacts
audio_captchas/collects downloaded mp3 files for debugging/benchmarkingcaptchas/andocr/scripts help capture and label the image CAPTCHAssample_html/andsamples/host anonymized HTML snapshots used for parsing tests
Troubleshooting
- Whisper may need the
ffmpegbinary; ensureffmpeg -versionworks inside the venv - If Selenium cannot start, verify
geckodriver --versionis available and matches your Firefox version - For webhook issues, run a tool like
nc -l 8080orsmee.ioto inspect outbound payloads
Languages
HTML
78.7%
Python
21.3%