Skip to content
This repository has been archived by the owner on Aug 19, 2020. It is now read-only.

famoser/YoutubeExtractor.Portable

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

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

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages