Skip to content

tatoalo/pressReadMePlease

Repository files navigation

pressReadMePlease

🦄 Automagically🪄 refresh PressReader weekly token. (currently tested against 🐍 3.9, 3.10 & 3.11.9)
ko-fi

MIT Pulls from DockerHub Docker Image Version

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.

Quick Start w/ Docker

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

Docker Compose

version: "3.8"
services:
  pressreadmeplease:
    image: tatoalo/pressreader-automation
    restart: unless-stopped
    volumes:
      - /path/to/my/configuration/file:/config/file

Authentication Data

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"

Telegram Notifications & Screenshot Support (optional)

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.

Watchtower support

If you want, you can run this beside Watchtower which allows you to automatically keep all your images up-to-date.

Run w/out Docker

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.

About

PressReader 🐍 automation for mobile apps auth token

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project