Tubifarry for Lidarr

repository·master·Indexed 21 days ago

https://github.com/typnull/tubifarry

A Lidarr plugin that expands music discovery and acquisition by integrating Spotify for indexing, YouTube for downloading, and Slskd/Soulseek for both. It features Arr-Soundtracks for importing from Sonarr and Radarr, Codec Tinker for FFmpeg-based audio conversion, Lyrics Enhancer for LRCLIB and Genius integration, and MetaMix for supplementing MusicBrainz data with Discogs, Deezer, and Last.fm.

Tokens
4.4K
Snippets
5
Records
30
Agent score
26%

What's inside Tubifarry

  1. Overview of Tubifarry for Lidarr

    master

    Tubifarry is a plugin for Lidarr designed to expand music library management by adding multiple external sources.

    Key capabilities include:

    • Spotify-based Indexing: Uses Spotify's catalog as an indexer to search for music, while using YouTube as the downloader for the actual audio files.
    • Soulseek Integration: Supports Slskd (the Soulseek client) as both an indexer and a downloader.
    • Soundtrack Management: Fetches soundtracks from Sonarr (TV series) and Radarr (movies) and integrates them into Lidarr via the Arr-Soundtracks import list feature.
    • Library Optimization: Includes Codec Tinker, which uses FFmpeg to convert audio files between different formats.
  2. How Tubifarry build automation works

    master

    Tubifarry uses MSBuild .targets files to automate the complex build requirements of a Lidarr plugin. The build order is:

    1. InitializeSubmodules: Checks for Submodules/Lidarr/src/NzbDrone.Core/Lidarr.Core.csproj. If missing, runs git submodule update --init --recursive.
    2. LidarrFrontendBuild: Checks for Submodules/Lidarr/_output/UI/. If missing, runs yarn install and yarn build in the Lidarr directory.
    3. BeforeBuild: Standard .NET preparation.
    4. Build: Compiles the Tubifarry C# code.
    5. CopySystemTextJson: Copies required runtime DLLs.
    6. ILRepacker: Merges all plugin dependencies into a single DLL.
    7. PostBuild (Debug only): Automatically deploys the plugin to C:\ProgramData\Lidarr\plugins\AUTHOR\Tubifarry\ for immediate testing.
  3. Supported Web Clients in Tubifarry

    master

    Tubifarry supports several web services that provide music. While they share a base architecture, stability and uptime are not guaranteed by Tubifarry.

    Supported Clients:

    • Lucida: A music downloading service supporting multiple sources.
    • DABmusic: A high-resolution audio streaming platform.
    • T2Tunes: A music downloading service that supports AmazonMusic.
    • Subsonic: A generic music streaming API standard. The Subsonic Indexer and Client in Tubifarry can connect to any online service that implements the Subsonic specification.
  4. Configure Slskd as a Soulseek Download Client

    master

    To use Slskd for downloading:

    1. Go to Settings -> Download Clients and click Add.
    2. Select Slskd from the list.
    3. Note: The download path is fetched from Slskd. If the path does not match your Lidarr setup, use the Remote Path settings to resolve it.
  5. Configure Custom Metadata Sources and MetaMix

    master

    Tubifarry can supplement MusicBrainz with data from Discogs, Deezer, and Last.fm using the MetaMix feature.

    Individual Metadata Sources

    1. Go to Settings > Metadata and open a specific source.
    2. Toggle it on and configure:
      • User Agent: Format Name/Version.
      • API Key: Your personal access token.
      • Caching Method: Memory Caching (fast) or Permanent Caching (reliable, requires disk storage).
      • Cache Directory: Path for permanent caching.

    MetaMix (Advanced Combination)

    MetaMix combines multiple sources to create complete profiles.

    1. Go to Settings > Metadata and open MetaMix.
    2. Priority Rules: Set hierarchy (e.g., MusicBrainz = 1, Discogs = 2). Lower numbers have higher priority.
    3. Dynamic Threshold: Controls how aggressively the system switches to lower-priority sources (Higher = more aggressive; Lower = sticks to primary).
    4. Multi-Source Population: When enabled, missing info from your primary source is automatically filled by secondary sources.
  6. First-time setup for Tubifarry development

    master

    Follow this checklist to set up your development environment:

    1. Install Prerequisites:
      • Visual Studio 2022 with .NET 8 SDK
      • Git
      • Node.js 20.x
    2. Prepare Repository:
      • Fork Tubifarry and clone your fork.
      • Initialize submodules: git submodule update --init --recursive.
    3. Build Dependencies:
      • Build Lidarr frontend: cd Submodules/Lidarr && yarn install && yarn build.
      • Build Lidarr backend: Open Lidarr.sln and build.
    4. Build Tubifarry:
      • Open Tubifarry.sln and build.
    5. Test:
      • Run Lidarr.Console to verify.
  7. Install development prerequisites for Tubifarry

    master

    To develop for Tubifarry, you must install the following software:

    Required

    • Visual Studio 2022 or higher (must include .NET 8 SDK; VS 2022 V17.0+).
    • Git for version control.
    • Node.js 20.x (Note: Versions 18.x, 16.x, or 21.x are not compatible).
    • Yarn (Package manager). If using Node 20+, enable it via corepack enable. Otherwise, install via npm i -g corepack).
    • Rider (JetBrains alternative to Visual Studio).
    • VS Code for quick text edits.

    System Requirements

    • Windows: 10/11
    • Linux: Any modern distribution
    • macOS: 10.14+ (Mojave or newer)
    • RAM: 8GB minimum (16GB recommended)
    • Storage: 5GB free space
    # No specific install command provided, but requirements are listed.
  8. Submit a Pull Request to Tubifarry

    master

    When contributing to Tubifarry, follow these steps to submit your changes:

    1. Push your branch to your fork:
    git push origin feature/your-feature-name
    1. Open a Pull Request on GitHub targeting the develop branch (do not target master).
    2. Fill out the PR template, including a description, references to related issues (e.g., Fixes #123), and screenshots for UI changes.
    3. Respond to feedback by making updates in your branch and pushing them; the PR will update automatically.

    Important Rules:

    • Never make PRs to master.
    • Don't merge develop into your feature branch; use rebase instead.
    • ✅ Create one PR per feature or bugfix.
  9. Use Lyrics Fetcher to download and embed lyrics

    master

    The Lyrics Fetcher (via the Lyrics Enhancer MetadataConsumer) downloads synchronized lyrics from LRCLIB and plain lyrics from Genius.

    How to Enable:

    1. Go to Settings > Metadata in Lidarr.
    2. Open the Lyrics Enhancer MetadataConsumer and toggle it on.

    Configuration Options:

    • Create LRC Files: Creates external .lrc files for time-synced lyrics.
    • Embed Lyrics in Audio Files: Embeds lyrics directly into the audio file's metadata.
    • Overwrite Existing LRC Files: Replaces existing .lrc files with newly downloaded ones.
  10. Configure Codec Tinker for automatic audio conversion

    master

    The Codec Tinker MetadataConsumer automatically converts audio files between formats using FFmpeg during import.

    How to Enable:

    1. Go to Settings > Metadata in Lidarr.
    2. Open the Codec Tinker MetadataConsumer and toggle it on.

    Usage and Rules:

    • Target Format: Set a default format (e.g., FLAC, Opus, MP3).
    • Custom Conversion Rules: Define specific logic like wav -> flac or AAC>=256k -> MP3:300k.
    • Custom Conversion Rules On Artists: Apply specific tags to an artist, e.g., opus-192 for all their albums.
    • Format-Specific Toggles: Use checkboxes to enable conversion for specific formats (e.g., Convert MP3, Convert FLAC).

    Warning: Lossy formats (MP3, AAC) cannot be converted to lossless formats (FLAC, WAV) because quality cannot be restored.

  11. Set up Tubifarry development environment using Manual Setup

    master

    If automatic setup fails, follow these manual steps to initialize the environment.

    1. Initialize Submodules

    git submodule update --init --recursive

    2. Build Lidarr Frontend

    Navigate to the Lidarr submodule and build the React UI:

    cd Submodules/Lidarr/
    yarn install
    yarn build

    Note: Use yarn start instead of yarn build if you want hot-reloading for frontend development.

    3. Build Lidarr Backend

    1. Open Submodules/Lidarr/Lidarr.sln in Visual Studio 2022.
    2. Set Lidarr.Console as the Startup Project.
    3. Build the solution (Ctrl + Shift + B).

    4. Build Tubifarry Plugin

    1. Navigate back to the Tubifarry root directory.
    2. Open Tubifarry.sln in Visual Studio.
    3. Build the solution (Ctrl + Shift + B).

    5. Manual Deployment (Fallback)

    If the plugin does not automatically deploy to the debug folder, manually copy the following files from Tubifarry/bin/Debug/net8.0/ to C:\ProgramData\Lidarr\plugins\AUTHOR\Tubifarry\:

    • Lidarr.Plugin.Tubifarry.dll
    • Lidarr.Plugin.Tubifarry.pdb (if exists)
    • Lidarr.Plugin.Tubifarry.deps.json (if exists)
    git submodule update --init --recursive
    
    # Inside Submodules/Lidarr/
    yarn install
    yarn build
  12. Configure YouTube Indexer and Download Client

    master

    YouTube Indexer Setup

    1. Navigate to Settings -> Indexers and click Add.
    2. Select Tubifarry (found under the Other category at the bottom of the list).

    YouTube Download Client Setup

    1. Go to Settings -> Download Clients and click Add.
    2. Select Youtube from the list.
    3. Set the download path and required settings.

    Important: YouTube Bot Detection & FFmpeg

    • Bot Detection: YouTube actively blocks automated downloaders. You must configure the Trusted Session Generator and provide cookie authentication to bypass detection.
    • FFmpeg: Required for audio extraction and conversion. The plugin attempts to download FFmpeg automatically, but it is recommended to ensure FFmpeg is in your system PATH or specify its location in settings. Without FFmpeg, files may be downloaded in formats that Lidarr cannot properly import.