jagrosh / MusicBot

🎶 A Discord music bot that's easy to set up and run yourself!
https://jmusicbot.com
Apache License 2.0
5.36k stars 2.56k forks source link

[Bug Report] "Error loading: Video returned by YouTube isn't what was requested" #1527

Closed Djinnistorm closed 6 months ago

Djinnistorm commented 7 months ago

Bug Description

Updated to 0.4.0 on the 8th. Last request that worked was on the 26th, bot was not in use again until today. Today, no youtube requests work. I instead got the error "Error loading: Video returned by YouTube isn't what was requested." I then restarted the bot, and when I tried to play a youtube video, it responded that it was adding the request to begin playing...but did not play any tracks. I then closed it and booted up the previous version, which worked normally. Finally, we opened the latest version again and made one last request, only to get the error mentioned previously again.

Soundcloud requests, however, still work on the latest version, as do requests to local files.

Steps to Reproduce

  1. Boot bot from 0.4.0 jar file
  2. Use the Play command to attempt to play any youtube video

Expected Result

I expected the bot to play music from youtube

Debug Output

System Properties:
  java.version = 16.0.1
  java.vm.name = Java HotSpot(TM) 64-Bit Server VM
  java.vm.specification.version = 16
  java.runtime.name = Java(TM) SE Runtime Environment
  java.runtime.version = 16.0.1+9-24
  java.specification.version = 16
  os.arch = amd64
  os.name = Windows 10

JMusicBot Information:
  Version = 0.4.0
  Owner = 182299753281880065
  Prefix = !!
  AltPrefix = null
  MaxSeconds = 0
  NPImages = false
  SongInStatus = false
  StayInChannel = true
  UseEval = false
  UpdateAlerts = true

Dependency Information:
  JDA Version = 4.4.1_353
  JDA-Utilities Version = 3.0.5
  Lavaplayer Version = 727959e9f621fc457b3a5adafcfffb55fdeaa538-SNAPSHOT

Runtime Information:
  Total Memory = 88
  Used Memory = 43

Discord Information:
  ID = 417380432053796874
  Guilds = 3
  Users = 4

Additional Info

I'm not entirely sure why the debug info indicates Java version is 16.0.1 when running java -version indicates I'm running OpenJDK 11.0.20. My apologies if this is related.

Console contents at time of request:

[21:37:41] [INFO] [JMusicBot]: Loaded config from C:\USERNAMEOldFolder\Documents\MusicBot\config.txt
[21:37:42] [INFO] [JDA]: Login Successful!
[21:37:42] [INFO] [WebSocketClient]: Connected to WebSocket
[21:37:42] [INFO] [JDA]: Finished Loading!
[21:37:52] [INFO] [YoutubeAccessTokenTracker]: Updating YouTube visitor id (current is null).
[21:37:53] [INFO] [YoutubeAccessTokenTracker]: Updating YouTube visitor id succeeded, new one is CgtZUFFOZk94UVEwVSjxtpiwBjIKCgJVUxIEGgAgWToKIK293OaV7oaDZg%3D%3D, next update will be after 600 seconds.

Checklist

Djinnistorm commented 7 months ago

...and now, nearly two hours later, the same Youtube track plays just fine despite me doing literally nothing since. I'm honestly not sure what to say.

frankfraynk commented 7 months ago

Same issue here... Might be something on youtube's end. Does the bot also join and leave really fast for you? I didn't see anything in the logs that would suggest trouble.

Gondar159 commented 7 months ago

Same issue, it definitely is a youtube issue cause using soundcloud links works just fine. Hope they fix it soon :3

Mino5531 commented 7 months ago

Fixed the issue for me by downgrading back to 0.3.9

nek0d3r commented 7 months ago

Fixed the issue for me by downgrading back to 0.3.9

Same issue, this workaround helped me. Thank you!

Bezoika commented 7 months ago

Same problem here, only seems to do it sometimes.

AdriaanBoshoff commented 7 months ago

I also started getting this. It only happened after a admin "Disconnected" the bot. After which no youtube links work anymore. Downgrading it fixes it.

Diblox commented 7 months ago

Same issue here. Restarting the whole VM fix it temporarily but it comes back every time. I'm going to downgrade for now.

Djinnistorm commented 7 months ago

To answer some of the comments, my copy of the bot is not disconnecting and reconnecting on its own, nor did I need to disconnect it to cause the issue, or any other strange behavior. Just the error mentioned in the issue title. I just tried it again today though and the error is back at this exact moment, so clearly it's not a one-off issue either.

