ComputerMaster1st / Railgun

Railgun Re-written w/ C# + Entity Framework
11 stars 2 forks source link

BUG: Possible YoutubeExplode bug which is unhandled in MusicScheduler.FetchSongAsync #64

Open SlippyKorny opened 2 years ago

SlippyKorny commented 2 years ago

Description

When trying to download a new song for the queue, MusicSecheduler.FetchSongAsync throws an exception (stack trace below). I checked YoutubeExplode and it's working as intended so the most likely scenario is that the data passed into FetchSongAsync method is incorrect but I'm unsure because I haven't set up a local environment to test it. If you need any more info please let me know either here or on discord (Noir#4200).

Railgun.Music.SongQueueException: A song failed to queue! - YOUTUBE#XN63ceDE6QI
 ---> System.Net.Http.HttpRequestException: Response status code does not indicate success: 410 (Gone).
   at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
   at YoutubeExplode.Bridge.YoutubeController.SendHttpRequestAsync(HttpRequestMessage request, CancellationToken cancellationToken) in D:\a\YoutubeExplode\YoutubeExplode\YoutubeExplode\Bridge\YoutubeController.cs:line 59
   at YoutubeExplode.Bridge.YoutubeController.SendHttpRequestAsync(String url, CancellationToken cancellationToken) in D:\a\YoutubeExplode\YoutubeExplode\YoutubeExplode\Bridge\YoutubeController.cs:line 67
   at YoutubeExplode.Bridge.YoutubeController.GetVideoInfoAsync(VideoId videoId, String signatureTimestamp, CancellationToken cancellationToken) in D:\a\YoutubeExplode\YoutubeExplode\YoutubeExplode\Bridge\YoutubeController.cs:line 144
   at YoutubeExplode.Videos.Streams.StreamClient.PopulateStreamInfosAsync(ICollection`1 streamInfos, VideoId videoId, CancellationToken cancellationToken) in D:\a\YoutubeExplode\YoutubeExplode\YoutubeExplode\Videos\Streams\StreamClient.cs:line 307
   at YoutubeExplode.Videos.Streams.StreamClient.GetManifestAsync(VideoId videoId, CancellationToken cancellationToken) in D:\a\YoutubeExplode\YoutubeExplode\YoutubeExplode\Videos\Streams\StreamClient.cs:line 320
   at AudioChord.Extractors.YouTubeExtractor.ExtractSongAsync(String videoId, TimeSpan maximumDuration)
   at AudioChord.MusicService.DownloadSongAsync(String url, Boolean ignoreCache)
   at Railgun.Music.Scheduler.MusicScheduler.FetchSongAsync(SongId id) in X:\Railgun\Railgun\Music\MusicScheduler.cs:line 233
   --- End of inner exception stack trace ---
   at Railgun.Music.Scheduler.MusicScheduler.RequestNextSongAsync() in X:\Railgun\Railgun\Music\MusicScheduler.cs:line 83
   at Railgun.Music.Player.StartAsync() in X:\Railgun\Railgun\Music\Player.cs:line 149

Recreation steps

  1. Use command rgm play https://www.youtube.com/watch?v=RypOHapqCeQ
  2. Bot returns a message confirming that it queued image
  3. Exception is thrown, and bot proceeds to play different music
ComputerMaster1st commented 2 years ago

Answered in Discord.

ComputerMaster1st commented 2 years ago

DIRECT COPY FROM MY DISCORD

<==========>

@everyone GOOD NEWS!

@Cryzen#3071 will survive a little longer as I've managed to updated the addons used and I've found out that I've done a stupid this entire time...

I FORGOT TO INSTALL FFMPEG ON THE NEW SERVER which is needed for Cryzen to operate!

All music functions should now be fully operational!

Please note, Cryzen (aka Old Railgun) will only receive major bugfix updates as @Railgun#2398 once finished will be the new replacement but will not have YT implementation. Discord doesn't allow bots with YouTube implementation to play music anymore due to C&Ds, etc. as well as "being fraudulent".

We'll explain more about the new way to add music at a later date once I've locked down the method we'll be using to add music via slash commands.

Anyways, enjoy the new lease of life for @Cryzen#3071!

Regards,

Nekoputer