Refresh Plex or Jellyfin the Moment a Download Finishes
On this page ▾
A file finishes on your seedbox and then sits there, invisible, until your media server’s next scheduled scan — which by default can be hours away. There is no reason to wait: both Plex and Jellyfin expose a one-line HTTP call that triggers a scan immediately, and Liteflow can fire it the moment rTorrent marks a download complete.
What you need first
- Your media server reachable over HTTP — on the seedbox itself, or at home through a domain or Tailscale address.
- An access token. For Plex this is
X-Plex-Token; for Jellyfin and Emby it is an API key you generate in the dashboard. - The library (section) id you want refreshed.
Finding the Plex section id
Open https://your-plex:32400/library/sections?X-Plex-Token=YOUR_TOKEN in a browser. Each <Directory> element has a key — that number is the section id. Movies is often 1, TV often 2, but check rather than assume.
Finding your Jellyfin API key
Dashboard → Advanced → API Keys → +. Copy the key; Jellyfin will not show it again.
Set up the flow
- Open your service in the client area and click Open Liteflow on the Automation card.
- Create New → Start from Template, choose Refresh Plex or Jellyfin when a download finishes, then Use Template and Confirm.
- Click Torrent Finished and select your rTorrent connection.
- Click Refresh the library and fill in the URL and header for your server (below).
- Click Test Step. A 200 means the scan started. Then Publish.
Plex
Method GET, URL https://your-plex:32400/library/sections/1/refresh, header X-Plex-Token: YOUR_TOKEN. Plex answers with an empty 200 — that is success.
Jellyfin
Change the method to POST, URL https://your-jellyfin/Library/Refresh, header X-Emby-Token: YOUR_API_KEY. Jellyfin returns 204. This refreshes every library; Jellyfin has no per-library refresh endpoint, and a scan of an unchanged library is cheap.
Emby
Identical to Jellyfin: POST https://your-emby/Library/Refresh with X-Emby-Token.
Only refresh the right library
If you sort downloads with labels, add a label to the Torrent Finished trigger and make one flow per library — a movies flow that refreshes section 1 and a tv flow that refreshes section 2. The auto-label template sets those labels for you.
If it does not fire
- 401 or 403 — the token is wrong or expired. Plex tokens are per-user; regenerate from a signed-in session.
- Connection refused or a timeout — the URL is not reachable from the seedbox. A media server behind your home router needs a public hostname, a tunnel, or a reverse proxy; a LAN address like
192.168.1.20will never work from outside. - 200 but nothing new appears — the scan ran but the file is not in a path that library watches. Check the library’s folders against the download directory the file actually landed in.
If your media server runs on the seedbox itself, an alternative worth knowing about is autopulse, also in the app catalogue: it watches Sonarr and Radarr import events and refreshes Plex, Jellyfin and Emby without any flow at all. Use Liteflow when the trigger should be the torrent finishing rather than an *arr import.
Related articles
Put this into practice
EvoSeedbox ships with one-click app installs and up to 10 Gbps per box.