Tyrrrz / YoutubeExplode

Abstraction layer over YouTube's internal API
MIT License
2.93k stars 491 forks source link

Empty response from GetVideoMediaStreamInfosAsync #335

Closed wesbyte closed 4 years ago

wesbyte commented 4 years ago

It seems there is something wrong, please try to get the response from Empty response from GetVideoMediaStreamInfosAsync and let me know if it's working with you. Thanks.

Tyrrrz commented 4 years ago

Is it not working for all videos or specific ones?

wesbyte commented 4 years ago

All videos.

Tyrrrz commented 4 years ago

Can't reproduce...

wesbyte commented 4 years ago

Does it work with you? Could you let me know the youtube URL that you tried?

Tyrrrz commented 4 years ago

All tests passed locally.

https://github.com/Tyrrrz/YoutubeExplode/blob/8ad5cee1eb90a5f553e515245d260b68d57b4aa5/YoutubeExplode.Tests/TestData.cs#L70-L77

wesbyte commented 4 years ago

It seems to work now, thanks.

Krutonium commented 4 years ago

I can't get any info from any videos right now with this code

var id = YoutubeClient.ParseVideoId(url);
var yt = new YoutubeClient();
var video = yt.GetVideoAsync(id).Result;
return video.Title;

It errors on the GetVideoAsync line. The error is

Could not load type 'LtGt.Models.HtmlDocument' from assembly 'LtGt, Version=2.1.0.0, Culture=neutral, PublicKeyToken=null'.
Tyrrrz commented 4 years ago

Don't update LtGt to 2.x, keep it at 1.x @Krutonium

Krutonium commented 4 years ago

Roger

Yep that fixed it

Headhuntez commented 4 years ago

Tyrrrz, метод получения потоков начал возвращать только один в 360п. image из 15 видео 4 не поддаются BENGR - Flyest Shit (Official Audio) | https://www.youtube.com/watch?v=NuKjTcR7C5U Kruelty - Another Kill (Official Visualiser) | https://www.youtube.com/watch?v=ZQApP4k2quM Symphonicz & Nexone - Break Me [FUSION411] | https://www.youtube.com/watch?v=IB2It308_Ps [TR013] Attract - Rhythm of the Heart | https://www.youtube.com/watch?v=u21g0N6a8sY

Headhuntez commented 4 years ago

GetVideoMediaStreamInfosAsync вернул нал потому что я пытался получить поток видео в статусе премьеры (еще не вышло). Решил пока так: if (video.Duration.TotalSeconds < 1) { Console.WriteLine("-x-Длительность видео нулевая! (Это премьера?)"); continue; } var mediaStreamInfoSet = client.GetVideoMediaStreamInfosAsync(id).Result;

Jabroni commented 4 years ago

I guess my issue is more similar to what is commented on this report.

var client = new YoutubeClient(); var streamInfoSet = await client.GetVideoMediaStreamInfosAsync("bnsUkE8i0tU"); var streamInfo = streamInfoSet.Muxed.WithHighestVideoQuality();

This is what im running, and streamInfoSet returns empty streams.

Ive double checked my dependencies and from what ive pinpointed were CliWrap (2.3.1) LtGt (1.0.3) Netwonsoft.Json (12.0.3) Sprache (2.2.0) YoutubeExplode (4.7.13)

I tried removing/installing the packages from my project, clean/rebuild, and its not working. On an empty C# Windows App works, however it stopped working on my ASP.NET project. Not sure if some other dependency could break the YoutubeExplode functionallity?

Tyrrrz commented 4 years ago

@Jabroni it seems pretty random. I was able to get all the media streams on that video but I know sometimes it doesn't work. I'm not sure why, could be YouTube's way of handling reverse-engineering. I'm yet to find a way to consistently reproduce this, so any help is welcome.

Jabroni commented 4 years ago

@Tyrrrz seems i was able to figure out what was wrong. My solution had 2 projects (frontend,backend) for some reason the frontend had a reference/copy of an old version [.10] of the Package (even thou nuget showed that it didnt even had the YoutubeExplode Package), and the backend did had the corrrect latest one [.13]. And when I tried to execute the youtube related classes the latest version was superseeded by the old version that was loaded from the frontend which made it return no streams found when querying a videoid

wesbyte commented 4 years ago

@Tyrrrz I updated my project with your latest NeGut, it doesn't seem to work with all the videos.

Tyrrrz commented 4 years ago

@wesbyte "doesn't seem to work with all the videos" means that no videos work or that some videos don't work? Can you give IDs?

wesbyte commented 4 years ago

@Tyrrrz All the videos: https://www.youtube.com/watch?v=4uE-tqe0xsQ https://www.youtube.com/watch?v=otlR05QZRrU https://www.youtube.com/watch?v=cm3fDQ4YFDw

Tyrrrz commented 4 years ago

Works for me. image

wesbyte commented 4 years ago

@Tyrrrz I got this error Type 'MediaStreamInfoSet' is not defined.

Tyrrrz commented 4 years ago

Yes, it's changed. Look at readme for the updated API.

Tyrrrz commented 4 years ago

Closing due to release of the new version which likely fixed it. if the issue persists, report it in #333.