th-ch / youtube-music

YouTube Music Desktop App bundled with custom plugins (and built-in ad blocker / downloader)
https://th-ch.github.io/youtube-music/
MIT License
8.27k stars 485 forks source link

[Feature Request]: Implement play and pause CLI with yargs #2444

Closed horberlan closed 1 week ago

horberlan commented 1 week ago

Preflight Checklist

Problem Description

be able to play and pause with CLI via the prompt

Proposed Solution

use https://www.npmjs.com/package/yargs

Alternatives Considered

$ youtube-music-desktop-app play # or pause change playPause() boolean value

Additional Information

No response

ArjixWasTaken commented 1 week ago

You can already do this... It is not a cli command though, it is a url protocol.

./youtube-music youtubemusic://playPause will invoke the protocol with playPause as the operation

ArjixWasTaken commented 1 week ago

yes, it is a toggle and not an explicit play/pause

ArjixWasTaken commented 1 week ago

here are the protocol operations: https://github.com/th-ch/youtube-music/blob/master/src/providers/song-controls.ts#L27-L80

horberlan commented 1 week ago

@ArjixWasTaken Is there currently any way to do this via the bash shell?

ArjixWasTaken commented 1 week ago

are you implying that what I sent does not work with the bash shell? (bash ain't a terminal)

horberlan commented 1 week ago

I solved it by making a request with curl

ArjixWasTaken commented 1 week ago

I solved it by making a request with curl

that is one way of doing it, you could also directly invoke youtube-music as shown in the snippet I gave you