Avatar

ttyrex's blog

Yet another Transmission RSS script

— By ttyrex

There was a time when the logical first step before coding your own solution was to check GitHub for an “official” or community-supported option.

Let’s be realistic for once, in the era of Copilot, for ideas like this, it’s now quicker and more satisfying to just build it yourself. Especially for ideas like this, where AI just excels at helping you write code to parse data or craft regex patterns.

So here’s yet another script that parses RSS and feeds Transmission to automatically download torrents.

The goal’s simple: make something that runs smoothly in K3S, skips the burden of persistent storage (hello, ConfigMap), and lets me fine-tune regex patterns to catch exactly what I want.

GitHub Repository: feedsniper 🎯

As for the regex, the script is using Python’s built-in re module, so you can leverage any pattern it supports.

Example of config:

feed_url: "https://example.com/rss"
regex_rules:
  - pattern: ".*Sasha Peyton Smith.*"
    download_dir: "/downloads/sasha_peyton"
  - pattern: ".*debian.*"
    download_dir: "/downloads/best-os"
  - pattern: "^The World.*"
    download_dir: "/downloads/news"

Use the command line to create a ConfigMap with embedded YAML (yes, this is YAML in YAML).

$ kubectl create configmap config-volume --from-file=config.yaml --namespace feedsniper

Nothing special to report on the code itself—PyPI’s Transmission module is straightforward and works very well. The only issue I ran into is that the name in the RSS feed and the name embedded in the torrent file can differ. So, normalizing the name is a helpful trick to reliably check if a torrent is already registered.

^EOF

/bittorent/ /diy/ /self-hosted/ /transmission/