### Simple Directory Setup Example Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/quick-reference.md This is a basic configuration for setting up directories, using a broad regex to match all files. ```yaml directories: all: filters: - regex: /.*/ ``` -------------------------------- ### Start zurg Server Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/deployment.md Starts the zurg WebDAV server using a specified configuration file. Ensure the configuration path is correct. ```bash /usr/local/bin/zurg --config /etc/zurg/config.yml ``` -------------------------------- ### Install rclone Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/deployment.md Installs rclone using the official installer script or manually downloads and copies the binary. ```bash # Official installer curl https://rclone.org/install.sh | sudo bash ``` ```bash # Or manual wget https://downloads.rclone.org/rclone-current-linux-amd64.zip unzip rclone-current-linux-amd64.zip sudo cp rclone-v*/rclone /usr/local/bin/ sudo chmod +x /usr/local/bin/rclone ``` -------------------------------- ### Example Zurg Configuration Source: https://github.com/debridmediamanager/zurg-testing/wiki/Config A basic example configuration for Zurg, demonstrating common settings like API tokens, media server integration, and playable extensions. Replace placeholder values with your actual credentials and paths. ```yaml zurg: v1 token: YOUR_RD_API_TOKEN enable_repair: true rar_action: extract auto_analyze_new_torrents: true cache_network_test_results: true addl_playable_extensions: - m3u - jpg plex_server_url: "http://localhost:32400" plex_token: "your-plex-token" jellyfin_server_url: "http://localhost:8096" jellyfin_token: "your-jellyfin-token" emby_server_url: "http://localhost:8096" emby_token: "your-emby-token" mount_path: "/media/movies" ``` -------------------------------- ### Zurg Configuration for Media Grouping Source: https://github.com/debridmediamanager/zurg-testing/wiki/History Example `config.yml` demonstrating how to use new filters like `has_episodes` and `any_file_inside_regex` to categorize media. This setup is useful for organizing anime, shows, and movies based on specific file patterns and episode detection. ```yaml directories: anime: group_order: 10 group: media filters: - and: - has_episodes: true - any_file_inside_regex: /^\[/ # e.g. [SubsPlease] - any_file_inside_not_regex: /s\d\de\d\d/i shows: group_order: 20 group: media filters: - has_episodes: true movies: group_order: 30 group: media filters: - regex: /.*/ ``` -------------------------------- ### Zurg Server Mode Output Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/cli-commands.md This is an example of the output when starting the Zurg WebDAV server. It shows the server listening on a configured host and port, loading configuration, and preparing for requests. ```text 2024-06-27 10:15:32.234 INFO Starting zurg WebDAV server 2024-06-27 10:15:32.456 INFO Listening on http://0.0.0.0:9999 2024-06-27 10:15:32.678 INFO Loading configuration from ./config.yml 2024-06-27 10:15:33.123 INFO Loaded 127 torrents from Real-Debrid 2024-06-27 10:15:33.245 INFO WebDAV server ready ``` -------------------------------- ### Diagnosis Checklist for Zurg Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/troubleshooting.md Run these commands to verify basic Zurg setup and connectivity. ```bash # 1. Check zurg is running docker compose ps zurg # Status should be "Up" ``` ```bash # 2. Check WebDAV is accessible curl -v http://localhost:9999/dav/ # Should return 207 Multi-Status ``` ```bash # 3. Check rclone mount exists ls /mnt/zurg/ # Should show your configured directories ``` ```bash # 4. Test Real-Debrid connectivity docker compose exec zurg zurg network-test # Should show PASS ``` ```bash # 5. Check config is valid docker compose exec zurg zurg --config /app/config.yml --help # Should show help without errors ``` -------------------------------- ### Clone Repository and Navigate Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/deployment.md Clone the zurg-testing repository and navigate into the project directory to begin the setup process. ```bash git clone https://github.com/debridmediamanager/zurg-testing.git cd zurg-testing ``` -------------------------------- ### Run Zurg binary Source: https://github.com/debridmediamanager/zurg-testing/wiki/Guides/'No-docker'-setup-in-Ubuntu-or-any-Linux-distros Executes the Zurg binary to start the service. Ensure you are in the directory where you unzipped Zurg. ```bash ./zurg-linux-amd64 ``` -------------------------------- ### Install rclone on Ubuntu Source: https://github.com/debridmediamanager/zurg-testing/wiki/Guides/'No-docker'-setup-in-Ubuntu-or-any-Linux-distros Installs the rclone utility, which is required for mounting cloud storage. Ensure rclone is available in your system's PATH. ```bash sudo apt install rclone ``` -------------------------------- ### Example Directory Configuration with Filters Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/directory-filters.md Demonstrates how to configure directories with a list of filters. Torrents are included if they match any filter in the list. ```yaml directories: shows: filters: - has_episodes: true - regex: /\bS\d{2}E\d{2}\b/ # Torrent included if: (has_episodes) OR (regex matches) ``` -------------------------------- ### Upgrade Zurg Binary Installation Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/deployment.md Instructions for upgrading a Zurg binary installation, involving downloading the new version, backing up the old one, installing the new binary, and restarting the service. ```bash # Download new version wget https://github.com/debridmediamanager/zurg/releases/download/v0.10.0/zurg-linux-x86_64 # Backup old version sudo cp /usr/local/bin/zurg /usr/local/bin/zurg.backup # Install new version sudo mv zurg-linux-x86_64 /usr/local/bin/zurg sudo chmod +x /usr/local/bin/zurg # Restart service sudo systemctl restart zurg # Verify zurg version ``` -------------------------------- ### Get General Help Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/cli-commands.md Displays general help information, including available commands and global flags. ```bash zurg help ``` -------------------------------- ### Start and Check Zurg Service Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/quick-reference.md Use these commands to start the Zurg service in detached mode and view its initial logs to ensure it's running correctly. ```bash # 1. Can zurg start? docker compose up -d zurg docker compose logs zurg | head -20 ``` -------------------------------- ### Install Systemd Service Files Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/deployment.md Copy the provided systemd service unit files for zurg and zurg-rclone to the systemd directory and reload the daemon. ```bash sudo cp lib/systemd/system/zurg.service /etc/systemd/system/ sudo cp lib/systemd/system/zurg-rclone.service /etc/systemd/system/ sudo systemctl daemon-reload ``` -------------------------------- ### Download and Install Zurg Binary Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/deployment.md Download the specified version of the zurg binary, move it to the system's PATH, and make it executable. ```bash VERSION="v0.10.0-rc.4-1" wget https://github.com/debridmediamanager/zurg/releases/download/$VERSION/zurg-linux-x86_64 sudo mv zurg-linux-x86_64 /usr/local/bin/zurg sudo chmod +x /usr/local/bin/zurg ``` -------------------------------- ### Zurg Configuration Hierarchy Example Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/INDEX.md Illustrates the nested structure of the zurg configuration file, detailing authentication, server settings, and directory definitions with filtering rules. ```yaml zurg: token: # Real-Debrid authentication host/port: # Server binding username/password: # WebDAV auth (optional) concurrent_workers: # Performance check_for_changes_every_secs:# Update frequency enable_repair: # Health monitoring on_library_update: # Webhook trigger directories: # Directory definitions directory_name: group: # Organizational grouping group_order: # Display order only_show_the_biggest_file: # File filtering filters: # Torrent matching rules - regex: /pattern/ - has_episodes: true - any_file_inside_regex: "\.mkv$" ``` -------------------------------- ### Get Help for a Specific Command Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/cli-commands.md Retrieves detailed help information for a particular command, such as 'clear-torrents'. ```bash zurg help clear-torrents ``` ```bash zurg clear-torrents --help ``` -------------------------------- ### Complete Docker Compose Setup for Zurg and Rclone Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/deployment.md Use this Docker Compose configuration for a full multi-container setup. It defines services for zurg and rclone, including ports, volumes, environment variables, and dependencies. ```yaml version: '3.8' services: zurg: image: ghcr.io/debridmediamanager/zurg-testing:latest container_name: zurg restart: unless-stopped ports: - 9999:9999 volumes: - ./scripts/plex_update.sh:/app/plex_update.sh - ./config.yml:/app/config.yml - zurgdata:/app/data environment: - TZ=UTC rclone: image: rclone/rclone:latest container_name: rclone restart: unless-stopped environment: TZ: Europe/Berlin PUID: 1000 PGID: 1000 volumes: - /mnt/zurg:/data:rshared - ./rclone.conf:/config/rclone/rclone.conf cap_add: - SYS_ADMIN security_opt: - apparmor:unconfined devices: - /dev/fuse:/dev/fuse:rwm depends_on: - zurg command: "mount zurg: /data --allow-other --allow-non-empty --dir-cache-time 10s --vfs-cache-mode full" volumes: zurgdata: ``` -------------------------------- ### Check Rclone and Zurg Versions Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/rclone-integration.md Verify the installed versions of rclone and zurg to ensure compatibility. ```bash rclone version # Output: rclone v1.67.0 ``` ```bash zurg version # Output: zurg v0.10.0-rc.4-1 ``` -------------------------------- ### Catch-all Regex Filter Example Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/configuration.md A catch-all regex pattern that matches all torrents, useful for general directories. ```yaml filters: - regex: /.*/ ``` -------------------------------- ### Verify rclone installation Source: https://github.com/debridmediamanager/zurg-testing/wiki/Guides/'No-docker'-setup-in-Ubuntu-or-any-Linux-distros Checks if rclone has been successfully installed and is accessible from the command line. ```bash rclone version ``` -------------------------------- ### Manage Zurg and Rclone Services Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/deployment.md Commands to start, enable, check status, view logs, and stop the zurg and zurg-rclone systemd services. ```bash # Start zurg sudo systemctl start zurg sudo systemctl start zurg-rclone # Enable auto-start on boot sudo systemctl enable zurg sudo systemctl enable zurg-rclone # Check status sudo systemctl status zurg sudo systemctl status zurg-rclone # View logs sudo journalctl -u zurg -f sudo journalctl -u zurg-rclone -f # Stop services sudo systemctl stop zurg-rclone sudo systemctl stop zurg ``` -------------------------------- ### Virtual Directory Structure Example Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/endpoints.md Illustrates how Zurg organizes configured directories under the /dav/ path, grouped by the 'group' setting. Directories without a specified group appear at the top level. ```text /dav/ └── / ├── / │ └── / │ └── ``` -------------------------------- ### Zurg Configuration for Directories Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/endpoints.md Example YAML configuration defining 'shows' and 'movies' directories, both assigned to the 'media' group. This configuration dictates how these directories will be exposed via WebDAV. ```yaml directories: shows: group: media filters: - has_episodes: true movies: group: media filters: - regex: /.*/ ``` -------------------------------- ### Mount Zurg with rclone Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/endpoints.md Complete Docker Compose example for mounting Zurg using rclone. Ensure necessary volumes, capabilities, and devices are configured for the rclone service. ```yaml services: zurg: image: ghcr.io/debridmediamanager/zurg-testing:latest ports: - 9999:9999 volumes: - ./config.yml:/app/config.yml rclone: image: rclone/rclone:latest volumes: - /mnt/zurg:/data:rshared - ./rclone.conf:/config/rclone/rclone.conf cap_add: - SYS_ADMIN security_opt: - apparmor:unconfined devices: - /dev/fuse:/dev/fuse:rwm command: mount zurg: /data --allow-other --dir-cache-time 10s --vfs-cache-mode full ``` -------------------------------- ### Check Zurg Configuration File Existence Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/troubleshooting.md Verify that the 'config.yml' file exists in the current directory using 'ls -la'. If missing, copy the example configuration file. ```bash # Check config is readable ls -la config.yml # If missing, copy example: cp config.example.yml config.yml ``` -------------------------------- ### Scripting Zurg Version Check Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/cli-commands.md Provides an example of how to capture the Zurg version in a script and perform conditional checks. ```bash VERSION=$(zurg version) if [[ $VERSION == *"v0.10"* ]]; then echo "RC version detected" fi ``` -------------------------------- ### List Mounted Directory Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/endpoints.md After starting the rclone mount, list the directory structure to verify files are accessible as if they were local. ```bash ls -1R /mnt/zurg/ ``` -------------------------------- ### Run Zurg with Infuse via SFTP Source: https://github.com/debridmediamanager/zurg-testing/wiki/Guides/Infuse This command starts the zurg containers for Infuse integration. Ensure docker-compose.yml is correctly named and configured. ```bash docker compose up -d ``` -------------------------------- ### Multi-Codec Content Organization Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/directory-filters.md Organize content based on video codec using `any_file_inside_regex`. This example separates x264, x265, and AV1 content. ```yaml directories: x264_content: group: codec group_order: 10 filters: - any_file_inside_regex: /x\.264|h\.264|avc/i x265_content: group: codec group_order: 20 filters: - any_file_inside_regex: /x\.265|h\.265|hevc/i av1_content: group: codec group_order: 30 filters: - any_file_inside_regex: /av1/i ``` -------------------------------- ### Any File Inside Regex Filter Example Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/configuration.md Applies a filter to match torrents if any file within them has a .mkv extension. ```yaml filters: - any_file_inside_regex: /\.mkv$/ ``` -------------------------------- ### Plex Update Script Setup (Linux/macOS) Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/deployment.md Sets up the `plex_update.sh` script for Linux/macOS. This includes defining the Plex server URL, authentication token, and zurg mount point, and making the script executable. ```bash # Edit scripts/plex_update.sh plex_url="http://192.168.1.100:32400" # Your Plex server token="" zurg_mount="/mnt/zurg" # Ensure zurg can execute script chmod +x plex_update.sh ``` -------------------------------- ### Systemd Service Management for Zurg Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/quick-reference.md Commands to manage Zurg and zurg-rclone systemd services, including starting, enabling, checking status, and viewing logs. ```bash # Start service sudo systemctl start zurg sudo systemctl start zurg-rclone # Enable auto-start sudo systemctl enable zurg sudo systemctl enable zurg-rclone # View status sudo systemctl status zurg # View logs sudo journalctl -u zurg -f # Stop service sudo systemctl stop zurg ``` -------------------------------- ### Plex Update Script Setup (Windows) Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/deployment.md Sets up the `plex_update.ps1` script for Windows. This involves defining the Plex server URL, authentication token, and zurg mount point, and configuring the `config.yml` to execute the PowerShell script. ```powershell # Edit scripts/plex_update.ps1 $plexUrl = "http://192.168.1.100:32400" $token = "" $zurgMount = "Z:\zurg" # In config.yml on_library_update: '& powershell -ExecutionPolicy Bypass -File .\plex_update.ps1 --% "$args"' ``` -------------------------------- ### Advanced Directory Categorization Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/quick-reference.md This example demonstrates advanced categorization using various filters including regex for anime hashes, episode presence for series, specific keywords for documentaries, and quality for movies. ```yaml directories: anime: group: shows group_order: 10 filters: - regex: /\b[a-fA-F0-9]{8}\b/ series: group: shows group_order: 20 filters: - has_episodes: true documentaries: group: shows group_order: 30 filters: - regex: /documentary|nature/i movies_hd: group: movies group_order: 10 filters: - any_file_inside_regex: /(1080p|2160p)/ movies_other: group: movies group_order: 20 filters: - regex: /.*/ ``` -------------------------------- ### CLI Commands Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/DELIVERY_SUMMARY.txt Reference for the command-line interface (CLI) commands available for the zurg server. This includes commands for version checking, completion, help, clearing downloads and torrents, and network testing, along with their parameters, flags, and usage examples. ```APIDOC ## CLI Commands ### Description This document outlines the command-line interface (CLI) commands provided by the zurg server. It details the purpose, parameters, flags, exit codes, and usage patterns for each command, facilitating server management and interaction. ### Commands - `version`: Displays the zurg server version. - `completion`: Generates shell completion scripts. - `help`: Displays help information for zurg commands. - `clear-downloads`: Clears completed downloads. - `clear-torrents`: Clears torrents from the download list. - `network-test`: Performs a network connectivity test. ``` -------------------------------- ### Manual Rclone Mount with Systemd Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/rclone-integration.md Manually mount cloud storage using rclone on a Linux system. This involves installing rclone, creating a mount directory, and executing the mount command with recommended options for caching and performance. Ensure you have sudo privileges. ```bash # Install rclone curl https://rclone.org/install.sh | sudo bash # Create mount directory sudo mkdir -p /mnt/zurg # Mount rclone mount zurg: /mnt/zurg \ --allow-other \ --allow-non-empty \ --dir-cache-time 10s \ --vfs-cache-mode full \ --vfs-cache-max-size 50G \ --log-level info ``` -------------------------------- ### Regex Pattern Complexity Examples Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/directory-filters.md Illustrates different levels of regex pattern complexity and their impact on filter evaluation speed. Use simpler patterns when possible. ```regex /.*/ ``` ```regex /1080p/ ``` ```regex /\b[a-fA-F0-9]{8}\b/ ``` -------------------------------- ### AND Filter Combination Source: https://github.com/debridmediamanager/zurg-testing/wiki/Organizing-Your-Torrents-Made-Easy Combine multiple filter conditions using 'and', requiring all specified criteria to be met. This example requires '1080p' and a size greater than or equal to 1GB. ```yaml - and: - contains: "1080p" - size_gte: 1000000000 ``` -------------------------------- ### File Download Request (GET) Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/endpoints.md Use the GET method to stream a file from Real-Debrid. Supports range requests for partial content retrieval. ```http GET /dav/movies/example.movie/example.movie.mkv HTTP/1.1 Host: localhost:9999 ``` -------------------------------- ### Show All Available Commands Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/cli-commands.md Lists all available Zurg commands and their brief descriptions. ```bash zurg --help ``` -------------------------------- ### Specify Configuration File Path Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/cli-commands.md Demonstrates how to specify a custom configuration file path using the --config flag. ```bash zurg --config /etc/zurg/config.yml version ``` -------------------------------- ### Configure Zurg Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/deployment.md Create the configuration directory and copy the default configuration file, ensuring correct permissions. ```bash sudo mkdir -p /etc/zurg sudo cp config.yml /etc/zurg/config.yml sudo chmod 600 /etc/zurg/config.yml ``` -------------------------------- ### Generate PowerShell Autocompletion Script Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/cli-commands.md Installs Zurg shell autocompletion for PowerShell by piping the output to Invoke-Expression. ```powershell zurg completion powershell | Out-String | Invoke-Expression ``` -------------------------------- ### Create rclone configuration file Source: https://github.com/debridmediamanager/zurg-testing/wiki/Guides/'No-docker'-setup-in-Ubuntu-or-any-Linux-distros Opens the rclone configuration file in the nano editor for manual editing. Replace the placeholder URL with your local Zurg instance if necessary. ```bash nano $HOME/.config/rclone/rclone.conf ``` -------------------------------- ### Show Zurg Help Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/quick-reference.md Displays general help information or help for a specific command. ```bash zurg help ``` ```bash zurg help ``` -------------------------------- ### Clear Stale PIDs Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/quick-reference.md Remove stale process ID files that might prevent services from starting correctly. ```bash # Clear out stale pids rm -rf /var/run/user/*/gvfs* ``` -------------------------------- ### Directory Listing Request (PROPFIND) Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/endpoints.md Use PROPFIND with Depth: 1 to list the contents of a virtual directory. The response will be XML containing metadata for each item. ```http PROPFIND /dav/shows HTTP/1.1 Host: localhost:9999 Depth: 1 ``` -------------------------------- ### Verify WebDAV Accessibility Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/quick-reference.md Check if the WebDAV interface is accessible by sending a simple GET request to the default port. ```bash # 2. Is WebDAV accessible? curl http://localhost:9999/dav/ ``` -------------------------------- ### Has Episodes Filter Example Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/configuration.md Uses a filter to automatically match torrents that have a detected TV series episode structure. ```yaml filters: - has_episodes: true ``` -------------------------------- ### Create and Configure Zurg User Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/deployment.md Create a dedicated system user for zurg, set up its home directory, and assign appropriate ownership and permissions to the user and configuration files. ```bash sudo useradd -r -s /bin/false -d /var/lib/zurg zurg sudo mkdir -p /var/lib/zurg sudo chown zurg:zurg /var/lib/zurg sudo chmod 700 /var/lib/zurg sudo chown zurg:zurg /etc/zurg/config.yml sudo chmod 600 /etc/zurg/config.yml ``` -------------------------------- ### Monitor System Resources with Top Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/quick-reference.md View real-time system process information, including CPU and memory usage, to identify performance bottlenecks. ```bash top ``` -------------------------------- ### Generate Fish Autocompletion Script Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/cli-commands.md Installs Zurg shell autocompletion for Fish by piping the output to the vendor completions directory. ```bash zurg completion fish | sudo tee /usr/share/fish/vendor_completions.d/zurg.fish ``` -------------------------------- ### Generate Bash Autocompletion Script Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/cli-commands.md Installs Zurg shell autocompletion for Bash by piping the output to a system directory and sourcing it. ```bash zurg completion bash | sudo tee /etc/bash_completion.d/zurg source /etc/bash_completion.d/zurg ``` -------------------------------- ### View Zurg Help and Flags Source: https://github.com/debridmediamanager/zurg-testing/wiki/History Display available command-line flags and usage information for zurg. ```bash zurg -h ``` -------------------------------- ### Check if rclone process is running (Bash) Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/rclone-integration.md Confirm that the rclone process is active. This helps diagnose if the mount service has started. ```bash ps aux | grep rclone ``` -------------------------------- ### Year Pattern Regex Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/directory-filters.md Matches 4-digit years starting with 19 or 20. Suitable for extracting release years from titles. ```regex /\b(19|20)\d{2}\b/ ``` -------------------------------- ### File Download (GET) Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/endpoints.md Streams a file from Real-Debrid via the WebDAV interface. Supports range requests for partial content. ```APIDOC ## GET /dav/movies/example.movie/example.movie.mkv ### Description Stream file from Real-Debrid. ### Method GET ### Endpoint /dav/movies/example.movie/example.movie.mkv ### Headers - **Host**: localhost:9999 ### Response #### Success Response (200 OK) - **Content**: File content - **Content-Type** (string) - MIME type based on file extension - **Content-Length** (integer) - Actual file size - **Accept-Ranges**: bytes (Supports range requests) #### Success Response (206 Partial Content) - **Content**: Partial file content #### Error Responses - **401 Unauthorized** - Invalid credentials - **404 Not Found** - File not found - **410 Gone** - Torrent/file deleted or unavailable in Real-Debrid ``` -------------------------------- ### Split Catch-all into Specific Directories Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/directory-filters.md Demonstrates splitting a general catch-all filter into specific directories for movies and shows based on episode presence. This improves organization and reduces unintended matches. ```yaml directories: movies: filters: - has_episodes: false shows: filters: - has_episodes: true ``` -------------------------------- ### Create Mount Directory Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/deployment.md Create the directory where rclone will mount the zurg WebDAV share. Ensure you have the necessary permissions. ```bash sudo mkdir -p /mnt/zurg ``` -------------------------------- ### Media Information Filter for Resolution Source: https://github.com/debridmediamanager/zurg-testing/wiki/Organizing-Your-Torrents-Made-Easy Filter torrents using metadata such as resolution. This example targets torrents with '1080p' resolution. ```yaml - media_info_resolution: "1080p" ``` -------------------------------- ### Filter Types Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/DELIVERY_SUMMARY.txt Documentation on the different filter types supported by zurg for organizing and managing media libraries, with examples for each type. ```APIDOC ## Filter Types ### Description Documentation on the different filter types supported by zurg for organizing and managing media libraries, with examples for each type. ### Types (4 total) - **regex**: Pattern matching on torrent names - **any_file_inside_regex**: Pattern matching on file names - **has_episodes**: TV series detection - **only_show_the_biggest_file**: Single file display ``` -------------------------------- ### Zurg Mount Options - Performance Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/quick-reference.md Performance-oriented mount options for Zurg. Tune these for better read/write speeds. ```bash --vfs-cache-max-size 50G --vfs-read-chunk-size 128M --vfs-read-ahead 256M --buffer-size 256M ``` -------------------------------- ### Verify zurg Mount for Plex Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/deployment.md Checks the first 20 entries of the mounted zurg directory to ensure media directories are visible, a prerequisite for adding Plex libraries. ```bash ls -1R /mnt/zurg | head -20 # Should show media directories ``` -------------------------------- ### Regex Filter Example Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/configuration.md Applies a regex filter to match torrent names containing episode markers like 'S01E01'. ```yaml filters: - regex: /\bS\d{2}E\d{2}\b/ ``` -------------------------------- ### Download Binary for v0.9.2 Source: https://github.com/debridmediamanager/zurg-testing/wiki/History Download the Linux amd64 binary for zurg version v0.9.2. ```bash wget https://github.com/debridmediamanager/zurg-testing/raw/main/releases/v0.9.2/zurg-v0.9.2-linux-amd64.zip ``` -------------------------------- ### Generate Zsh Autocompletion Script Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/cli-commands.md Installs Zurg shell autocompletion for Zsh by piping the output to the site-functions directory and running compinit. ```bash zurg completion zsh | sudo tee /usr/share/zsh/site-functions/_zurg compinit ``` -------------------------------- ### Emergency Restart Zurg Stack Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/quick-reference.md Perform a full restart of the Zurg stack by stopping all services, clearing Rclone caches, and then starting them again. ```bash # Restart everything docker compose down rm -rf ~/.cache/rclone/ docker compose up -d ``` -------------------------------- ### Get Account Info Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/real-debrid-integration.md Retrieves the user's account status and usage information. This is called periodically for health monitoring and verification. ```APIDOC ## Get Account Info ### Description Retrieves account status and usage details, including limits and remaining quota. This is called periodically for health monitoring and verification. ### Method GET ### Endpoint https://api.real-debrid.com/rest/1.0/user ### Headers - **Authorization** (string) - Required - Bearer token ``` -------------------------------- ### Docker Useful Shortcuts Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/quick-reference.md Common Docker commands for managing containers, images, and networks, including pruning unused resources and viewing stats. ```bash # Prune stopped containers docker container prune # Prune unused images docker image prune # Prune unused networks docker network prune # Full system prune docker system prune # View resource usage docker stats # Get container IP docker inspect zurg | grep IPAddress ``` -------------------------------- ### Get Download Links Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/real-debrid-integration.md Unrestricts a torrent, converting it into a direct download link. This is called when a file is first accessed via WebDAV. ```APIDOC ## Get Download Links ### Description Unrestricts a torrent by converting it into a direct download link. This is called when a file is first accessed via WebDAV. Returns a direct download URL. ### Method POST ### Endpoint https://api.real-debrid.com/rest/1.0/unrestrict/link ### Headers - **Authorization** (string) - Required - Bearer token - **Content-Type** (string) - Required - application/x-www-form-urlencoded ### Request Body - **link** (string) - Required - The torrent download link (magnet or URL). - **password** (string) - Optional - The password if the torrent is password protected. ``` -------------------------------- ### List All Torrents with Zurg Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/directory-filters.md Use this command to list all torrents managed by Zurg. Observe the WebDAV output to see which directories are populated. ```bash # List all torrents in Real-Debrid docker compose exec zurg zurg --config /app/config.yml # Watch WebDAV output to see which directories appear ``` -------------------------------- ### Zurg Mount Options - Standard Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/quick-reference.md Standard mount options for Zurg. Use these for general mounting purposes. ```bash --allow-other --allow-non-empty --dir-cache-time 10s --vfs-cache-mode full ``` -------------------------------- ### Pull Specific Zurg Docker Image Version Source: https://github.com/debridmediamanager/zurg-testing/blob/main/README.md Pull a specific version of the zurg Docker image. This example uses v0.9.3-final. ```sh docker pull ghcr.io/debridmediamanager/zurg-testing:v0.9.3-final ``` -------------------------------- ### Docker Compose for Zurg Server Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/cli-commands.md This command demonstrates how to run the Zurg server using Docker Compose. It is useful for deploying and managing Zurg in a containerized environment. ```bash docker compose up zurg ``` -------------------------------- ### Basic Media Organization: Shows and Movies Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/directory-filters.md Organize media into 'shows' and 'movies' directories. 'shows' matches any TV series, while 'movies' matches any single-file movie. ```yaml directories: shows: group: media group_order: 20 filters: - has_episodes: true movies: group: media group_order: 30 only_show_the_biggest_file: true filters: - regex: /.*/ ``` -------------------------------- ### Basic Zurg Command Structure Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/cli-commands.md Illustrates the fundamental structure for invoking Zurg commands, either with global flags or specific commands. ```bash zurg [flags] zurg [command] ``` -------------------------------- ### Get Torrent Details Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/real-debrid-integration.md Retrieves detailed information for a specific torrent, including its file list and sizes. This is called for each torrent in configured directories. ```APIDOC ## Get Torrent Details ### Description Retrieves detailed information for a specific torrent, including its file list with sizes and path hierarchy. This is called for each torrent in configured directories. ### Method GET ### Endpoint https://api.real-debrid.com/rest/1.0/torrents/ ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the torrent to retrieve details for. ### Headers - **Authorization** (string) - Required - Bearer token ``` -------------------------------- ### Full Zurg Configuration Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/quick-reference.md A comprehensive Zurg configuration file with server, performance, library, and directory settings. ```yaml zurg: v1 token: your_real_debrid_token # Server host: "0.0.0.0" port: 9999 username: optional_user password: optional_pass # Performance concurrent_workers: 20 api_timeout_secs: 15 download_timeout_secs: 10 # Library check_for_changes_every_secs: 10 repair_every_mins: 60 enable_repair: true auto_delete_rar_torrents: true # Integration on_library_update: sh plex_update.sh "$@" # Directories directories: shows: group: media group_order: 20 filters: - has_episodes: true movies: group: media group_order: 30 only_show_the_biggest_file: true filters: - regex: /.*/ ``` -------------------------------- ### Refine Broad Regex Filter Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/directory-filters.md Example of refining a too-broad catch-all regex pattern to a more specific one. This helps prevent unintended matches. ```yaml - regex: /.*/ # Too broad ``` ```yaml To: - regex: /mkv$/ # More specific ``` -------------------------------- ### Check Mount Performance Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/troubleshooting.md Measure the time it takes to list all files in the Zurg mount to assess its performance. ```bash # Check mount performance ls -1R /mnt/zurg/ | wc -l time ls -1R /mnt/zurg/ > /dev/null ``` -------------------------------- ### OR Logic for Quality-Filtered Movies Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/directory-filters.md Use OR logic with `any_file_inside_regex` to match movies of different quality standards. This example matches 1080p or 4K content. ```yaml directories: hd_movies: group: movies filters: - any_file_inside_regex: /1080p/ - any_file_inside_regex: /2160p/ # Match 1080p OR 4K content ``` -------------------------------- ### OR Logic for Multiple Filters Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/directory-filters.md Use OR logic to match if ANY of the specified filters are true. This example matches TV shows or files with episode markers. ```yaml directories: shows: filters: - has_episodes: true # Match TV shows - regex: /\bS\d{2}E\d{2}\b/ # OR match files with episode markers ``` -------------------------------- ### Check Zurg Logs Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/troubleshooting.md Use this command to view Zurg container logs, essential for diagnosing startup failures. ```bash # Check logs docker compose logs zurg # Look for specific error: # - "invalid token" # - "config file not found" # - "bind address already in use" # - "panic: runtime error" ``` -------------------------------- ### Size Constraint Filter Source: https://github.com/debridmediamanager/zurg-testing/wiki/Organizing-Your-Torrents-Made-Easy Filter torrents based on their size using `size_gte` for 'greater than or equal to'. This example sets a minimum size of 5GB. ```yaml - size_gte: 5000000000 # Files larger than 5GB ``` -------------------------------- ### Configure Host Binding for External Access Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/troubleshooting.md Set the 'host' configuration to '0.0.0.0' to allow Zurg to listen on all network interfaces, enabling external connections. ```yaml host: "0.0.0.0" # Allow all interfaces ``` -------------------------------- ### Perform Hard Restart and Clear Caches Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/troubleshooting.md Execute a hard restart of Zurg services by stopping all containers, optionally clearing rclone caches, and then starting fresh. ```bash # Stop all docker compose down # Clear caches (optional, destructive) rm -rf ~/.cache/rclone/ # Start fresh docker compose up -d ``` -------------------------------- ### Jellyfin Integration Configuration Source: https://github.com/debridmediamanager/zurg-testing/wiki/Config Provides settings for integrating with a Jellyfin Media Server, including the server URL and authentication token. ```yaml jellyfin_server_url: "" jellyfin_token: "" ``` -------------------------------- ### Systemd Service Management Commands Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/cli-commands.md These commands are used to manage the Zurg service when integrated with systemd. They allow starting the service, checking its status, and viewing its logs. ```bash systemctl start zurg systemctl status zurg journalctl -u zurg -f ``` -------------------------------- ### Directory Listing (PROPFIND) Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/endpoints.md Lists the contents of a virtual directory within the WebDAV interface. Supports specifying the depth of the listing. ```APIDOC ## PROPFIND /dav/shows ### Description List contents of virtual directory corresponding to configured directories. ### Method PROPFIND ### Endpoint /dav/shows ### Headers - **Host**: localhost:9999 - **Depth**: 1 ### Response #### Success Response (207 Multi-Status) - **displayname** (string) - File or directory name - **getcontenttype** (string) - MIME type - **getcontentlength** (integer) - File size in bytes - **getetag** (string) - Resource tag - **getlastmodified** (string) - Last modification time (ISO 8601) #### Error Responses - **401 Unauthorized** - Invalid credentials (if auth configured) - **404 Not Found** - Directory not found ``` -------------------------------- ### Media Analysis Settings Source: https://github.com/debridmediamanager/zurg-testing/wiki/Config Enables automatic analysis of new torrents using ffprobe and caches network test results to improve startup performance. ```yaml auto_analyze_new_torrents: true cache_network_test_results: true ``` -------------------------------- ### Pull Specific Zurg RC Docker Image Version Source: https://github.com/debridmediamanager/zurg-testing/blob/main/README.md Pull a specific release candidate version of the zurg Docker image. This example uses v0.10.0-rc.4-1. ```sh docker pull ghcr.io/debridmediamanager/zurg:v0.10.0-rc.4-1 ``` -------------------------------- ### Upgrade Zurg via Docker Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/deployment.md Steps to upgrade Zurg when installed via Docker Compose, including pulling the latest image, restarting the service, and verifying the version. ```bash # Pull new image docker compose pull # Restart with new image docker compose up -d # Check version docker compose exec zurg zurg version ``` -------------------------------- ### Create rclone configuration directory Source: https://github.com/debridmediamanager/zurg-testing/wiki/Guides/'No-docker'-setup-in-Ubuntu-or-any-Linux-distros Ensures the necessary directory structure exists for the rclone configuration file. ```bash mkdir -p $HOME/.config/rclone/ ``` -------------------------------- ### Inspect Zurg Directory Configuration Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/troubleshooting.md Review the 'directories' section in your Zurg configuration to ensure it's correctly defined. ```bash # Check config has directories docker compose exec zurg cat /app/config.yml | grep -A 5 "directories:" ``` -------------------------------- ### Get Account Info API Request Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/real-debrid-integration.md This Real-Debrid API endpoint retrieves account status and usage details. Zurg uses this periodically for health monitoring and verification. ```http GET https://api.real-debrid.com/rest/1.0/user Authorization: Bearer ``` -------------------------------- ### Monitor System Resources for Zurg Process Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/troubleshooting.md Use 'top' to monitor system resources for the specific Zurg process ID. This helps identify high memory or CPU usage. ```bash # Monitor system resources top -p $(docker inspect -f '{{.State.Pid}}' zurg) ``` -------------------------------- ### Monitor Zurg Request Rate Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/troubleshooting.md Count the total number of log lines in Zurg to get a rough estimate of the request rate, ensuring it's reasonable for the interval. ```bash # Monitor request rate docker compose logs zurg | wc -l # Should be reasonable for interval ``` -------------------------------- ### Advanced rclone WebDAV Configuration for zurg Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/rclone-integration.md This advanced configuration includes longer read and write timeouts and enables skipping the DAV check for potentially faster mounting. Adjust timeouts as needed. ```ini [zurg] type = webdav url = http://zurg:9999/dav vendor = other pacer_min_sleep = 0 read_timeout = 120s write_timeout = 120s skip_dav_check = true ``` -------------------------------- ### Reduce Rclone Cache Size Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/troubleshooting.md Decrease the maximum cache size for your rclone mount to free up disk space and potentially reduce memory usage. Example: '10G'. ```bash --vfs-cache-max-size 10G # Reduce from 50G ``` -------------------------------- ### Granular Show Organization: Anime, TV, Documentaries Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/directory-filters.md Separate different types of shows into distinct directories. This example categorizes anime, standard TV series, and documentaries. ```yaml directories: anime: group: shows group_order: 10 filters: - regex: /\b[a-fA-F0-9]{8}\b/ - any_file_inside_regex: /\b[a-fA-F0-9]{8}\b/ tv_series: group: shows group_order: 20 filters: - has_episodes: true documentaries: group: shows group_order: 30 filters: - regex: /documentary|nature|bbc/i ``` -------------------------------- ### Monitor System Resources with Docker Stats Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/quick-reference.md Observe the resource utilization (CPU, memory, network, I/O) of Zurg and other Docker containers. ```bash # Monitor system resources docker stats ``` -------------------------------- ### Warm Up Cache Before Plex Scan Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/troubleshooting.md Pre-load the cache by finding all files on the Zurg mount before initiating a Plex library scan. ```bash # Pre-load cache find /mnt/zurg -type f > /dev/null # Then start Plex scan ``` -------------------------------- ### Regex Filter for Movies by Year Range Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/directory-filters.md Use a regex filter to match movies released within a specific year range. This example matches movies from 2018 to 2029. ```yaml directories: recent_movies: group: movies filters: - regex: /\b(202[0-9]|201[8-9])\b/ # Match 2018-2029 ``` -------------------------------- ### Complex Pattern Matching for Anime Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/directory-filters.md Combine regex patterns for precise matching of anime. This example matches anime hashes, files containing hashes, or files with group tags. ```yaml directories: anime: group: media group_order: 10 filters: - regex: /\b[a-fA-F0-9]{8}\b/ # Match anime hashes - any_file_inside_regex: /\b[a-fA-F0-9]{8}\b/ # OR match if any file contains hash - regex: /\[.*\]/ # OR match files with group tags [SubGroup] ``` -------------------------------- ### WebDAV Exposed Directories with Group Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/endpoints.md Shows the resulting WebDAV paths when directories are configured with a 'group' in Zurg. Directories are nested under the specified group. ```text /dav/media/shows/ /dav/media/movies/ ``` -------------------------------- ### Restart Zurg Services Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/troubleshooting.md Commands to restart Zurg and related services. Soft restarts preserve data like Real-Debrid cache, while hard restarts involve stopping and starting all services. ```bash # Restart zurg (keeps Real-Debrid cache) docker compose restart zurg ``` ```bash # Restart rclone (rebuilds mount) docker compose restart rclone ``` ```bash # Restart both docker compose restart zurg rclone ``` -------------------------------- ### Test File Listing Performance Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/quick-reference.md Measure the time it takes to perform a recursive listing of all files in the Zurg mount to assess performance. ```bash # 6. Performance okay? time ls -1R /mnt/zurg/ > /dev/null ``` -------------------------------- ### Get Torrent Details API Request Source: https://github.com/debridmediamanager/zurg-testing/blob/main/_autodocs/real-debrid-integration.md This Real-Debrid API endpoint retrieves detailed information for a specific torrent, including its file list. Zurg calls this for each torrent in configured directories. ```http GET https://api.real-debrid.com/rest/1.0/torrents/ Authorization: Bearer ``` -------------------------------- ### Check Mount Status Source: https://github.com/debridmediamanager/zurg-testing/wiki/History After upgrading and restarting zurg and rclone, verify the mount is working by listing its contents. ```bash ls -1R /pathtoyourzurgmount ```