briankendall commented 7 months ago

I'm experiencing the same issue. Sometimes the bot connects and disconnects immediately, and sometimes it acts as though a track is playing but produces no audio, and the position on the track stays at 00:00. If I try to play something doing a search, i.e. -p something then it produces no error messages. I only get the "Video returns by YouTube isn't what was requested" error if I give it a link to a specific video.

I'll try downgrading to 0.3.9 and see if that helps.

jagrosh commented 7 months ago

This is an issue that will need to be addressed in lavaplayer, the library this bot uses to fetch music. Also, downgrading is unlikely to fix the issue, it's restarting the bot that is likely clearing some cached value which may be allowing things to temporarily work.

AndreiWasFound commented 7 months ago

i get this too. i am running it on portainer with the craumix repo

[20:38:01] [INFO] [YoutubeAccessTokenTracker]: Updating YouTube visitor id (current is null).
[20:38:02] [INFO] [YoutubeAccessTokenTracker]: Updating YouTube visitor id succeeded, new one is XXXX next update will be after 600 seconds.

and sometimes even a restart doesnt fix it

Djinnistorm commented 7 months ago

This is an issue that will need to be addressed in lavaplayer, the library this bot uses to fetch music. Also, downgrading is unlikely to fix the issue, it's restarting the bot that is likely clearing some cached value which may be allowing things to temporarily work.

And yet downgrading does, in fact, cause the bot to work while restarting did not. I tried it again at the time of my last comment to be sure. Steps I took below:

  1. attempted to play a Youtube track on version 0.4.0, received error
  2. Closed console, booted up version 0.3.9, exact same link plays normally
  3. closed console again, booted up version 0.4.0, exact same link receives error
  4. rebooted version 0.4.0 for kicks, same link same error
Djinnistorm commented 7 months ago

Did some more testing for kicks, first with the new version, then with the previous (no alternating this time). Steps taken:

  1. Open bot from Jar file
  2. !!play https://www.youtube.com/watch?v=ZjlYFWLUDBQ (some random meme that has worked before)
  3. !!shutdown

Latest version success rate: 5 out of 15 attempts. the successes were not consecutive. Previous version success rate: 10 out of 10 attempts Not exactly the largest sample size, but still. not a single failure on the previous version.

bjohnst1998 commented 7 months ago

Downgrading from 0.4 to 0.3.9 also fixed it for me.

livehifi commented 7 months ago

I believe it is fixed by e.g. yt-dlp/yt-dlp/pull/9553 regarding lavaplayer using Android as the default client. Same issue, I think. Based on discussions. So something in 0.4.0 involved that same issue most likely. I am going to try a downgrade while this gets worked out <3

edit 0.3.9 worked briefly but sort of broken again, alas!

monsieurgui commented 7 months ago

Attempted a revert to 0.3.9 and now the issue isn't present anymore. Will wait until next version to upgrade. Thanks!

BJudge96 commented 7 months ago

Any way to downgrade to 0.3.9 using the Docker container?

AndreiWasFound commented 7 months ago

Any way to downgrade to 0.3.9 using the Docker container?

If you are using portainer what i did was change the image from “craumix/jmusicbot:latest”(if ur using craumix’s one) to “craumix/jmusicbot:0.3.9”, therefore changing the version it uses.

Tyoda commented 7 months ago

Can confirm, reverting 49c3ec79607bef5b15096ebd7b3645ba5a5b2095 fixes the issue

WildChargerTV commented 7 months ago

+1 here, I'm stuck on 0.3.9 until this is fixed

01GamerUnknown commented 7 months ago

Confirmed.... 0.3.9 works for me with no issues. Thanks @Djinnistorm

gacrestani commented 7 months ago

Confirmed that reverting to 0.3.9 fixed the issue for me. However, I believe this may be related to YouTube's API. Android's YouTube Vanced is not working properly anymore, and other places that embed YouTube videos are also not working. I notice all those issues starting at the same time.

Pocket-Deer commented 7 months ago

0.3.9 works fine, thanks @Djinnistorm

dicamarques14 commented 7 months ago

For reference: https://github.com/lavalink-devs/lavaplayer/issues/90#issuecomment-2035383418 The issue is on the lavaplayer

Lundte commented 7 months ago

Unraid

Hi Y'all

