Tyrrrz / YoutubeExplode

Abstraction layer over YouTube's internal API
MIT License
2.98k stars 497 forks source link

500 error when calling GetManifestAsync #782

Closed krispy52 closed 2 months ago

krispy52 commented 9 months ago

Version

6.3.13

Platform

.NET 8.0/Windows 11

Steps to reproduce

var youtube = new YoutubeClient(); var streamManifest = await youtube.Videos.Streams.GetManifestAsync($"https://www.youtube.com/watch?v=IA3WxTTPXqQ");

Details

Expected Behavior: Returns valid StreamManifest Actual Behavior: HttpRequestException thrown

Checklist

Tyrrrz commented 9 months ago

500 errors can happen sometimes and they're indicative of transient failures on YouTube's side

krispy52 commented 9 months ago

@Tyrrrz This is not a transient failure, I am able to reproduce it. The issue might be specific to long duration videos, YouTube video id: IA3WxTTPXqQ is 37hrs. I was able to get manifest for videos up to 30hrs in the past without any issues.

Tyrrrz commented 9 months ago

Indeed, I can reproduce this too.

RamiroGarrido commented 6 months ago

I'm having the same issue with any URL...help please. Here's the complete stack trace I receive on the catch in case it helps:

at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode() at YoutubeExplode.Videos.VideoController.GetPlayerResponseAsync(VideoId videoId, CancellationToken cancellationToken) in C:\Users\Ramiro\VisualStudioProjects\MediaConverterRGM\YoutubeExplode\Videos\VideoController.cs:line 76 at YoutubeExplode.Videos.Streams.StreamClient.GetStreamInfosAsync(VideoId videoId, CancellationToken cancellationToken)+MoveNext() in C:\Users\Ramiro\VisualStudioProjects\MediaConverterRGM\YoutubeExplode\Videos\Streams\StreamClient.cs:line 175 at YoutubeExplode.Videos.Streams.StreamClient.GetStreamInfosAsync(VideoId videoId, CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource.GetResult() at YoutubeExplode.Utils.Extensions.AsyncCollectionExtensions.ToListAsync[T](IAsyncEnumerable1 source) in C:\Users\Ramiro\VisualStudioProjects\MediaConverterRGM\YoutubeExplode\Utils\Extensions\AsyncCollectionExtensions.cs:line 48 at YoutubeExplode.Utils.Extensions.AsyncCollectionExtensions.ToListAsync[T](IAsyncEnumerable1 source) in C:\Users\Ramiro\VisualStudioProjects\MediaConverterRGM\YoutubeExplode\Utils\Extensions\AsyncCollectionExtensions.cs:line 48 at YoutubeExplode.Videos.Streams.StreamClient.GetManifestAsync(VideoId videoId, CancellationToken cancellationToken) in C:\Users\Ramiro\VisualStudioProjects\MediaConverterRGM\YoutubeExplode\Videos\Streams\StreamClient.cs:line 229 at MediaConverterAPI.Repositories.Implementations.YoutubeRepository.convertURL(ConversionRequest requestModel) in C:\Users\Ramiro\VisualStudioProjects\MediaConverterRGM\MediaConverterAPI\Repositories\Implementations\YoutubeRepository.cs:line 61

Tyrrrz commented 2 months ago

This seems to have been fixed, either by #818 or by YouTube themselves (seeing as 500 error would indicate their fault).

image