SmartStrm Documentation

repository·main·Indexed 20 days ago

https://github.com/cp0204/smartstrm

A media library STRM file generation tool that bridges cloud storage with private media servers like Emby, Jellyfin, and Plex. It supports multi-driver integration (WebDAV, Quark, 115, 123, etc.), 302 redirection to bypass NAS bandwidth saturation, and automated task scheduling via Crontab. Key features include TMDB smart recognition, a plugin system for filename repair and cover extraction, and a 302 proxy for external player integration.

Tokens
3K
Snippets
4
Records
24
Agent score
22%

What's inside SmartStrm

  1. Core Features of SmartStrm

    main

    SmartStrm provides several key capabilities for managing cloud-to-local media workflows:

    • Multi-Driver Support: Supports OpenList, WebDAV, Quark (夸克), 115, 123, Tianyi (天翼), and Guangya Cloud (光鸭云盘).
    • Automated Tasks: Uses a Crontab-based system for incremental generation, synchronized deletion, and real-time local storage monitoring.
    • Triggered Linkage: Integrates with tools like QAS (Quark-Auto-Save) and CloudSaver for "save-to-trigger" workflows, and supports Emby linkage deletion to keep libraries in sync.
    • 302 Direct Link Playback: Uses 302 redirection for Emby, Jellyfin, Plex, and Feiniu (飞牛影视) to stream directly from cloud providers without consuming NAS bandwidth.
    • Plugin System: Extensible features including filename repair, regex replacement, Feiniu refresh notifications, and video cover extraction.
    • Smart Recognition: Built-in file browser with TMDB smart recognition and batch renaming for standardized metadata scraping.
  2. Overview of Available Plugins

    main

    SmartStrm features a plugin system that allows for task-level configuration. Available plugins include:

    • 飞牛影视刷新 (Feiniu Video Refresh): Automatically matches media libraries, scans specified directories, and removes missing videos. Supports Quark, 115, and 123 cloud drives.
    • 非法文件名修正 (Illegal Filename Correction): Renames remote files to remove special characters or truncate overly long names.
    • STRM内容替换 (STRM Content Replacement): Automatically replaces specific text within the generated STRM files.
    • STRM不加扩展名 (STRM No Extension): Generates STRM files without the .(ext) suffix.
    • 文件名关键词排除 (Filename Keyword Exclusion): Skips files that contain specific keywords in their names.
    • Infuse.ISO兼容 (Infuse.ISO Compatibility): Names generated files with the .iso.strm suffix.
  3. Optimize STRM first-play speed

    main

    SmartStrm provides an experimental feature called 优化 STRM 首播速度 (Optimize STRM first-play speed) to reduce initial buffering/loading times.

    • How it works: It caches STRM direct links and asynchronously fetches audio/video information.
    • Compatibility: It supports Emby, Jellyfin, and 飞牛影视 (fnOS). It injects compatibility fields into the media source to improve playback success rates.
    • Note: This feature is disabled by default to avoid potential compatibility issues. You must enable it manually in settings if needed.
  4. Use File ID Mode for Cloud Storage STRM Generation

    main

    For cloud storage drivers, you can enable 文件编号模式 (File ID Mode). This writes the file ID instead of the full path into the STRM content.

    Benefits:

    • Reduces API requests.
    • Slightly improves playback start speed.

    Note: If you switch to this mode after previously generating files, it is recommended to use the 全量覆写 (Full Overwrite) function to ensure all files are updated correctly.

  5. Manage tasks with the Task Scheduler

    main

    The task management system has been refactored to support more robust execution:

    • Stopping Tasks: You can now stop a running task via the UI.
    • Queue Execution: Tasks are executed one per thread. If a task is triggered multiple times, subsequent triggers are placed in a queue to prevent concurrency issues.
    • Webhook Integration: Webhook-triggered tasks are managed by the central Task Manager and support queuing.
  6. Use the STRM Signature feature for security

    main

    SmartStrm includes a signature feature to prevent unauthorized access to STRM direct links by signing the URLs.

    Important: Since v0.4.5, this feature is enabled by default. If you updated to this version without re-generating your STRM files or manually disabling the feature, your playback may fail.

    • To fix playback: Re-generate your STRM files or manually disable the signature feature in settings.
    • Behavior: When enabled, cloud drive STRM files must be re-generated. If the base address is an internal IP and you are using the built-in 302 proxy, internal requests are allowed without a signature.
  7. Use the 302 Proxy for external player integration

    main

    The 302 proxy allows SmartStrm to act as a middleman for media requests, which can improve compatibility and enable features like direct link playback from third-party players.

    • External Player Buttons: SmartStrm can inject buttons into Emby/Jellyfin to call external players (e.g., via mpv-handler:// protocol). It supports icons for players like MXPlayerPro, Fileball, and SenPlayer.
    • fnOS (飞牛影视) Support: For fnOS, you can proxy port 8005 to support direct link playback in VidHub or 网易爆米花.
    • Docker Note: If using Docker and experiencing playback issues with fnOS, ensure the host's strm directory is mapped into the container (e.g., /vol1/1000/path/strm:/vol1/1000/path/strm).
  8. Deploy SmartStrm via Docker

    main

    You can deploy SmartStrm using a single Docker command. Ensure you replace /yourpath/ with the actual absolute path on your host machine where you want to store configuration, logs, and generated STRM files.

    Required/Optional Volumes:

    • /app/config: Configuration directory (Required)
    • /app/logs: Log directory (Optional)
    • /strm: Directory where .strm files are generated (Required)

    Environment Variables:

    • PORT: The management port (Default: 8024)
    • ADMIN_USERNAME: Admin username (Default: admin)
    • ADMIN_PASSWORD: Admin password (Default: admin123)
    docker run -d \
      --name smartstrm \
      --restart unless-stopped \
      --network host \
      -v /yourpath/smartstrm/config:/app/config \\
      -v /yourpath/smartstrm/logs:/app/logs \\
      -v /yourpath/smartstrm/strm:/strm \\
      -e PORT=8024 \
      -e ADMIN_USERNAME=admin \
      -e ADMIN_PASSWORD=admin123 \
      cp0204/smartstrm:latest
  9. Deploy SmartStrm via Docker Compose

    main

    Using docker-compose.yml is the recommended deployment method. This configuration uses network_mode: host to ensure proper connectivity.

    Note: Replace /yourpath/ with your actual local paths for config, logs, and strm volumes.

    name: smartstrm
    services:
      smartstrm:
        image: cp0204/smartstrm:latest
        container_name: smartstrm
        restart: unless-stopped
        network_mode: host
        volumes:
          - /yourpath/smartstrm/config:/app/config # 挂载配置目录
          - /yourpath/smartstrm/logs:/app/logs # 挂载日志目录,可选
          - /yourpath/smartstrm/strm:/strm # 挂载 STRM 生成目录
        environment:
          - PORT=8024 # 管理端口,可选
          - ADMIN_USERNAME=admin # 管理用户名
          - ADMIN_PASSWORD=admin123 # 管理用户密码
  10. How to use SmartStrm to manage media libraries

    main

    SmartStrm automates the creation of .strm files, which act as lightweight shortcuts to cloud-hosted media. This allows media servers like Emby or Jellyfin to play files directly from cloud storage without downloading them to your local NAS.

    The 5-Step Workflow:

    1. Add Storage: Connect your cloud drives (e.g., Quark, 115, WebDAV).
    2. Create Task: Configure scan paths to automatically generate .strm files.
    3. Directory Mapping: Mount the directory containing the generated .strm files into your media server container (e.g., Emby).
    4. Scan Library: Add and scan that directory within your media server (Emby/Jellyfin/Plex).
    5. 302 Proxy (Pro Feature): Configure 302 redirection so video streams go directly from the cloud provider to your player, bypassing your NAS bandwidth.
  11. Configure License Keys via UI or Environment Variables

    main

    You can configure your license key in two ways:

    1. Via the UI: Navigate to the About page to enter your license key.
    2. Via Environment Variables: Set the LICENSE environment variable.

    Important: If you use the UI to set the key, ensure the LICENSE environment variable is empty. If the environment variable is set, the application will prioritize it over the UI configuration during restart.

    export LICENSE='your_license_key_here'