Skip to content
EhnkodePublic

About

Mount your Xtream Codes / Dispatcharr VOD catalog (movies & TV shows) as real files for Plex, Jellyfin and Emby. Real file sizes, no downloads, web UI, .strm export. Docker & Unraid ready.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

Mountarr logo

Mountarr

Your IPTV VOD library as real files for Plex, Jellyfin and Emby.

Mount the movies and series of an Xtream Codes source, such as Dispatcharr, as a real folder tree with real file sizes. Plex, Jellyfin and Emby scan it like files on disk, and nothing is downloaded.

Dashboard Movie browser


Why

Media servers want files, an Xtream VOD catalog is a list of stream URLs. .strm files don't play in Plex, download tools fill your disk, and plain HTTP mounts fail because Xtream servers neither list folders nor report sizes. Mountarr sits in between: it builds a folder tree with Plex-friendly names, finds the real size of every file and mounts the tree with its built-in rclone.

Features

  • Real file tree with Plex-friendly names (Movies/Title (Year) {tmdb-123}/Title (Year).mkv) and real sizes. Titles only appear once their size is known, so the media server never sees a broken file.
  • Built-in mount: rclone runs inside the container, unmounts cleanly and repairs itself.
  • Kind to your source: one connection limit for playback and lookups, one connection always free for playback, no hung sessions after seeks.
  • Fast library scans: the start and end of every file are kept in a header cache, so a scan needs about one request per file and a rescan none.
  • Plex collections from VOD categories with one click, plus On my watchlist. Rotatarr can rotate them on the home screen.
  • Watchlist mode: titles on your Plex watchlist or a public Trakt list show up by themselves.
  • Versions: the same movie in several languages or in 4K becomes one movie with versions (optional).
  • Web UI: dashboard with live activity, poster browser, category rules, logs and update notice.
  • Automatic scans for Plex, Jellyfin and Emby, and a .strm export for Jellyfin, Emby and Kodi.

Quick start (Docker)

services:
  mountarr:
    image: ghcr.io/ehnkode/mountarr:latest
    container_name: mountarr
    init: true
    restart: unless-stopped
    ports:
      - "8899:8899"
    cap_add: [SYS_ADMIN]                # for the built-in mount
    devices: [/dev/fuse]
    security_opt: [apparmor:unconfined]
    environment:
      XTREAM_URL: http://192.168.1.10:9191
      XTREAM_USER: changeme
      XTREAM_PASS: changeme
      UI_PASSWORD: changeme
      CONNECTION_LIMIT: "2"
    volumes:
      - ./data:/data
      - /mnt/mountarr:/mountarr:rshared  # the file tree appears in /mnt/mountarr/vod on the host

Open http://<host>:8899/ui. The first catalog load takes a minute, and then sizes start coming in. Large catalogs take a while to probe completely (100k+ files can take a day or more), but titles appear in the tree as soon as their own size is known.

Map /mnt/mountarr into your media server container with rslave propagation (/mnt/mountarr:/mountarr:ro,rslave) and add /mountarr/vod/Movies and /mountarr/vod/TV Shows as libraries. The media server can be started before or after Mountarr.

Unraid

  1. Install Mountarr from Community Applications (Apps → search "Mountarr") and fill in the Xtream URL, user, password, a web UI password and the connection limit of your source. The template already sets up the mount: the file tree appears in /mnt/addons/mountarr/vod.
  2. In your Plex (or Jellyfin/Emby) container, add a path: container /mountarr, host /mnt/addons/mountarr, access mode Read Only – Slave.
  3. Create libraries for /mountarr/vod/Movies and /mountarr/vod/TV Shows, or add these folders to existing libraries.

