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

YouTube removed get_video_info endpoint #565

Closed
Tyrrrz opened this issue Jun 18, 2021 · 1 comment
Closed

YouTube removed get_video_info endpoint #565

Tyrrrz opened this issue Jun 18, 2021 · 1 comment

Comments

@Tyrrrz
Copy link
Owner

Tyrrrz commented Jun 18, 2021

Version

6.0.2

Details

It finally happened 🙂

This now returns 404:

public async ValueTask<VideoInfoExtractor> GetVideoInfoAsync(
VideoId videoId,
string? signatureTimestamp,
CancellationToken cancellationToken = default)
{
var eurl = WebUtility.HtmlEncode($"https://youtube.googleapis.com/v/{videoId}");
var url =
"https://www.youtube.com/get_video_info" +
$"?video_id={videoId}" +
"&html5=1" +
"&el=embedded" +
$"&sts={signatureTimestamp}" +
$"&eurl={eurl}" +
"&hl=en";
var raw = await SendHttpRequestAsync(url, cancellationToken);
var videoInfo = VideoInfoExtractor.Create(raw);
if (!videoInfo.IsVideoAvailable())
{
throw new VideoUnavailableException($"Video '{videoId}' is not available.");
}
return videoInfo;
}

In my last investigations I think I saw that there's an endpoint on the new API that can retrieve player response directly, so that could be used as replacement. Not sure if it can still be used as fallback for age-restricted videos though.

Related tests are failing:

image

https://github.com/Tyrrrz/YoutubeExplode/actions/runs/948204086

Steps to reproduce

Run test: User can get a specific stream from a video(videoId: "SkRSXFQerZs")

@thisistorsten
Copy link

I have fixed it here https://github.com/snakx/YouTubeApiSharp

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

No branches or pull requests

2 participants