Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: /api/v1/play plays song even with dismissed queue #2825

Open
3 of 5 tasks
FluffyPunk opened this issue Jan 4, 2025 · 1 comment
Open
3 of 5 tasks

[Bug]: /api/v1/play plays song even with dismissed queue #2825

FluffyPunk opened this issue Jan 4, 2025 · 1 comment

Comments

@FluffyPunk
Copy link

FluffyPunk commented Jan 4, 2025

Preflight Checklist

  • I use the latest version of YouTube Music (Application).
  • I have searched the issue tracker for a bug report that matches the one I want to file, without success.
  • I understand that th-ch/youtube-music has NO affiliation with Google or YouTube

YouTube Music (Application) Version

3.7.1

Checklists

What operating system are you using?

Windows

Operating System Version

Windows 11 24H2

What CPU architecture are you using?

x64

Last Known Working YouTube Music (Application) version

No response

Reproduction steps

API server should be enabled

  1. Dismiss queue (or DELETE /api/v1/queue)
  2. /api/v1/play

Expected Behavior

I think it should be unavailable to launch song since there's no songs in queue.

Actual Behavior

Sending request launches last played song after dismissing queue. It is showed by sending /api/v1/song

{
  "title": "cheatreal",
  "artist": "t+pazolite",
  "views": 438926,
  "uploadDate": "2022-11-30T02:07:10-08:00",
  "imageSrc": "https://lh3.googleusercontent.com/fngVaWP1iFl8OpmQyerxW17bJjzfrUH4w45ZHVEf3tKpwqhnVEXdcx3zp49OX3pftKoaCw2qJURxYxFWsA=w544-h544-l90-rj",
  "isPaused": true,
  "songDuration": 295,
  "elapsedSeconds": 0,
  "url": "https://music.youtube.com/watch?v=MzDpeX3eJRQ",
  "album": "Answer from X Girlz",
  "videoId": "MzDpeX3eJRQ",
  "playlistId": "RDAMPLOLAK5uy_kdLCctiPE2quAcjleq3tpLmqpgwiyAGDI",
  "mediaType": "AUDIO"
}

But at same moment queue is empty

{
  "items": [],
  "autoPlaying": false
}

Enabled plugins

  1. API Server
  2. Audio Compressor
  3. Exponential Volume
  4. Discord RPC
  5. Disable Autoplay
  6. In-App Menu
  7. Lyrics Genius
  8. Navigation
  9. Precise Volume

Additional Information

I see 2 ways of fixing this - simple and kinda complicated.

Simple is one is just checking queue for items - if there is no items[] in queue, so return error on /api/v1/play that there is no songs

Other way is checking if videoId in current song info (/api/v1/song) is presented in queue, but I'm not sure about queue structure since it looks kinda spaghetti raw JSON

@franz-dc
Copy link
Contributor

franz-dc commented Jan 5, 2025

When you dismiss the queue, YouTube Music (web) retains the current playing song and just resets the playback at 0s, which is kinda weird personally.

If we make a workaround just for the API server, the data from the API would differ from the source of truth (YouTube Music itself).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants