Skip to content

Package to access youtube video info such as video,audio url , fomarts,types e.t.c in dotnet (c#)

License

GPL-3.0, GPL-3.0 licenses found

Licenses found

GPL-3.0
LICENSE
GPL-3.0
LICENSE.md
Notifications You must be signed in to change notification settings

barakaally/dotnet-youtube-data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dotnet-youtube-data

Package help to retrieve Youtube video and audio Info in various format and their uls

Import YoutubeData namespace

using YoutubeData;

Create instance of Youtube class

Youtube youtube=new Youtube();;

Now use GetVideoInfo method to retrive video info,

There are two ways of using it :-

  1. asynchronous (async /await)
  2. sychronous
  3. callback function

How to use GetVideoInfo with async/await

method must be wrapped inside async Task

Response response=await youtube.GetVideoInfoAsync('videoId') 
       if(response){
         Console.Writeline(response.Data);
       }

How to use GetVideoInfo sychronous

Response response=youtube.GetVideoInfo('videoId') 
       if(response){
         Console.Writeline(response.Data);
       }

How to use GetVideoInfo with callback function

youtube.GetVideoInfo('videoId',(errors,data)=>{
   Console.Writeline(data);
}) 

Data object contain youtube videoInfo ,but the interesting part is video urls which can be found inside formarts(video+audio) and adaptiveFormats(video only or audio only) under streamingData of player_response

For uncipherd video

string videoUrl=response.data.player_response.streamingData.formats[0].url

For ciphered video

string videoUrl=response.data.player_response.streamingData.formats[0].signatureCipher.url&signature={deciphered signature}

About

Package to access youtube video info such as video,audio url , fomarts,types e.t.c in dotnet (c#)

Topics

Resources

License

GPL-3.0, GPL-3.0 licenses found

Licenses found

GPL-3.0
LICENSE
GPL-3.0
LICENSE.md

Stars

Watchers

Forks

Packages

No packages published

Languages