jagrosh / MusicBot

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

[Bug Report] Music Bot can't play livestream sources on youtube #1664

Open Yootz opened 3 months ago

Yootz commented 3 months ago

Bug Description

When trying to play a livestream on youtube with the music bot, it gives error 403

here's the error log when trying to execute a livestream: [17:26:59] [ERROR] [AudioHandler]: Track WXZxjn7wysA has failed to play com.sedmelluq.discord.lavaplayer.tools.FriendlyException: Something broke when playing the track. at com.sedmelluq.discord.lavaplayer.tools.ExceptionTools.wrapUnfriendlyExceptions(ExceptionTools.java:45) at com.sedmelluq.discord.lavaplayer.track.playback.LocalAudioTrackExecutor.execute(LocalAudioTrackExecutor.java:121) at com.sedmelluq.discord.lavaplayer.player.DefaultAudioPlayerManager.lambda$executeTrack$2(DefaultAudioPlayerManager.java:339) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.base/java.lang.Thread.run(Unknown Source) Caused by: java.lang.RuntimeException: Not success status code: 403 at com.sedmelluq.discord.lavaplayer.tools.io.PersistentHttpStream.validateStatusCode(PersistentHttpStream.java:88) at com.sedmelluq.discord.lavaplayer.tools.io.PersistentHttpStream.attemptConnect(PersistentHttpStream.java:124) at com.sedmelluq.discord.lavaplayer.tools.io.PersistentHttpStream.connect(PersistentHttpStream.java:106) at com.sedmelluq.discord.lavaplayer.tools.io.PersistentHttpStream.internalRead(PersistentHttpStream.java:158) at com.sedmelluq.discord.lavaplayer.tools.io.PersistentHttpStream.read(PersistentHttpStream.java:174) at com.sedmelluq.discord.lavaplayer.container.mpeg.reader.MpegReader.tryReadInt(MpegReader.java:156) at com.sedmelluq.discord.lavaplayer.container.mpeg.reader.MpegReader.nextChild(MpegReader.java:54) at com.sedmelluq.discord.lavaplayer.container.mpeg.reader.MpegReader$Chain.run(MpegReader.java:254) at com.sedmelluq.discord.lavaplayer.container.mpeg.MpegFileLoader.parseHeaders(MpegFileLoader.java:68) at dev.lavalink.youtube.track.YoutubeMpegStreamAudioTrack.updateGlobalSequence(YoutubeMpegStreamAudioTrack.java:91) at dev.lavalink.youtube.track.YoutubeMpegStreamAudioTrack.(YoutubeMpegStreamAudioTrack.java:59) at dev.lavalink.youtube.track.YoutubeAudioTrack.processStream(YoutubeAudioTrack.java:173) at dev.lavalink.youtube.track.YoutubeAudioTrack.processWithClient(YoutubeAudioTrack.java:114) at dev.lavalink.youtube.track.YoutubeAudioTrack.process(YoutubeAudioTrack.java:71) at com.sedmelluq.discord.lavaplayer.track.playback.LocalAudioTrackExecutor.execute(LocalAudioTrackExecutor.java:109) ... 4 common frames omitted

Steps to Reproduce

  1. execute play command
  2. provide the link from a livestream youtube video
  3. console outputs error 403

Expected Result

play the output

Debug Output

System Properties:
  java.version = 11.0.18
  java.vm.name = OpenJDK 64-Bit Server VM
  java.vm.specification.version = 11
  java.runtime.name = OpenJDK Runtime Environment
  java.runtime.version = 11.0.18+10
  java.specification.version = 11
  os.arch = amd64
  os.name = Linux

JMusicBot Information:
  Version = 0.4.3
  Owner = 856228667393703936
  Prefix = .
  AltPrefix = !!
  MaxSeconds = 0
  NPImages = true
  SongInStatus = false
  StayInChannel = true
  UseEval = false
  UpdateAlerts = true

Dependency Information:
  JDA Version = 4.4.1_353
  JDA-Utilities Version = 3.0.5
  Lavaplayer Version = 2.2.1

Runtime Information:
  Total Memory = 37
  Used Memory = 18

Discord Information:
  ID = 1090490154944311376
  Guilds = 5
  Users = 2

Additional Info

I'm running the bot from sparkedhost

Checklist

JMusicBot Version

0.4.3