Plex

  • Turn off Scan my library automatically and Run a partial scan when changes are detected for the Mountarr libraries, because FUSE mounts send no change events. Use Mountarr's partial scans instead: set PLEX_URL, PLEX_TOKEN and PLEX_LIBRARY_PATH (the mount path as Plex sees it, e.g. /mountarr/vod). Library IDs are detected automatically.
  • Turn off Empty trash automatically after every scan (Settings → Library). If the mount is ever unavailable during a scan, Plex would otherwise drop those titles from the library instead of just greying them out. Empty the trash by hand now and then, when Mountarr shows "All done".
  • Turn off Generate video preview thumbnails, intro/credits detection, chapter thumbnails, loudness analysis and voice activity detection for these libraries, and Perform extensive media analysis during maintenance (Settings → Scheduled Tasks). Each of those reads whole files over your source.

Jellyfin / Emby / Kodi

You can use the mount exactly as with Plex. For automatic scans of new titles set JELLYFIN_URL and JELLYFIN_API_KEY (Dashboard → API Keys), plus JELLYFIN_LIBRARY_PATH (the mount path as Jellyfin/Emby sees it) so only the new folders are reported. Emby uses the same settings.

  • Map the parent folder, not vod itself: host /mnt/addons/mountarr → container /mountarr, access mode Read Only – Slave. If you map vod directly, Jellyfin sees an empty folder after the mount is rebuilt (restart, update, watchdog).
  • Slow start when transcoding: Jellyfin probes files with -analyzeduration 200M -probesize 1G and sometimes reads the full gigabyte first. Set JELLYFIN_FFmpeg__probesize=50M and JELLYFIN_FFmpeg__analyzeduration=10M on the Jellyfin container. Applies to the mount and .strm; direct play is not affected.

Or turn on the .strm export (STRM_ENABLED=true, folder mapped to /strm). It writes one small .strm file per selected movie or episode and removes stale ones.

  • By default each file points straight at the source URL, so Mountarr isn't involved in playback.
  • Set STRM_BASE_URL=http://<host>:8899 to send playback through Mountarr instead, so its connection limit and chunking apply.

.strm files are found instantly and don't need sizes, but the server can't read media info until playback starts. The mount gives full media info at scan time. Many people use the mount for Plex and .strm for Jellyfin.

Configuration

Most settings can also be changed in the web UI. Saved UI settings (/data/settings.json) take precedence over environment variables.

Environment variables
Variable Default Description
XTREAM_URL http://127.0.0.1:9191 Xtream / Dispatcharr base URL
XTREAM_USER, XTREAM_PASS Xtream credentials
UI_PASSWORD Basic auth for /ui and /api (any user name). Set it.
AUTH_TOKEN If set, the file tree is served only under /<token>/
PORT 8899 HTTP port
MOVIES_DIR_NAME / SERIES_DIR_NAME Movies / TV Shows Top-level folder names
ENABLE_MOVIES / ENABLE_SERIES true Include movies / series
NAME_STRIP_REGEX Regex removed from titles, e.g. ^(?:DE|EN)\s*-\s*
ADD_TMDB_TAG true Append {tmdb-ID} to folder names when known
MERGE_VERSIONS false Movies with the same TMDB ID go into one folder as versions (Title (Year) - DE 4K.mkv)
COLLECTION_WATCHLIST, COLLECTION_WATCHLIST_TITLE false, On my watchlist Plex collection of the titles on your watchlists
WATCHLIST_PLEX false Include titles from your Plex watchlist in Only what I pick mode (uses PLEX_TOKEN)
TRAKT_LIST, TRAKT_CLIENT_ID A public Trakt list (user name, user/list or a trakt.tv link) used the same way; the client ID comes from trakt.tv/oauth/applications
CONNECTION_LIMIT 2 Max parallel upstream connections (playback + probing)
PROBE_WORKERS 1 Parallel size lookups (at most CONNECTION_LIMIT - 1)
PROBE_DELAY_SECONDS 0.5 Pause between lookups per worker
CHUNK_MB 8 Upstream range size; 0 passes client ranges through unchanged
HEADER_CACHE_GB 20 Disk space for the header cache in /data/cache (a few MB per file); 0 turns it off
PREFETCH true Warm up the header cache: while nothing is read, load the start and end of files, newest first, up to 80 % of the cache
WARMUP_QUIET_SECONDS 30 Seconds without reads before the warm-up starts
CATALOG_REFRESH_HOURS 6 How often the catalog is reloaded
PLEX_URL, PLEX_TOKEN, PLEX_LIBRARY_PATH Enable automatic partial scans
PLEX_SECTION_MOVIES, PLEX_SECTION_SERIES auto Library IDs, if auto-detection picks the wrong ones
JELLYFIN_URL, JELLYFIN_API_KEY, JELLYFIN_LIBRARY_PATH Automatic scans for Jellyfin or Emby
AUTO_SCAN true false = only scan when you press the button in the UI (Plex and Jellyfin/Emby)
PLEX_SCAN_INTERVAL_MINUTES / PLEX_SCAN_DELAY_MINUTES 30 / 15 Scan pacing
STRM_ENABLED, STRM_DIR, STRM_BASE_URL false, /strm, .strm export
BUILTIN_MOUNT true Mount the tree inside the container when /mountarr is mapped and /dev/fuse is available
MOUNT_DIR /mountarr Container folder for the built-in mount (the tree goes to <MOUNT_DIR>/vod)
MOUNT_HANG_SECONDS 60 If the mount doesn't answer this long, rclone is stopped and the tree is mounted again
UPDATE_CHECK true Ask GitHub twice a day for the latest version number and show a notice in the UI
DEBUG false Detailed log: every read with its position, for troubleshooting

