SushiBtw / discord-music-player

Complete framework to facilitate music commands using discord.js v14 & v13.
https://discord-music-player.js.org/
MIT License
157 stars 65 forks source link

[BUG] Multiple Attempts to resolve one video #327

Open BennyDaBee opened 1 year ago

BennyDaBee commented 1 year ago

Bug Description Music Player will take multiple attempts with links/queries to resolve a youtube video.

Reproduction Steps Steps to reproduce the behavior:

  1. Request a song
  2. It replies saying null
  3. Repeat same request
  4. Replies null
  5. Repeat
  6. Finds video

Expected Result It to resolve the correct video the first time

Attachments image

Versioning:

Additional Comments Add any other context about the problem here.

sirlupusdev commented 1 year ago

This issue actually isn't related to DMP itself, but rather to its dependency ytsr. YTSR randomly throws "TypeError: filterWrapper is not iterable" which DMP simply interprets as NoSongFound (even though that isn't the case). Related issue: https://github.com/TimeForANinja/node-ytsr/issues/180 There's an open pull request regarding the issue on their repo.

sirlupusdev commented 1 year ago

Once it's published, you may want to override the ytsr version in your package.json temporarily (or not), until DMP owners bump the ytsr version. If you don't want to wait, you can look into patching ytsr with patch-package temporarily (which is what I've done).

SushiBtw commented 1 year ago

Hey, bump today.

sirlupusdev commented 1 year ago

@SushiBtw The fix isn't merged into ytsr yet, so bumping won't be of use at the moment.

EclipseGame18 commented 1 year ago

I still have this issue of having to run the "!play" command around 50 times for the bot to find the requested song, is there any fix for this yet?

BennyDaBee commented 1 year ago

@EclipseGame18 You can do a work around for now, by editing the package.json file, and for ytdl-core, make it look like the following.

"ytdl-core": "npm:@distube/ytdl-core@^4.11.16",