omansak / libvideo

A lightweight .NET library to download YouTube videos.
BSD 2-Clause "Simplified" License
553 stars 163 forks source link

Cannot collect all resolutions, ... #198

Closed AndreZila01 closed 3 years ago

AndreZila01 commented 3 years ago

Hey programmers,

i have one problem of to collect all resoltion of video, i use this source:

link = "https://youtu.be/IYcwcv5chH4"//exemple link video, ...
var videoInfos = await cli.GetAllVideosAsync(link);
var resolutions = videoInfos.Where(j => j.AdaptiveKind == AdaptiveKind.Video).Select(j => j.Resolution);

And collect Null, ...

image

if you have a solution, please help me.

omansak commented 3 years ago

image

this is valid code for me.

  var cli = Client.For(YouTube.Default);
  var link = "https://youtu.be/IYcwcv5chH4";
  var videoInfos = cli.GetAllVideosAsync(link).GetAwaiter().GetResult();
  var resolutions = videoInfos.Where(j => j.AdaptiveKind == AdaptiveKind.Video).Select(j => j.Resolution);
  var foo = string.Join(",", resolutions);
AndreZila01 commented 3 years ago

One question omanask how i can collect 60fps in video, "1080p60".

omansak commented 3 years ago

One question omanask how i can collect 60fps in video, "1080p60".

you can use FPS property in 3.1.2