Skip to content

[Bug] SpotifyToYouTubeEnricher Crash: ArgumentNullException in YouTubeMusicAPI (buttons[2] token null) #91

Description

@brownajah

Tubifarry Version

v2.0.0.1 (develop)

Lidarr Version

v3.1.1.4884

Operating System

Docker

Bug Description

I am running the develop branch of Tubifarry on Lidarr v3.1.1.4884. When performing a search (either interactive or automatic), the plugin successfully finds potential matches on YouTube Music (retrieving the Album IDs correctly), but the SpotifyToYouTubeEnricher crashes immediately when attempting to fetch the album info.

The error suggests that the parser in the YouTubeMusicAPI dependency is looking for a specific token (playlistId) within buttons[2], which appears to no longer exist or has moved in the YouTube Music DOM.

Steps to Reproduce

  1. Add Tubifarry indexer (Develop branch).
  2. Search for an album (e.g., "Haunting" by "Braeker").
  3. Check debug/trace logs.
  4. Observe that YouTube album IDs are found, but enrichment fails for every result.

Expected Behavior

The plugin should parse the YouTube Music album page, retrieve the tracklist/bitrate, and add the release to Lidarr.

Trace Log Files

2025-12-05 07:24:45.3|Trace|YouTubeParser|Added album: 'World Breaker' by 'NumbSquidAI' (Bitrate: 128kbps)
2025-12-05 07:24:45.6|Debug|SpotifyToYouTubeEnricher|Failed to get album info for YouTube album: 'haunting my dreams' (ID: OLAK5uy_m5xu1Nutm-vFisLC9Fne8uRnqhjI0_f_k)

[v3.1.1.4884] System.ArgumentNullException: Requiered token is null. (Parameter 'buttons[2].musicPlayButtonRenderer.playNavigationEndpoint.watchPlaylistEndpoint.playlistId')
at YouTubeMusicAPI.Internal.Selectors.SelectObject[T](JToken value, String path)
at YouTubeMusicAPI.Internal.Parsers.InfoParser.GetAlbum(JObject jsonToken)
at YouTubeMusicAPI.Client.YouTubeMusicClient.GetAlbumInfoAsync(String browseId, CancellationToken cancellationToken)
at Tubifarry.Indexers.Spotify.SpotifyToYouTubeEnricher.EnrichSingleAlbumAsync(AlbumData albumData)

2025-12-05 07:24:46.1|Debug|YouTubeParser|Failed to enrich album data for: 'Circuit Breaker'

[v3.1.1.4884] System.ArgumentNullException: Requiered token is null. (Parameter 'buttons[2].musicPlayButtonRenderer.playNavigationEndpoint.watchPlaylistEndpoint.playlistId')
at YouTubeMusicAPI.Internal.Selectors.SelectObject[T](JToken value, String path)
at YouTubeMusicAPI.Internal.Parsers.InfoParser.GetAlbum(JObject jsonToken)
at YouTubeMusicAPI.Client.YouTubeMusicClient.GetAlbumInfoAsync(String browseId, CancellationToken cancellationToken)
at Tubifarry.Indexers.YouTube.YouTubeParser.EnrichAlbumWithYouTubeDataAsync(AlbumData albumData)

Log Checklist

  • I have enabled Trace logging in Lidarr before reproducing the issue

Screenshots

Screenshots

Additional Context

It appears the YouTubeMusicAPI library is hardcoded to look for the "Play" button (or similar navigation element) at index [2] of the buttons array in the JSON response.

The logs confirm the Album ID is found (OLAK5uy_m5xu1Nutm-vFisLC9Fne8uRnqhjI0_f_k), but GetAlbumInfoAsync fails to parse the resulting page data. This likely indicates a change in the YouTube Music website structure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    YouTubeFor features related to YoutubebugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions