Onleihe watcher with notifications and auto-rent
Project description
Onleiharr
Overview
Onleiharr monitors specific Onleihe URLs, sends notifications for new media, and can auto-rent or reserve based on keyword filters.
Installation (recommended: pipx)
- System requirements: Python 3.10+.
- Debian/Ubuntu:
sudo apt install pipx(orpython3-pipx) thenpipx ensurepath - Fedora/RHEL/CentOS:
sudo dnf install pipxthenpipx ensurepath - Arch/Manjaro:
sudo pacman -S python-pipxthenpipx ensurepath - Install onleiharr:
pipx install onleiharr - Verify:
onleiharr --version
Installation (alternative: from source)
- Clone the repo and install deps:
pip install -r requirements.txt - Run directly:
python3 main.py(auto-creates config on first run) - Or run as module:
python3 -m onleiharr
Quick start
- Create/edit config: run once to auto-create a template if missing:
onleiharr --onceThe default path is OS-specific (see below). Edit the created file with your credentials/URLs. - Run once to test:
onleiharr --once - Continuous mode:
onleiharr
Configuration (TOML)
- Default name:
onleiharr.toml. - Search order: CLI
-c/--config> envONLEIHARR_CONFIG> OS default path- Linux:
~/.config/onleiharr/onleiharr.toml - macOS:
~/Library/Application Support/onleiharr/onleiharr.toml - Windows:
%APPDATA%\onleiharr\onleiharr.toml
- Linux:
- If missing, the app creates a template at the resolved path and exits so you can fill credentials first.
Example onleiharr.toml
[general]
poll_interval_secs = 60.0
urls = [
"https://www.onleihe.de/nbib24/frontend/versionInfoList,0-0-0-109-0-0-0-2008-400005-812926447-0.html", # ct magazine
"https://www.onleihe.de/nbib24/frontend/simpleMediaList,0-0-0-109-0-0-0-0-0-1957099581-0.html", # finanzen magazine
]
keywords = [
"c´t",
"finanzen",
]
[notification]
# urls = [
# "tgram://{bot_token}/{chat_id}/?format=html",
# "pover://{user_key}@{app_token}/?format=html&priority=-1",
# ]
# apprise_config_path = "apprise.yml" # legacy file-based config
test_notification = false
email = ""
[credentials]
username = "your-username"
password = "your-password"
library = "your-library"
library_id = 0
How to get your Onleihe URLs
- In your browser, open the Onleihe section you want to monitor (e.g., magazine list, new releases, etc.).
- Copy the full URL from the address bar and paste it into the
urlslist inonleiharr.toml. - For readability, add an inline comment per URL (as shown in the example).
Environment overrides (optional)
ONLEIHARR_CONFIG(config path)ONLEIHARR_URLS(comma-separated list)ONLEIHARR_USERNAME,ONLEIHARR_PASSWORD,ONLEIHARR_LIBRARY,ONLEIHARR_LIBRARY_IDONLEIHARR_EMAIL,ONLEIHARR_APPRISE_URLS,ONLEIHARR_APPRISE_CONFIG,ONLEIHARR_POLL_INTERVAL,ONLEIHARR_TEST_NOTIFICATION,ONLEIHARR_KEYWORDS
Notifications (Apprise)
- Preferred: set
[notification].urls(Telegram, Pushover, etc.). - Legacy:
apprise.ymlis still supported via[notification].apprise_config_path.
Systemd (user mode)
- Install user unit:
onleiharr --install-as-user-systemd - Reload and enable:
systemctl --user daemon-reloadthensystemctl --user enable --now onleiharr - Logs:
journalctl --user -u onleiharr -f - If user systemd is inactive:
loginctl enable-linger $USER
Common flags
--log-level DEBUGfor verbose logging--oncefor a single poll iteration--interval 30to override poll interval--test-notificationto send an immediate test notify on first run
Troubleshooting
- No apprise URLs configured -> add
[notification].urlsor setONLEIHARR_APPRISE_URLS - User systemd not active -> run
loginctl enable-linger $USER, then reload/enable the unit - PATH issues with pipx -> run
pipx ensurepathand open a new shell
Runtime behavior
- Polls configured URLs, caches known media, sends notifications on new items.
- Auto-rent/reserve triggers when title matches keywords.
- Notifications are HTML formatted via Apprise.
License
- MIT
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
onleiharr-0.1.0.tar.gz
(378.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
onleiharr-0.1.0-py3-none-any.whl
(14.8 kB
view details)
File details
Details for the file onleiharr-0.1.0.tar.gz.
File metadata
- Download URL: onleiharr-0.1.0.tar.gz
- Upload date:
- Size: 378.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
295ce15d8daebbffdc253ebde6e85a213b65ac4d139128bde02be7de60c13079
|
|
| MD5 |
e725524a2d8404ae19849e2489820406
|
|
| BLAKE2b-256 |
155cae29065cbc132e308fac336febaaa4e0688957f167d44b6641492c4550ad
|
File details
Details for the file onleiharr-0.1.0-py3-none-any.whl.
File metadata
- Download URL: onleiharr-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6e5b72fa6545212d063e8aa598da0043713fdb39731bafcc7c56aca7d95ab4f
|
|
| MD5 |
d2e2956153359034babee419cbef17ba
|
|
| BLAKE2b-256 |
80a089540bca7c26b33cd7b730eadeb5479878517380899dd919570670e5487c
|