I'm using Unraid, more specific this repo: criscrafter/jmusicbot Its running 0.4.0

Do anyone of you know how I revert to 0.3.9 ??

Or even better, do you know how to fix 0.4.0?

AndreiWasFound commented 7 months ago

try doing what i said above

Lundte commented 7 months ago

@AndreiWasFound

craumix/jmusicbot:0.3.9

I tried to do that. by changing the repo to: craumix/jmusicbot:0.3.9 But then it kept saying "No token provided! Exiting." in the log.

I have checked allready checked the token in config and its the correct one. hmm.

AndreiWasFound commented 7 months ago

well im sorry then, i dont know what’s happening there, i havent used unraid in a while. maybe try deleting the current config and let it generate a new one?

yellowcooln commented 7 months ago

@AndreiWasFound I am running UNRaid as well. For us we might have to move it from a docker to a VM or something else.

The uploader for the App on Unraid does not have the tags that we need. Here is the DockerHub page

image

UnpixeltGuard commented 7 months ago

@yellowcooln

@AndreiWasFound I am running UNRaid as well. For us we might have to move it from a docker to a VM or something else.

The uploader for the App on Unraid does not have the tags that we need. Here is the DockerHub page

No, fortunately you can just add the container manually or adjust the repository for your current container and check if the paths still work out. You are not forced/required to use the Community Apps on Unraid. I responded to Lundte with what is most likely the culprit of his issues.

image

image

UnpixeltGuard commented 7 months ago

@Lundte

@AndreiWasFound

craumix/jmusicbot:0.3.9

I tried to do that. by changing the repo to: craumix/jmusicbot:0.3.9 But then it kept saying "No token provided! Exiting." in the log.

I have checked allready checked the token in config and its the correct one. hmm.

For the craumix Image you just add the path, that the config is in, compared to a lot of other docker images where you directly mount the config.txt .

eg. your current config looks something like

/path/to/config.txt:/app/config.txt:ro

but the craumix image expects:

/path/to:/jmb/config:ro

Config being a directory instead of a file in this case. Try editing your config path in Unraid to provide the Container Path /jmb/config and the Host Path to the directory where all your JMusicBot files (serversettings.json, config.txt, Playlists) are.

image

Something like this.

jcadduono commented 7 months ago

looks like they figured it out over at https://github.com/lavalink-devs/lavaplayer/pull/93 - we'll just have to wait and see how long it takes to merge into lavaplayer and @jagrosh to put out an update

ikcoil01 commented 7 months ago

rolling back 0.3.9 resolved the issue above for me: Error Loading... and not loading youtube, immediatley disconnecting etc.

alexandreteles commented 7 months ago

If anyone is using my Docker image, I will release a version with the old 0.39 version this week. I was going to wait until the problem was solved but it seems more than a dozen people are using it lol

RubixStars commented 6 months ago

[TEMPORARY FIX] Use v0.3.9 of the bot/jar file It works

tr1p0p commented 6 months ago

confirm this bus too, and the temporary fix work also.

M3RT1N99 commented 6 months ago

Any way to downgrade to 0.3.9 using the Docker container?

If you are using portainer what i did was change the image from “craumix/jmusicbot:latest”(if ur using craumix’s one) to “craumix/jmusicbot:0.3.9”, therefore changing the version it uses.

If you have criscrafter/jmusicbot:latest you need to delete the docker "let the checkbox set" also remove image and reinstall it with a new variable click on [Add another Path, Port, Variable, Label or Device] then insert those values and save

Config Type: Variable name: downgrade "it's up to u doesn't matter what u type in here, it's just for info" Key: response Value: $(curl -s https://api.github.com/repos/jdenbroeder/MusicBot/releases/tag/0.3.9.2) Default Value: $(curl -s https://api.github.com/repos/jdenbroeder/MusicBot/releases/tag/0.3.9.2)

image

MichailiK commented 6 months ago

For consolidation purposes, we're going to continue tracking this bug in #1537. My latest comment on that issue has a temporary solution for anyone who can't wait for 0.4.1 to release

M3RT1N99 commented 6 months ago

Unraid

Hi Y'all

I'm using Unraid, more specific this repo: criscrafter/jmusicbot Its running 0.4.0

Do anyone of you know how I revert to 0.3.9 ??

Or even better, do you know how to fix 0.4.0? Just posted here the solution https://github.com/jagrosh/MusicBot/issues/1527#issuecomment-2059834196