How it works

Plex / Jellyfin ──read──▶ rclone mount (in Mountarr) ──HTTP──▶ Mountarr ──ranges──▶ Xtream source
                                                    │
                                 catalog, sizes, header cache (/data)
  1. Catalog: player_api.php provides movies, series and categories. Series episode lists load in the background.
  2. Sizes: each file is probed once, titles you picked first. New titles keep their first megabytes in the header cache right away. Results survive a source that re-numbers its streams.
  3. Listing: the built-in rclone reads plain HTML directory listings. Only files with a known size are listed.
  4. Header cache: media analysis reads the start of a file (1 to 8 MB, learned from what scanners read) and its index at the end. Both are kept in /data/cache, so a scan needs about one request per file and a rescan none. When the cache is full, warmed parts nobody read go first, then the least recently used.
  5. Warm-up: after 30 s without reads, one connection fills the cache: new titles, the next episodes of what you watched lately, watchlist and picked titles, movies and first episodes, then the rest. The end is only fetched from where the index starts (MKV cues, MP4 index). It uses at most 80 % of the cache, never pushes out what was really read and warms each file once.
  6. Playback: a client range is fetched as a series of closed upstream ranges (CHUNK_MB), each read to the end. A seek cancels the older request. One connection always stays free for playback, and readers above CONNECTION_LIMIT wait for a slot.
  7. .strm (optional): one small file per title, pointing at the source or at Mountarr.

Good to know

  • Connection limit: set CONNECTION_LIMIT to the streams your source really has free for Mountarr. The cache warm-up uses one connection, and only while nothing else is read.
  • Request volume: each file's size is looked up once, paced over hours. If your source limits requests, keep the defaults.
  • Tested with Dispatcharr. Other Xtream Codes servers should work too, if not please open an issue with the log.
  • Set UI_PASSWORD if the port is reachable by anyone but you.

Development

python -m unittest discover -s tests -v   # spins up a fake Xtream server, no network needed
python app/main.py                        # with XTREAM_* env vars and DATA_DIR=./data

Support

Bugs, questions and feature requests: GitHub issues

Disclaimer

Mountarr doesn't provide any content. Use it only with sources and content you are legally allowed to access. Plex, Jellyfin, Emby and Kodi are trademarks of their respective owners, and this project isn't affiliated with any of them.

License

MIT

About

Mount your Xtream Codes / Dispatcharr VOD catalog (movies & TV shows) as real files for Plex, Jellyfin and Emby. Real file sizes, no downloads, web UI, .strm export. Docker & Unraid ready.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages