-
-
Notifications
You must be signed in to change notification settings - Fork 490
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
Error: YoutubeExplode.Exceptions.VideoUnavailableException #808
Comments
@Tyrrrz what's the cause of the problem, and what's the solution ? |
same here. Locally works fine, but on azure server got VideoUnavailableException. Any ideas ? |
In my case this is happening when the page content doesn't contain of:URL meta tag. This happens most probably because the page is not accessible when banned from youtube but still there is json data in the content which might be used |
My assumption, this is a duplicate of: #794 I managed to reproduce this locally, and digging dipper in the library, GetVideoWatchPageAsync from VideoController throws an exception with the message: Sign in to confirm you’re not a bot (Would be useful if this message is thrown to the client) Key Takeaways:
Potential Solutions:
|
As I checked the source the library checks for meta tags to decide if the video is available or not but there is still json data in the response. Maybe using that json data instead of parsing HTML might be a better solution |
As @socaciumugurel said, this is a duplicate of #794. This check seems to work based on IP ranges and it does not depend on how many requests you've made or how often you've made them. If your code is executing on a public platform (e.g. a hosted cloud provider like Azure, AWS, GCP, etc.) then it's probably going to be instantly flagged as suspicious. The same thing is happening with this project's CI workflow runs: https://github.com/Tyrrrz/YoutubeExplode/actions/runs/10926592976. Immediate solutions are:
None of these are easy, but that's kind of the point. |
Version
v6.4.0
Platform
.NET 8 / windows 10
Steps to reproduce
My blazor app work fine in local machine, but when I deployed it on azure app service, I got this error below
Details
[2024-09-01T15:34:42.052Z] Error: YoutubeExplode.Exceptions.VideoUnavailableException: Video 'CZr3pKM44wk' is not available.
at YoutubeExplode.Videos.VideoController.GetVideoWatchPageAsync(VideoId videoId, CancellationToken cancellationToken) in //YoutubeExplode/Videos/VideoController.cs:line 39
at YoutubeExplode.Videos.VideoClient.GetAsync(VideoId videoId, CancellationToken cancellationToken) in //YoutubeExplode/Videos/VideoClient.cs:line 37
at YoutaBlazorWebApp.Application.YoutubeDownloader.GetYoutaQuality720pFileStream(String videoUrl) in C:\Users\clock\source\repos\YoutaBlazorWebApp\Application\YoutubeDownloader.cs:line 165
at YoutaBlazorWebApp.Components.Pages.Home.DownloadVideoFileQuality720p() in C:\Users\clock\source\repos\YoutaBlazorWebApp\Components\Pages\Home.razor:line 77
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
Checklist
The text was updated successfully, but these errors were encountered: