Tyrrrz / YoutubeDownloader

Downloads videos and playlists from YouTube
MIT License
8.7k stars 1.19k forks source link

I tried downloading a video but got 403 forbidden #427

Closed 12345xinkai closed 2 months ago

12345xinkai commented 6 months ago

Version

1.10.10

Platform

win10

Steps to reproduce

https://www.youtube.com/watch?v=K5qh09Hy15I, it is 20g

Details

Expected behavior: Done Actual: Failed

Checklist

Tyrrrz commented 6 months ago

Can you copy the error (click on the Failed message)

12345xinkai commented 6 months ago

Sorry I think this was a conversion error

12345xinkai commented 6 months ago

System.Net.Http.HttpRequestException: Response status code does not indicate success: 403 (Forbidden). at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode() at System.Net.Http.HttpClient.GetStreamAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken) at YoutubeExplode.Videos.Streams.MediaStream.ResolveSegmentAsync(CancellationToken cancellationToken) in /_/YoutubeExplode/Videos/Streams/MediaStream.cs:line 54 at YoutubeExplode.Videos.Streams.MediaStream.InitializeAsync(CancellationToken cancellationToken) in /_/YoutubeExplode/Videos/Streams/MediaStream.cs:line 60 at YoutubeExplode.Videos.Streams.StreamClient.GetAsync(IStreamInfo streamInfo, CancellationToken cancellationToken) in /_/YoutubeExplode/Videos/Streams/StreamClient.cs:line 335 at YoutubeExplode.Videos.Streams.StreamClient.CopyToAsync(IStreamInfo streamInfo, Stream destination, IProgress1 progress, CancellationToken cancellationToken) in //YoutubeExplode/Videos/Streams/StreamClient.cs:line 350 at YoutubeExplode.Videos.Streams.StreamClient.DownloadAsync(IStreamInfo streamInfo, String filePath, IProgress`1 progress, CancellationToken cancellationToken) in //YoutubeExplode/Videos/Streams/StreamClient.cs:line 365 at YoutubeExplode.Converter.Converter.PopulateStreamInputsAsync(String baseFilePath, IReadOnlyList1 streamInfos, ICollection1 streamInputs, IProgress1 progress, CancellationToken cancellationToken) in /_/YoutubeExplode.Converter/Converter.cs:line 196 at YoutubeExplode.Converter.Converter.ProcessAsync(String filePath, Container container, IReadOnlyList1 streamInfos, IReadOnlyList1 closedCaptionTrackInfos, IProgress1 progress, CancellationToken cancellationToken) in //YoutubeExplode.Converter/Converter.cs:line 271 at YoutubeExplode.Converter.ConversionExtensions.DownloadAsync(VideoClient videoClient, IReadOnlyList1 streamInfos, IReadOnlyList1 closedCaptionTrackInfos, ConversionRequest request, IProgress`1 progress, CancellationToken cancellationToken) in //YoutubeExplode.Converter/ConversionExtensions.cs:line 85 at YoutubeDownloader.Core.Downloading.VideoDownloader.DownloadVideoAsync(String filePath, IVideo video, VideoDownloadOption downloadOption, Boolean includeSubtitles, IProgress1 progress, CancellationToken cancellationToken) in D:\a\YoutubeDownloader\YoutubeDownloader\YoutubeDownloader.Core\Downloading\VideoDownloader.cs:line 67 at YoutubeDownloader.ViewModels.Components.DashboardViewModel.<>c__DisplayClass30_0.<<EnqueueDownload>b__0>d.MoveNext() in D:\a\YoutubeDownloader\YoutubeDownloader\YoutubeDownloader\ViewModels\Components\DashboardViewModel.cs:line 100

anuragtyagi-dev commented 4 months ago

Does this resolved for you now ?

System.Net.Http.HttpRequestException: Response status code does not indicate success: 403 (Forbidden). at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode() at System.Net.Http.HttpClient.GetStreamAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken) at YoutubeExplode.Videos.Streams.MediaStream.ResolveSegmentAsync(CancellationToken cancellationToken) in /_/YoutubeExplode/Videos/Streams/MediaStream.cs:line 54 at YoutubeExplode.Videos.Streams.MediaStream.InitializeAsync(CancellationToken cancellationToken) in /_/YoutubeExplode/Videos/Streams/MediaStream.cs:line 60 at YoutubeExplode.Videos.Streams.StreamClient.GetAsync(IStreamInfo streamInfo, CancellationToken cancellationToken) in /_/YoutubeExplode/Videos/Streams/StreamClient.cs:line 335 at YoutubeExplode.Videos.Streams.StreamClient.CopyToAsync(IStreamInfo streamInfo, Stream destination, IProgress1 progress, CancellationToken cancellationToken) in //YoutubeExplode/Videos/Streams/StreamClient.cs:line 350 at YoutubeExplode.Videos.Streams.StreamClient.DownloadAsync(IStreamInfo streamInfo, String filePath, IProgress`1 progress, CancellationToken cancellationToken) in //YoutubeExplode/Videos/Streams/StreamClient.cs:line 365 at YoutubeExplode.Converter.Converter.PopulateStreamInputsAsync(String baseFilePath, IReadOnlyList1 streamInfos, ICollection1 streamInputs, IProgress1 progress, CancellationToken cancellationToken) in /_/YoutubeExplode.Converter/Converter.cs:line 196 at YoutubeExplode.Converter.Converter.ProcessAsync(String filePath, Container container, IReadOnlyList1 streamInfos, IReadOnlyList1 closedCaptionTrackInfos, IProgress1 progress, CancellationToken cancellationToken) in //YoutubeExplode.Converter/Converter.cs:line 271 at YoutubeExplode.Converter.ConversionExtensions.DownloadAsync(VideoClient videoClient, IReadOnlyList1 streamInfos, IReadOnlyList1 closedCaptionTrackInfos, ConversionRequest request, IProgress`1 progress, CancellationToken cancellationToken) in //YoutubeExplode.Converter/ConversionExtensions.cs:line 85 at YoutubeDownloader.Core.Downloading.VideoDownloader.DownloadVideoAsync(String filePath, IVideo video, VideoDownloadOption downloadOption, Boolean includeSubtitles, IProgress1 progress, CancellationToken cancellationToken) in D:\a\YoutubeDownloader\YoutubeDownloader\YoutubeDownloader.Core\Downloading\VideoDownloader.cs:line 67 at YoutubeDownloader.ViewModels.Components.DashboardViewModel.<>c__DisplayClass30_0.<<EnqueueDownload>b__0>d.MoveNext() in D:\a\YoutubeDownloader\YoutubeDownloader\YoutubeDownloader\ViewModels\Components\DashboardViewModel.cs:line 100

Tyrrrz commented 2 months ago

Not sure, 403/401 errors are very hard to track down.

Tyrrrz commented 2 months ago

This issue is essentially a duplicate of #469 (also a 403 error), so closing for organizational purposes