Skip to main content

Simple utility to re-announce torrents for Deluge on a timed interval (single run or indefinitely via CRON)

Project description

Deluge Announce

A script that will announce torrents on a timed interval (CRON).

Prerequisites

  • Python 3.10 or higher
  • Docker (if using Docker setup)

Setup

Options for Use

Running the Docker Container

To run the Docker container with the appropriate environment variables, use the following command:

docker run -e "WEB_URL=<your_web_url>" -e "PASSWORD=<your_web_url_password>" -e "CRON_SCHEDULE=0 * * * *" -e "SKIP_RE_ANNOUNCE=too many requests" -e "FORCE_RE_ANNOUNCE=warning|error" -e "FORCE_RE_ANNOUNCE_NEW_TORRENTS_INTERVAL=60" -e "FORCE_RE_ANNOUNCE_NEW_TORRENTS_MAX_AGE=300" -e "LOG_LEVEL=Info" -v "app_data:/app_data"

SKIP_RE_ANNOUNCE and SKIP_RE_ANNOUNCE expects pipe operator | separated strings. i.e. SKIP_RE_ANNOUNCE=reason1|reason2

Optionally you can provide the below variables that will check for newly added torrents and announce them as needed

FORCE_RE_ANNOUNCE_NEW_TORRENTS_INTERVAL: If set to anything greater than 0, the program will look for new torrents and re-announce them if less than the max age.

FORCE_RE_ANNOUNCE_NEW_TORRENTS_MAX_AGE: Max age of new torrents qualify to be force re-announced.

Optional

LOG_LEVEL defaults to Info. It can be any of Debug, Info, Warning, Error, or Critical. (Case insensitive)

This command will mount the app_data volume to persist logs across container restarts.

Running the Script as a Package

  1. Install the package
poetry add deluge-announce
# or
pip install deluge-announce
  1. Use in your Python code
from deluge_announce import Announcer
announcer = Announcer(
    web_url="https://yourweburl.com/",
    password="YOUR PASSWORD",
    cron_schedule="0 * * * *", # runs every hour
    skip_re_announce=["too many requests"], # defaults
    force_re_announce=["warning", "error"]  # defaults
    log_level="Info", # defaults to INFO from enum LogLevel. Strings are also accepted "Debug", "Info", "Warning", "Error", or "Critical". (Case insensitive)
    force_re_announce_new_torrents_interval=60, # optional, ignored if not using `run_forever`
    force_re_announce_new_torrents_max_age=300, # optional, ignored if not using `run_forever`
)

# Run the notifier once
announcer.run()

# Or run continuously as scheduled by cron
announcer.run_forever()

Checking Logs

Outside of Docker, you can view the logs in ./app_data/logs/.

Notes

  • The app_data volume is used for persistent storage.
  • If you're running the script outside Docker, the app_data folder will be created in your local directory to store logs and the database.
  • The cron_schedule format follows standard cron syntax for scheduling tasks. For example, 0 * * * * runs the script every hour.

Troubleshooting

  • Error Logs: If something goes wrong, check the logs at ./app_data/logs/ for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deluge_announce-0.1.4.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

deluge_announce-0.1.4-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file deluge_announce-0.1.4.tar.gz.

File metadata

  • Download URL: deluge_announce-0.1.4.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.11.9 Windows/10

File hashes

Hashes for deluge_announce-0.1.4.tar.gz
Algorithm Hash digest
SHA256 f2bf549a9a347fa0e19093bbda4719f0b0bf32cbdb68c1667597b55d3d68ad9d
MD5 1c208bef438f855731f6c9d2aad9d2f2
BLAKE2b-256 776a98b0f3c7762ed01cd5b934ead82d7e73ea1b1dc7fcf3813ae460c8f9e978

See more details on using hashes here.

File details

Details for the file deluge_announce-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: deluge_announce-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.11.9 Windows/10

File hashes

Hashes for deluge_announce-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 8d096ba5a1da402c8227fe75bb1efe2e67269ea489f34f9c1eae62037e3a6034
MD5 7926d72b724f0211970cba7ed92f9ec5
BLAKE2b-256 104c1026abcb04431c7136d149a9aef8ef65d544dc2a1e93a85d99521340b024

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page