Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

403 (Forbidden) on any video #853

Open
4 of 6 tasks
worbarry opened this issue Dec 22, 2024 · 3 comments
Open
4 of 6 tasks

403 (Forbidden) on any video #853

worbarry opened this issue Dec 22, 2024 · 3 comments
Labels

Comments

@worbarry
Copy link

worbarry commented Dec 22, 2024

Version

6.5.0

Platform

.NET 8

Steps to reproduce


static class Program
    {
        static async Task Main(string[] args)
        {
            Console.WriteLine("Youtube VideoDownloader");
            Console.WriteLine("");
            Console.Write("Enter URL: ");
            var videoUrl = Console.ReadLine();

            if (videoUrl != null)
            {
                await Download(videoUrl);
            }
            
        }

        private static async Task Download(string videoUrl)
        {
            var youtube = new YoutubeClient();
            
            var video = await youtube.Videos.GetAsync(videoUrl);
            var streamManifest = await youtube.Videos.Streams.GetManifestAsync(videoUrl);

            var streamInfo = streamManifest
                .GetVideoOnlyStreams()
                .Where(s => s.Container == Container.Mp4)
                .GetWithHighestVideoQuality();
            IProgress<double> progress = new Progress<double>(p => Console.Write($"Progress updated: {p}"));
            await youtube.Videos.Streams.DownloadAsync(streamInfo, $"video.{streamInfo.Container}", progress);
            
        }
    }

Details

Download video file

result
Unhandled exception. System.Net.Http.HttpRequestException: Response status code does not indicate success: 403 (Forbidden).

Checklist

  • I have looked through existing issues to make sure that this bug has not been reported before
  • I have provided a descriptive title for this issue
  • I have made sure that this bug is reproducible on the latest version of the package
  • I have provided all the information needed to reproduce this bug as efficiently as possible
  • I have sponsored this project
  • I have not read any of the above and just checked all the boxes to submit the issue
@worbarry worbarry added the bug label Dec 22, 2024
@Tyrrrz
Copy link
Owner

Tyrrrz commented Dec 26, 2024

What video URL were you using?

@worbarry
Copy link
Author

worbarry commented Dec 26, 2024 via email

@dsimonubb
Copy link

I get now also the 403 Firbidden error when calling
var streamManifest = await youtube.Videos.Streams.GetManifestAsync(video.Id); on all the videos I try.
I use also version 6.5.0.
A few days ago it still worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants