### Install qbittorrent-api using User Scripts (Bash) Source: https://github.com/trash-guides/guides/blob/master/docs/Downloaders/qBittorrent/Tips/How-to-run-the-unRaid-mover-for-qBittorrent.md This bash script installs the 'qbittorrent-api' module using pip. It's designed to be used with unRAID's User Scripts feature, typically configured to run once at array start. This method is simpler for one-time installations but doesn't manage dependencies persistently like a venv. ```bash #!/bin/bash pip3 install qbittorrent-api ``` -------------------------------- ### Docker Compose Example for Ubuntu Source: https://github.com/trash-guides/guides/blob/master/docs/File-and-Folder-Structure/How-to-set-up/Docker.md A sample docker-compose.yml file for an Ubuntu installation, demonstrating how to configure storage locations for containers. It assumes host and container storage paths are the same for simplicity and specifies appdata storage. ```yaml --8<-- "includes/docker/docker-compose.yml" ``` -------------------------------- ### Create Python venv and Install qbittorrent-api (Bash) Source: https://github.com/trash-guides/guides/blob/master/docs/Downloaders/qBittorrent/Tips/How-to-run-the-unRaid-mover-for-qBittorrent.md This snippet demonstrates creating a Python virtual environment and installing the 'qbittorrent-api' module within it. It's recommended for persistent dependency management. The commands first create the venv, then activate it, install the package using pip, and finally deactivate the environment. ```bash #!/bin/bash # Define the path for the virtual environment VENV_PATH="/mnt/user/appdata/scripts/.venv" # Create or clear the virtual environment python3 -m venv --clear "${VENV_PATH}" # Activate the virtual environment and install the package source "${VENV_PATH}/bin/activate" pip3 install qbittorrent-api # Deactivate the environment deactivate ``` -------------------------------- ### Install Requests Module using Go File (Bash) Source: https://github.com/trash-guides/guides/blob/master/docs/Downloaders/Deluge/Tips/Unraid-Mover.md Installs the 'requests' Python module by adding a command to the unRAID 'go' file, which executes on server startup. This method ensures the module is installed every time the server starts. It requires editing the '/boot/config/go' file. ```bash pip3 install requests ``` -------------------------------- ### Automated Synology Docker Setup Script Source: https://github.com/trash-guides/guides/blob/master/docs/File-and-Folder-Structure/How-to-set-up/Synology.md This script automates the initial setup of Docker and related configurations on Synology DSM 7 and higher. It requires SSH access and home folders to be enabled. Use with caution as it modifies system settings and can reset existing configurations. The script is intended for initial setup only. ```bash curl -sL git.io/syno-script > ~/syno-script ``` ```bash sudo bash ~/syno-script ``` -------------------------------- ### Local MkDocs Development with Bash Source: https://context7.com/trash-guides/guides/llms.txt Instructions for setting up and running a local MkDocs development server. It covers installing MkDocs, its dependencies, and starting the server for live preview. ```bash # Install MkDocs and dependencies pip install mkdocs pip install -r docs/requirements.txt # Start local development server mkdocs serve # Documentation available at http://127.0.0.1:8000 # Build static site mkdocs build # Validate markdown files markdownlint docs/**/*.md ``` -------------------------------- ### Mover Tuning Start Script for unRAID and qBittorrent Source: https://github.com/trash-guides/guides/blob/master/docs/Downloaders/qBittorrent/Tips/How-to-run-the-unRaid-mover-for-qBittorrent.md This bash script is designed to run before the unRAID mover starts. It pauses torrents within a specified age range that are located on the cache drive, preparing them for the mover process. It requires the qbittorrent-api module. ```bash #!/bin/bash # # qBit-Mover - mover-tuning-start.sh # # This script is executed by Mover Tuning before the unRAID mover starts. # It pauses torrents that meet the criteria defined in the configuration file. # Source the configuration file source "/mnt/user/appdata/qbt-mover/mover-tuning.cfg" # Check if qbittorrent-api is installed if ! python3 -c "import qbittorrent_api" >/dev/null 2>&1; then echo "qbittorrent-api is not installed. Please install it." exit 1 fi # Connect to qBittorrent qb = qbittorrent_api.Client(host=QBIT_HOST, port=QBIT_PORT, username=QBIT_USER, password=QBIT_PASS) try: qb.auth_log_in() except qbittorrent_api.LoginFailed as e: echo "Login failed: {e}" exit 1 # Get torrents and filter them torrents = qb.torrents_info() for torrent in torrents: # Check if torrent is on the cache drive (adjust path as needed) if torrent.save_path.startswith(CACHE_MOUNT_POINT): # Check if torrent is within the specified age range if (time.time() - torrent.added_on) > (TORRENT_AGE_THRESHOLD * 86400): # Pause the torrent if it's not already paused if torrent.state != 'paused': print(f"Pausing torrent: {torrent.name}") qb.torrents_pause(torrent_hash=torrent.hash) qb.auth_log_out() exit 0 ``` -------------------------------- ### Install Requests Module using User Scripts (Bash) Source: https://github.com/trash-guides/guides/blob/master/docs/Downloaders/Deluge/Tips/Unraid-Mover.md Installs the 'requests' Python module using the unRAID User Scripts plugin. This script runs once when the array starts for the first time, ensuring the module is available. It requires the User Scripts plugin to be installed. ```bash #!/bin/bash pip3 install requests ``` -------------------------------- ### Run Docker Compose Commands Source: https://github.com/trash-guides/guides/blob/master/docs/File-and-Folder-Structure/How-to-set-up/Synology.md These commands are used to navigate to the Docker application data directory and start Docker Compose services in detached mode. Ensure all previous containers are removed and backups are made if necessary. Errors during startup usually indicate issues with folder creation or permissions. ```bash cd /volume1/docker/appdata ``` ```bash sudo docker-compose up -d ``` -------------------------------- ### Start MkDocs Local Server (Bash) Source: https://github.com/trash-guides/guides/blob/master/CONTRIBUTING.md Starts a local development server to preview MkDocs documentation changes in real-time. This command should be run from the repository's root directory. ```bash mkdocs serve ``` -------------------------------- ### Install MkDocs (Bash) Source: https://github.com/trash-guides/guides/blob/master/CONTRIBUTING.md Installs the MkDocs static site generator using pip. This is a prerequisite for previewing the documentation locally. ```bash pip install mkdocs ``` -------------------------------- ### Create Usenet Subfolders in unRAID Source: https://github.com/trash-guides/guides/blob/master/docs/File-and-Folder-Structure/How-to-set-up/Unraid.md This command uses `mkdir -p` to create a nested directory structure for Usenet downloads, including incomplete and complete download areas, and organizes them by media type (tv, movies, music). It also sets up the media library folders. This is intended for use in the unRAID terminal. ```bash mkdir -p /mnt/user/data/{usenet/{incomplete,complete}/{tv,movies,music},media/{tv,movies,music}} ``` -------------------------------- ### Download docker-compose.yml using wget Source: https://github.com/trash-guides/guides/blob/master/docs/File-and-Folder-Structure/How-to-set-up/Synology.md This command uses `wget` to download the `docker-compose.yml` file from a specified GitHub URL directly to the '/volume1/docker/appdata/' directory on the Synology NAS. This file is crucial for setting up Docker containers and their configurations. ```bash wget https://raw.githubusercontent.com/TRaSH-/Guides-Synology-Templates/main/docker-compose/docker-compose.yml -P /volume1/docker/appdata/ ``` -------------------------------- ### Start and Manage Docker Compose Services Source: https://github.com/trash-guides/guides/blob/master/includes/file-and-folder-structure/docker-compose-commands.md Commands to build, create, start, and manage Docker containers defined in a docker-compose.yml file. The `up -d` command builds images if necessary and starts containers in detached mode. Running `up` again recreates running containers. ```bash sudo docker-compose up -d ``` ```bash sudo docker-compose pull ``` ```bash sudo docker-compose down ``` -------------------------------- ### Install MkDocs Dependencies (Bash) Source: https://github.com/trash-guides/guides/blob/master/CONTRIBUTING.md Installs the necessary dependent modules for MkDocs from the requirements.txt file. This command should be run from the repository's root directory. ```bash pip install -r docs/requirements.txt ``` -------------------------------- ### Recyclarr Configuration for Syncing (YAML) Source: https://context7.com/trash-guides/guides/llms.txt Example YAML configuration for Recyclarr, a tool used to synchronize TRaSH Guide Custom Formats and Quality Profiles between Radarr and Sonarr instances. It specifies base URLs, API keys, and detailed settings for quality definitions and profiles. ```yaml # recyclarr.yml radarr: movies: base_url: http://localhost:7878 api_key: YOUR_API_KEY quality_definition: type: movie quality_profiles: - name: HD Bluray + WEB reset_unmatched_scores: enabled: true upgrade: allowed: true until_quality: Bluray-1080p until_score: 10000 min_format_score: 0 quality_sort: top qualities: - name: Bluray-1080p - name: WEB 1080p qualities: - WEBRip-1080p - WEBDL-1080p - name: Bluray-720p custom_formats: - trash_ids: - ed27ebfef2f323e964fb1f61391bcb35 # HD Bluray Tier 01 - c20c8647f2746a1f4c4262b0fbbeeeae # HD Bluray Tier 02 - c20f169ef63c5f40c2def54abaf4438e # WEB Tier 01 - 403816d65392c79236dcb6dd591aeda4 # WEB Tier 02 quality_profiles: - name: HD Bluray + WEB - trash_ids: - ed38b889b31be83fda192888e2286d83 # BR-DISK - 90a6f9a284dff5103f6346090e6280c8 # LQ quality_profiles: - name: HD Bluray + WEB score: -10000 ``` -------------------------------- ### Configure qBittorrent Mover Script (Bash with Python) Source: https://github.com/trash-guides/guides/blob/master/docs/Downloaders/qBittorrent/Tips/How-to-run-the-unRaid-mover-for-qBittorrent.md This script automates pausing torrents, running the mover script, and resuming torrents. It utilizes Python for the core logic and bash for execution and notifications. Ensure Python 3 is installed and the mover script is accessible. ```bash #!/bin/bash /usr/local/emhttp/plugins/dynamix/scripts/notify -s "qBittorrent Mover" -d "qBittorrent Mover starting @ `date +%H:%M:%S`." echo "executing script to pause torrents and run mover." python3 /mnt/user/appdata/scripts/mover.py --host "ip:port" --user "your_user" --password "your_password" --cache-mount "/mnt/cache" --days_from 0 --days_to 2 echo "qbittorrent-mover completed and resumed all paused torrents." /usr/local/emhttp/plugins/dynamix/scripts/notify -s "qBittorrent Mover" -d "qBittorrent Mover completed @ `date +%H:%M:%S`." ``` ```bash #!/bin/bash /usr/local/emhttp/plugins/dynamix/scripts/notify -s "qBittorrent Mover" -d "qBittorrent Mover starting @ `date +%H:%M:%S`." echo "executing script to pause torrents and run mover." /mnt/user/appdata/scripts/.venv/bin/python3 /mnt/user/appdata/scripts/mover.py --host "ip:port" --user "your_user" --password "your_password" --cache-mount "/mnt/cache" --days_from 0 --days_to 2 echo "qbittorrent-mover completed and resumed all paused torrents." /usr/local/emhttp/plugins/dynamix/scripts/notify -s "qBittorrent Mover" -d "qBittorrent Mover completed @ `date +%H:%M:%S`." ``` -------------------------------- ### Create Torrent Media Folder Structure Source: https://github.com/trash-guides/guides/blob/master/docs/File-and-Folder-Structure/How-to-set-up/Synology.md This bash command sets up a directory structure for torrent-based media downloads. It creates folders for tv, movies, and music within both a 'torrents' directory and a 'media' directory, all located under '/volume1/data/'. This facilitates organized storage of media acquired via torrents. ```bash mkdir -p /volume1/data/{torrents/{tv,movies,music},media/{tv,movies,music}} ``` -------------------------------- ### Fix unRaid Permissions via Terminal Source: https://github.com/trash-guides/guides/blob/master/docs/File-and-Folder-Structure/How-to-set-up/Unraid.md This snippet provides the terminal commands to recursively change ownership and permissions for a specified directory. It's crucial to ensure the path is correct and aligns with the guide's setup to avoid data loss. This method is an alternative to unRaid's built-in 'Docker Safe New Perms' utility. ```bash chown -R nobody:users /mnt/user/data/ chmod -R a=,a+rX,u+w,g+w /mnt/user/data/ ``` -------------------------------- ### Create Usenet Media Folder Structure Source: https://github.com/trash-guides/guides/blob/master/docs/File-and-Folder-Structure/How-to-set-up/Synology.md This bash command creates a nested directory structure for Usenet media downloads. It includes separate directories for incomplete and complete downloads, categorized by media type (tv, movies, music), within the '/volume1/data/' share. This structure helps organize downloaded content efficiently. ```bash mkdir -p /volume1/data/{usenet/{incomplete,complete}/{tv,movies,music},media/{tv,movies,music}} ``` -------------------------------- ### Create Torrent Subfolders in unRAID Source: https://github.com/trash-guides/guides/blob/master/docs/File-and-Folder-Structure/How-to-set-up/Unraid.md This command utilizes `mkdir -p` to efficiently create a directory structure for torrent downloads, categorized by media type (tv, movies, music). It also establishes the necessary subfolders for the media library. This command is designed for execution within the unRAID terminal. ```bash mkdir -p /mnt/user/data/{torrents/{tv,movies,music},media/{tv,movies,music}} ``` -------------------------------- ### Fclones Usage Example (Bash) Source: https://github.com/trash-guides/guides/blob/master/docs/File-and-Folder-Structure/Replace-copies-with-hardlinks.md A basic command to run fclones, which identifies and can replace duplicate files with hardlinks. This example includes options for operating on a single filesystem, including hidden files, and following symbolic links. Paths should be adjusted to your directory structure. ```bash fclones --one-fs --hidden --follow-links "/mnt/user/data/torrents/movies/" "/mnt/user/data/media/movies" ``` -------------------------------- ### Create Appdata Folder Structure Source: https://github.com/trash-guides/guides/blob/master/docs/File-and-Folder-Structure/How-to-set-up/Synology.md This bash command creates a standardized directory structure for application data within the '/volume1/docker/appdata/' path. It includes subfolders for common applications like Radarr, Sonarr, Plex, etc., allowing for organized storage of container configurations and data. Users can extend this by adding their own application subfolders. ```bash mkdir -p /volume1/docker/appdata/{radarr,sonarr,bazarr,plex,prowlarr,pullio} ``` -------------------------------- ### Create Torrent Subfolders with Bash Source: https://github.com/trash-guides/guides/blob/master/docs/File-and-Folder-Structure/How-to-set-up/Docker.md This bash command creates the necessary subfolders for torrent downloads, including directories for TV, movies, and music, as well as a general media directory. ```bash mkdir -p /data/{torrents/{tv,movies,music},media/{tv,movies,music}} ``` -------------------------------- ### Recyclarr Configuration Source: https://context7.com/trash-guides/guides/llms.txt Configuration details for Recyclarr, a tool for syncing TRaSH Guide Custom Formats and Quality Profiles to Radarr/Sonarr instances. ```APIDOC ## Third-Party Sync Tool Configuration (Recyclarr) Recyclarr configuration files sync TRaSH Guide Custom Formats and Quality Profiles to your Radarr/Sonarr instances. ### `recyclarr.yml` Example ```yaml # recyclarr.yml radarr: movies: base_url: http://localhost:7878 api_key: YOUR_API_KEY quality_definition: type: movie quality_profiles: - name: HD Bluray + WEB reset_unmatched_scores: enabled: true upgrade: allowed: true until_quality: Bluray-1080p until_score: 10000 min_format_score: 0 quality_sort: top qualities: - name: Bluray-1080p - name: WEB 1080p qualities: - WEBRip-1080p - WEBDL-1080p - name: Bluray-720p custom_formats: - trash_ids: - ed27ebfef2f323e964fb1f61391bcb35 # HD Bluray Tier 01 - c20c8647f2746a1f4c4262b0fbbeeeae # HD Bluray Tier 02 - c20f169ef63c5f40c2def54abaf4438e # WEB Tier 01 - 403816d65392c79236dcb6dd591aeda4 # WEB Tier 02 quality_profiles: - name: HD Bluray + WEB - trash_ids: - ed38b889b31be83fda192888e2286d83 # BR-DISK - 90a6f9a284dff5103f6346090e6280c8 # LQ quality_profiles: - name: HD Bluray + WEB score: -10000 ``` ``` -------------------------------- ### Navigate to qBit-Mover Directory (Bash) Source: https://github.com/trash-guides/guides/blob/master/docs/Downloaders/qBittorrent/Tips/How-to-run-the-unRaid-mover-for-qBittorrent.md A simple command to change the current directory to the location of the qBit-Mover scripts. This is a prerequisite for running other commands that operate on these scripts. ```bash cd /mnt/user/appdata/qbt-mover/ ``` -------------------------------- ### Get PUID and PGID using 'id' command Source: https://github.com/trash-guides/guides/blob/master/docs/File-and-Folder-Structure/How-to-set-up/Synology.md This command retrieves the User ID (PUID) and Group ID (PGID) for a specified user, typically 'docker', which is essential for Docker containers to access Synology shares correctly. The output provides numerical IDs that should be saved for later use. ```bash id docker ``` -------------------------------- ### Configuration File for qBit-Mover Scripts Source: https://github.com/trash-guides/guides/blob/master/docs/Downloaders/qBittorrent/Tips/How-to-run-the-unRaid-mover-for-qBittorrent.md This configuration file stores all user-defined variables for the qBit-Mover scripts, including connection details for qBittorrent, the age threshold for torrents to be moved, and paths. It centralizes settings for easy management. ```bash # qBit-Mover - mover-tuning.cfg # # Configuration file for the qBit-Mover scripts. # Please read and edit the instructions inside the script files for detailed explanations. # --- qBittorrent Connection Settings --- # Hostname or IP address of your qBittorrent instance QBIT_HOST="localhost" # Port for qBittorrent WebUI (default is 8080) QBIT_PORT="8080" # Username for qBittorrent WebUI (leave empty if no authentication) QBIT_USER="" # Password for qBittorrent WebUI (leave empty if no authentication) QBIT_PASS="" # --- Mover Settings --- # Age of torrents in days to be considered for moving. Torrents older than this will be paused. TORRENT_AGE_THRESHOLD=7 # --- Paths --- # Mount point of your unRAID cache drive. Adjust if your setup is different. CACHE_MOUNT_POINT="/mnt/cache/" # --- Optional: fclones Settings --- # Set to 'true' to enable fclones, 'false' to disable. ENABLE_FCLONES="false" # Path to the fclones executable. FCLONES_PATH="/usr/local/bin/fclones" # --- Optional: qBit-Manage Integration --- # Set to 'true' to enable qBit-Manage integration, 'false' to disable. ENABLE_QBIT_MANAGE="false" # Path to the qBit-Manage script. QBIT_MANAGE_SCRIPT="/path/to/your/qbit-manage.sh" ``` -------------------------------- ### Set up Python Virtual Environment with Requests (Bash) Source: https://github.com/trash-guides/guides/blob/master/docs/Downloaders/Deluge/Tips/Unraid-Mover.md Creates and configures a Python virtual environment to manage the 'requests' module dependency. This method ensures the dependency is isolated to this environment and persists across reboots. It involves creating the environment, activating it, installing the module, and then deactivating. ```bash python3 -m venv --clear /mnt/user/data/scripts/.venv source /mnt/user/data/scripts/.venv/bin/activate pip3 install requests deactivate ``` -------------------------------- ### Create Usenet Subfolders with Bash Source: https://github.com/trash-guides/guides/blob/master/docs/File-and-Folder-Structure/How-to-set-up/Docker.md This bash command creates the necessary subfolders for Usenet downloads, including incomplete and complete directories for TV, movies, and music, as well as a general media directory. ```bash mkdir -p /data/{usenet/{incomplete,complete}/{tv,movies,music},media/{tv,movies,music}} ``` -------------------------------- ### Mover Tuning End Script for unRAID and qBittorrent Source: https://github.com/trash-guides/guides/blob/master/docs/Downloaders/qBittorrent/Tips/How-to-run-the-unRaid-mover-for-qBittorrent.md This bash script is designed to run after the unRAID mover has finished. It resumes any torrents that were previously paused by the start script, allowing seeding to continue. It relies on the qbittorrent-api module. ```bash #!/bin/bash # # qBit-Mover - mover-tuning-end.sh # # This script is executed by Mover Tuning after the unRAID mover finishes. # It resumes torrents that were paused by the start script. # Source the configuration file source "/mnt/user/appdata/qbt-mover/mover-tuning.cfg" # Check if qbittorrent-api is installed if ! python3 -c "import qbittorrent_api" >/dev/null 2>&1; then echo "qbittorrent-api is not installed. Please install it." exit 1 fi # Connect to qBittorrent qb = qbittorrent_api.Client(host=QBIT_HOST, port=QBIT_PORT, username=QBIT_USER, password=QBIT_PASS) try: qb.auth_log_in() except qbittorrent_api.LoginFailed as e: echo "Login failed: {e}" exit 1 # Get torrents and resume them if they were paused by this script torrents = qb.torrents_info() for torrent in torrents: # Check if torrent is on the cache drive (adjust path as needed) if torrent.save_path.startswith(CACHE_MOUNT_POINT): # Check if torrent is paused and meets the age criteria (to ensure we only resume relevant torrents) if torrent.state == 'paused' and (time.time() - torrent.added_on) > (TORRENT_AGE_THRESHOLD * 86400): print(f"Resuming torrent: {torrent.name}") qb.torrents_resume(torrent_hash=torrent.hash) qb.auth_log_out() exit 0 ``` -------------------------------- ### Import Custom Formats via Radarr/Sonarr API (Bash) Source: https://context7.com/trash-guides/guides/llms.txt Demonstrates how to interact with the Radarr/Sonarr API to manage Custom Formats. Includes examples for retrieving existing formats, posting new ones with specific criteria, and updating quality profiles with custom format scores. ```bash # Get existing Custom Formats curl -X GET "http://localhost:7878/api/v3/customformat" \ -H "X-Api-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" # Import a new Custom Format curl -X POST "http://localhost:7878/api/v3/customformat" \ -H "X-Api-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "BR-DISK", "includeCustomFormatWhenRenaming": false, "specifications": [ { "name": "BR-DISK", "implementation": "ReleaseTitleSpecification", "negate": false, "required": true, "fields": { "value": "^(?!.*\\b((?