JanDeDobbeleer / oh-my-posh

The most customisable and low-latency cross platform/shell prompt renderer
https://ohmyposh.dev
MIT License
16.76k stars 2.35k forks source link

Feature Request: YouTube Music Desktop App Integration #170

Closed KyleCrowley closed 3 years ago

KyleCrowley commented 3 years ago

Prerequisites

Description

YouTube Music Desktop App (YTMDA) is a cross-platform desktop music player for YouTube Music (YTM), a la the Spotify desktop app.

The request here is to add a segment very similar to the Spotify segment for YTM/YTMDA.

Based on some (very brief) investigation, similar logic ("scrape" the currently playing Artist - Song in the title of the application window) used in the Spotify segment should be able to be used with the YTMDA segment.

KyleCrowley commented 3 years ago

Upon further investigation, my initial solution will work, with the caveat that the title persists if the song is paused, so there's no way to "suppress" the segment if the song is paused (as the Spotify segment does). The Spotify player sets the title to Spotify (or Spotify Free if you don't not have Spotify premium), so that can be used to determine if the song is playing.

The good news is that YTMDA has a Remote Control API that can be used to get the currently playing track, which also returns whether the song is paused.

lnu commented 3 years ago

If the title persists it's even better. It will work like the macos version of the spotify segment.
The status will be paused with the right artist and track, instead of nothing on windows.

KyleCrowley commented 3 years ago

Interesting. I'm on Windows so for me the segment just "disappears" when I pause Spotify (or if an ad is playing).

If we want to display a play/paused icon in the segment, we'll likely have to go down the Remote Control API route, as there's no way of determining if the song is paused purely from the title of the window.

JanDeDobbeleer commented 3 years ago

If we go for remote control, it can be identical to MacOS Spotify. It's localhost so theoretically this should go fast.

EDIT: also that way it's cross platform from the start

KyleCrowley commented 3 years ago

@JanDeDobbeleer Unless you want to implement this yourself, I can give this a shot.

JanDeDobbeleer commented 3 years ago

@JanDeDobbeleer Unless you want to implement this yourself, I can give this a shot.

Feel free to do so!

github-actions[bot] commented 3 months ago

This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues. If you have found a problem that seems similar, please open a discussion first, complete the body with all the details necessary to reproduce, and mention this issue as reference.