strm and cloud drives
A .strm file lets you add a video that lives on a cloud drive or another server. The server does not store the video, only a small text file that points to it. This page covers how to write the file, how playback is delivered, and when media info is read.
On this page
Write a .strm file#
A .strm file is plain text. Put the video address on the first line:
- A URL starting with
http://orhttps://. - A local path starting with
/, pointing to a location the server can read and the administrator allows.
Anything else (Windows paths, other protocols, an empty line) is not accepted, and the file is marked as unreadable.
Put the .strm file in the library folder like any other video, and name it as you would the video (for example Movie Name (2020).strm).
Choose how playback is delivered#
Open Plugins, open StrmTool under Built-in features, and set Default delivery. In each library's settings you can pick a different value, or leave it as Follow the default.
| Option | What happens | Good for |
|---|---|---|
| Proxy through the server (default) | The player talks to your server, which fetches the data from the cloud drive. | Players or networks that cannot reach the drive directly. Most reliable, but uses server bandwidth. |
| Redirect the player | The server tells the player to fetch the video directly from the drive. | Players that can reach the drive. Saves server bandwidth. |
| Redirect on the local network, proxy outside | Redirects at home, proxies when you are away. | Small upload bandwidth at home but fast direct access on the LAN. |
Direct link cache (on by default, can be turned off in the StrmTool settings): the server asks the drive for the direct link once and reuses it for a few minutes. Playback starts faster, the drive gets fewer requests, and you are less likely to be rate-limited. See Direct-link cache.
Redirecting the player (the last two options), the direct link cache, address rewrite rules, a custom User-Agent or Cookie and pre-reading media info are part of StrmTool PRO · MAX. Without PRO, .strm files still play, forwarded through the server.
Things to know:
- Only playback is redirected. The web player's streams, reading video info and casting are always proxied by the server, because those cannot follow a redirect.
- If the server cannot tell whether the player is on your local network, it proxies. It redirects only when it is sure.
- Some drives need a particular User-Agent or Cookie for direct links. Enter them in the StrmTool settings (User-Agent sent to the remote, Cookie sent to the remote).
- Address rewrite rules replace the start of an address with another, one rule per line:
prefix => replacement. - A direct link stays valid for as long as the drive decides. When it expires, playing again fetches a new one.
Direct-link cache PRO · MAX#
When a player is redirected, the server first asks the address you gave (for example a cloud-drive gateway) where the real file is, then sends the player there. Seeking in a video can make the player ask again and again, and some drives limit how often they answer. The Direct link cache setting in StrmTool makes the server remember that answer for a while, per member and player, so seeking does not trigger a new request each time.
- It is on by default and can be turned off in the StrmTool settings. The server keeps a link for a few minutes, and drops it earlier if the link itself says it expires sooner.
- It applies only when the player is redirected. A failed lookup is never remembered; the player is then sent to the original address.
- If the drive ties its links to the player's own address and refuses the server's answer (playback from outside fails with a 403), turn the Direct link cache setting off.
- The StrmTool page shows Link cache hits, Link cache misses and Fell back to direct redirect, so you can see whether it helps.
Choose when media info is read#
Before playing, the server needs the video's length, audio tracks and subtitle tracks. For a cloud drive this means reading from the drive, which is slow. In the library settings, set Reading media info → When to read:
- During scan: reads everything right after the scan. Good for small libraries.
- Background (default for cloud-drive libraries): reads slowly afterwards and steps aside while someone is watching.
- On playback: reads nothing ahead; the first play reads the file and starts a few seconds slower.
Reads at once (1 to 8, default 2 for cloud-drive libraries) limits how many files are read together, so the drive does not see too many requests. If the drive answers with 403 or 429 (too many requests), reading for that library pauses for a while and then continues.
Pre-read media info PRO · MAX#
With the Pre-read media info setting in StrmTool turned on, the server reads media info ahead of time: after scans, in the background, for the next episode while you watch one (Read the next episode while playing), and when a detail page is opened (Read when a detail page is opened).
Without PRO none of this happens ahead of time, but everything still works: the first play reads the video info on the spot and remembers it. The only difference is a slower first start. The switch is greyed out and marked PRO without a license, and your setting takes effect again once the license is back.
Media info cache PRO · MAX#
Reading a cloud-drive video's info can mean fetching tens of megabytes. The Media info cache plugin saves each file's info (tracks, chapters, intro and credits marks) as a small file in the server's data folder. Then:
- After you rebuild a library, import again or change database, a scan checks the cache first and skips reading the drive.
- Moved or renamed files still match (local files are recognized by content). Cloud-drive files still match if the domain changes, but not if the file is a different one.
- A damaged or unmatched cache entry is simply read again; nothing breaks.
It is enabled by default once installed. Turn Restore from the cache off to stop using it for restores. Disabling the plugin does not delete the cache. The server never cleans the cache folder by itself, so tidy it manually if it grows large. The plugin page shows the number of archived files and the space they use.
Limits#
- Subtitles embedded in a remote video cannot be extracted. Put subtitle files next to the
.strmfile. - Subtitles cannot be downloaded to a remote source that is read-only.