The filesystem functions modules provide two different methods for exposing TorBox downloads as a virtual filesystem: FUSE (userspace filesystem) and STRM (media player stream files).Documentation Index
Fetch the complete documentation index at: https://mintlify.com/torbox-app/torbox-media-center/llms.txt
Use this file to discover all available pages before exploring further.
FUSE filesystem (fuseFilesystemFunctions.py)
The FUSE implementation creates a virtual filesystem that streams content directly from TorBox on-demand.VirtualFileSystem class
List of download file dictionaries from the database.
is_dir
The path to check.
True if the path is a directory.
is_file
The path to check.
True if the path is a file.
get_file
The path to the file.
The file metadata dictionary, or None if not found.
list_dir
The directory path.
A sorted list of filenames/directory names in the directory.
TorBoxMediaCenterFuse class
getattr
The path to get attributes for.
A stat object with file attributes, or a negative errno value on error.
readdir
The directory path.
Yields directory entries.
read
The file path to read from.
Number of bytes to read.
Starting byte offset.
The file content bytes, or a negative errno value on error.
- Uses 64MB blocks for efficient downloading
- Caches up to 64 blocks per file (4GB total)
- Implements LRU (Least Recently Used) cache eviction
- Download links are cached for 3 hours
runFuse
This function blocks until the filesystem is unmounted.
- Mounts at the configured
MOUNT_PATH - Enables
allow_otherflag (allows all users to access) - On Linux, enables
nonemptyflag (allows mounting over non-empty directory) - Runs in foreground mode
unmountFuse
Exits the process if unmounting fails.
STRM filesystem (stremFilesystemFunctions.py)
The STRM implementation creates.strm files that media players like Plex, Jellyfin, and Kodi can read to stream content directly.
generateFolderPath
The download file dictionary containing metadata.
The relative folder path, or None if unable to generate.
- Movies:
{root_folder_name}/ - Series:
{root_folder_name}/{season_folder_name}/ - Raw mode: Uses original path structure
generateStremFile
.strm file at the specified location containing the download URL.
The relative folder path where the .strm file should be created.
The download URL to write in the .strm file.
The media type: “movie”, “series”, or “anime”.
The base filename (without extension).
The full download object (used in raw mode).
True if the file was created successfully, False otherwise.
- Returns False on FileNotFoundError (likely bad naming scheme)
- Returns False on OSError (likely permission issues)
- Logs all errors
runStrm
.strm files for all user downloads and removes stale files for deleted downloads.
This function does not return a value.
- Fetches all current downloads from the database
- Gets list of existing .strm files
- Creates .strm files for all current downloads
- Removes .strm files for downloads that no longer exist
- Cleans up empty directories
unmountStrm
This function does not return a value.