Skip to content
This repository has been archived by the owner. It is now read-only.
master
Switch branches/tags
Go to file
Code

README.md

on nuget: https://www.nuget.org/packages/Famoser.YoutubeExtractor.Portable

This is a portable version of https://github.com/flagbug/YoutubeExtractor

I've simplified the API, though. Some examples:

Example code

Get the download URLs

// Our test youtube link
string link = "insert youtube link";

/*
 * Get the available video formats.
 * We'll work with them in the video and audio download examples.
 */
IEnumerable<VideoInfo> videoInfos = DownloadUrlResolver.GetDownloadUrls(link);

Download video

//construct downloader
var downloader = new VideoDownloader();

//download video infos
IEnumerable<VideoInfo> videoInfos = await DownloadUrlResolver.GetDownloadUrlsAsync("https://www.youtube.com/watch?v=vxMxYgkUcdU");

//Select best suited video (highest resolution)
VideoInfo video =  downloader.ChooseBest(videoInfos);
  
//If the video has a decrypted signature, decipher it
if (video.RequiresDecryption)
    await DownloadUrlResolver.DecryptDownloadUrl(video);

// Register the any events
downloader.VideoDownloadProgressChanged += (sender, args) => Console.WriteLine(args.ProgressPercentage);

//Execute the video downloader.
var stream = await downloader.Execute(video);

//save stream to file, the correct extension is saved in video.

Download audio

//construct downloader
var downloader = new AudioDownloader();

//download video infos
IEnumerable<VideoInfo> videoInfos = await DownloadUrlResolver.GetDownloadUrlsAsync("https://www.youtube.com/watch?v=vxMxYgkUcdU");

//Select best suited video (highest resolution)
VideoInfo video =  downloader.ChooseBest(videoInfos);
  
//If the video has a decrypted signature, decipher it
if (video.RequiresDecryption)
    await DownloadUrlResolver.DecryptDownloadUrl(video);

// Register the any events
downloader.AudioExtractionProgressChanged += (sender, args) => Console.WriteLine(args.ProgressPercentage);

//Execute the video downloader.
var stream = await downloader.Execute(video);

//save stream to file, the correct extension is saved in video.

About

a portable library which allow download of video informations, video & audio

Topics

Resources

License

Releases

No releases published

Packages

No packages published

Languages