aquelemiguel / parrot

🦜 A hassle-free, highly performant, self-hosted Discord music bot with YouTube and Spotify support. Powered by yt-dlp.
MIT License
136 stars 44 forks source link

Bot is not playing track #242

Closed Educorreia932 closed 1 year ago

Educorreia932 commented 1 year ago

📝 Description

Even though not displaying any error and fetching the query results correctly, the bot is not playing any kind of track.

🪜 Reproduction Steps

  1. Use /play command
  2. Bot is summoned, but no track is played (as stated by /np command as well)

ℹ Environment / Computer Info

Using the Docker image doesn't seem to have any problems, this happened while testing the bot locally.

📸 Screenshots

image

afonsojramos commented 1 year ago

Using the Docker image doesn't seem to have any problems, this happened while testing the bot locally.

Having this in mind, my guess is that it is either yt-dlp or ffmpeg interfering in some way. As those are the things that sort of work outside our dependencies.

lucawen commented 1 year ago

Did you managed to fix it ?

lordzsolt commented 1 year ago

@lucawen I had the same issue, upgrading yt-dlp version fixed it. (I had a ~4 month old yt-dlp)

Educorreia932 commented 1 year ago

I tested in Linux afterwards and it also worked, so it might just have been the yt-dlp version As such, I will close this issue for the moment

lordzsolt commented 1 year ago

Edit: Actually... Updating yt-dlp only fixed in on my local machine. On my server it's still broken.

I looked at the error log, I see the following error when attempting to download the metadata:

Application error: WARNING: [youtube] Failed to download m3u8 information: HTTP Error 429: Too Many Requests

Which is an issue reported on yt-dlp: https://github.com/yt-dlp/yt-dlp/issues/7143 However, strangely if I run yt-dlp manually, it successfully downloads the file. And right after, it seems to get the correct metadata.

My guess is that somehow this error is intercepted by parrot, and song in the stdout is ignored. And since all metadata is fetched from Youtube, nothing gets played.


Edit: I have found the root cause! 🥳 The output of yt-dlp is no longer what parrot expects. Instead of being a json for the metadata, and the song for ytdl function call, it contains WARNINGS.

So all the parsing that is done until NEWLINE_BYTE is broken.

Will open a PR.

houseofbugs commented 11 months ago

I'm getting this as well and updating to a new yt-dlp was the fix. I logged into the container console and ran pip install -U yt-dlp

joao-conde commented 11 months ago

I'm getting this as well and updating to a new yt-dlp was the fix. I logged into the container console and ran pip install -U yt-dlp

We already do that in the container, did it find a new version? Did it really updated? https://github.com/aquelemiguel/parrot/blob/main/Dockerfile#L25

houseofbugs commented 11 months ago

Yeah my container was on 2023.03.06 of the yt-dlp and now it's on 2023.11.16

joao-conde commented 11 months ago

If you remove cache and rebuild the container with this same docker image, is it still the case?

houseofbugs commented 11 months ago

Yessir. I already tried that. Did it on multiple machines as well. I'm using the official docker install.