[GH-ISSUE #2559] [Feature]: YouTube DJ agent (free alternative to Spotify DJ) #1263

Closed
opened 2026-10-21 05:30:12 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Romuromylus on GitHub (Jun 14, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2559

Originally assigned to: @Romuromylus on GitHub.

What problem does this solve?

Spotify DJ is currently the only built-in "play music that matches the scene" agent, but it requires a Spotify account, OAuth, and Premium for playback control. Players who don't use Spotify (or don't have Premium) have no mood-music option. This is most noticeable in Game Mode, where ambient/background music adds a lot to the experience.

Proposed solution

Add a YouTube DJ agent as a free alternative to Spotify DJ:

  • Analyzes the narrative mood and plays a matching track in an embedded YouTube IFrame player, in-app. No OAuth, no Premium, no paid account, only a free YouTube Data API key.
  • The server resolves the search query so the API key is stored encrypted and never reaches the browser.
  • Top-bar mini player (mirrors Spotify's placement), a Settings toggle, a Game Mode toggle plus a "Retry YouTube DJ" entry in the game retry menu, and it mutes the built-in Game Mode music library while active.
  • Off by default; no behavior change for Spotify or any other agent.

Alternatives considered

  • YouTube via OAuth / YouTube Music: heavier, needs Google OAuth consent and scopes. The Data API + IFrame embed needs only a free API key and no login.
  • Reusing Spotify DJ: still requires a Spotify account/Premium; doesn't help non-Spotify users.
  • Client-side direct Data API calls: would expose the API key in the browser. Rejected for security; resolving server-side keeps the key encrypted at rest.

Additional context

Implemented and verified end-to-end on a self-hosted instance: search returns results, a mood-matched track loads and plays in the top-bar mini player in Game Mode, and the built-in game music is suppressed while it plays. PR to follow.

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @Romuromylus on GitHub (Jun 14, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2559 Originally assigned to: @Romuromylus on GitHub. ## What problem does this solve? Spotify DJ is currently the only built-in "play music that matches the scene" agent, but it requires a Spotify account, OAuth, and Premium for playback control. Players who don't use Spotify (or don't have Premium) have no mood-music option. This is most noticeable in Game Mode, where ambient/background music adds a lot to the experience. ## Proposed solution Add a **YouTube DJ** agent as a free alternative to Spotify DJ: - Analyzes the narrative mood and plays a matching track in an embedded YouTube IFrame player, in-app. No OAuth, no Premium, no paid account, only a free YouTube Data API key. - The server resolves the search query so the API key is stored encrypted and never reaches the browser. - Top-bar mini player (mirrors Spotify's placement), a Settings toggle, a Game Mode toggle plus a "Retry YouTube DJ" entry in the game retry menu, and it mutes the built-in Game Mode music library while active. - Off by default; no behavior change for Spotify or any other agent. ## Alternatives considered - **YouTube via OAuth / YouTube Music:** heavier, needs Google OAuth consent and scopes. The Data API + IFrame embed needs only a free API key and no login. - **Reusing Spotify DJ:** still requires a Spotify account/Premium; doesn't help non-Spotify users. - **Client-side direct Data API calls:** would expose the API key in the browser. Rejected for security; resolving server-side keeps the key encrypted at rest. ## Additional context Implemented and verified end-to-end on a self-hosted instance: search returns results, a mood-matched track loads and plays in the top-bar mini player in Game Mode, and the built-in game music is suppressed while it plays. PR to follow. ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#1263
No description provided.