Using MLOL and PressReader to read newspapers from all over the world is pretty handy, if you use the mobile apps only, though, it may become pretty painful to remember once every week to manually login into MLOL and then PressReader from the desktop version so that PressReader doesn't throw you out of their system.
With pressReadMePlease you can automate this, set it and forget it!.
By default the authentication token updating procedure will launch every Friday at 3.20am, of course you can edit this scheduling in the related crontab file.
You can pull the Docker image with
docker pull tatoalo/pressreader-automation:latest
and subsequently launch the container with:
docker run --name pressreader -itd --restart unless-stopped -v config.toml:/src/config.toml tatoalo/pressreader-automation
version: "3.8"
services:
pressreadmeplease:
image: tatoalo/pressreader-automation
restart: unless-stopped
volumes:
- /path/to/my/configuration/file:/config/file
The application, in order to properly function, requires a file config.toml
located in the /src/
directory, where the source code lives, mount it appropriately.
Configuration example:
[mlol]
website = "https://example.medialibrary.it"
username = "username"
password = "password"
[pressreader]
username = "username"
password = "password"
In order to receive telegram notifications about runtime errors, add this section to the previously introduced config.toml
file:
# Optional
[notification_service]
telegram_base_url = "https://api.telegram.org/bot"
telegram_token = "token/"
telegram_chat_id = 6942
Additionally, support for attaching screenshots has also been implemented. This action makes sense just in certain flows (missing button that was expected to be found) and will be sent in addition to the error message.
If you want, you can run this beside Watchtower which allows you to automatically keep all your images up-to-date.
If you want, of course, you can also run pressReadMePlease
without a Dockerized environment.
Setup your python environment as you see fit, if you want to use poetry
, a venv
will be automatically created:
1. Clone repo locally
2. cd inside project directory
$ pip install poetry
$ poetry update && poetry install
$ poetry run playwright install chromium
$ poetry run playwright install-deps chromium
You can now launch pressReadMePlease
$ PYTHONPATH="." poetry run python /src/pressreadmeplease.py
In order for the program to run periodically, you can setup a cron job and activate it inside any init system you have access to in your distro.