YoutubeSnoop 1.2.0

dotnet add package YoutubeSnoop --version 1.2.0
NuGet\Install-Package YoutubeSnoop -Version 1.2.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="YoutubeSnoop" Version="1.2.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add YoutubeSnoop --version 1.2.0
#r "nuget: YoutubeSnoop, 1.2.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install YoutubeSnoop as a Cake Addin
#addin nuget:?package=YoutubeSnoop&version=1.2.0

// Install YoutubeSnoop as a Cake Tool
#tool nuget:?package=YoutubeSnoop&version=1.2.0

YoutubeSnoop

Lightweight .NET library to pull data from YouTube. It deals only with list request and only those that don't need authentication. Supports lazy loading paginated results. It has three layers of abstraction and three different ways of using the api.

The easy way:

using System;
using System.Linq;
using YoutubeSnoop;
using YoutubeSnoop.Fluent;

...

var video = Youtube.Video("some video id").RequestAllParts(); // receive all info about a specific Video
Console.WriteLine(video.Title);

var comments = video.Comments(); // get comments under a vid
var related = video.RelatedVideos();

var search = Youtube.Search("my first search query").PublishedBefore(DateTime.Now).OrderByRelevance().Take(20).ToList();

var channel = Youtube.Channel().ForUsername("some YouTube username");
var channelUploads = channel.Uploads().TakePage().ToList();
var channelSearch = channel.Search("find some stuff").ToList();

The intermediate way:

using System;
using System.Linq;
using YoutubeSnoop;
using YoutubeSnoop.Api;
using YoutubeSnoop.Enums;

...

var videoSettings = new VideoSettings { Id = "some video id" };
var video = new YoutubeVideo(videoSettings, new[] { PartType.Snippet, PartType.ContentDetails });
Console.WriteLine(video.Title);

var commentThreadSettings = new CommentThreadSettings { VideoId = video.Id };
var comments = new YoutubeCommentThreads(commentThreadSettings);

var searchSettings = new SearchSettings { RelatedToVideoId = video.Id };
var related = new YoutubeSearch(searchSettings);

var searchSettings2 = new SearchSettings { Query = "my first search query", PublishedBefore = DateTime.Now, Order = SearchOrder.Relevance };
var search = new YoutubeSearch(searchSettings2).Take(20).ToList();


var channelSettings = new ChannelSettings { ForUsername = "some YouTube username" };
var channel = new YoutubeChannel(channelSettings, new[] { PartType.Snippet, PartType.ContentDetails });

var playlistItemSettings = new PlaylistItemSettings { PlaylistId = channel.UploadsPlaylistId };
var channelUploads = new YoutubePlaylistItems(playlistItemSettings);

var searchSettings3 = new SearchSettings { Query = "find some stuff", ChannelId = channel.Id };
var channelSearch = new YoutubeSearch(searchSettings3).ToList();

The hard way:

    var videoSettings = new VideoSettings { Id = "some video id" };
var video = Request.Create(videoSettings, new[] { PartType.Snippet, PartType.ContentDetails });
Console.WriteLine(video.FirstItem.Snippet.Title);

var commentThreadSettings = new CommentThreadSettings { VideoId = video.FirstItem.Id };
var comments = Request.Create(commentThreadSettings);

var searchSettings = new SearchSettings { RelatedToVideoId = video.FirstItem.Id };
var related = Request.Create(searchSettings);

var searchSettings2 = new SearchSettings { Query = "my first search query", PublishedBefore = DateTime.Now, Order = SearchOrder.Relevance };
var search = Request.Create(searchSettings2).First().Items.ToList();

var channelSettings = new ChannelSettings { ForUsername = "some YouTube username" };
var channel = Request.Create(channelSettings, new[] { PartType.Snippet, PartType.ContentDetails });

var playlistItemSettings = new PlaylistItemSettings { PlaylistId = channel.FirstItem.ContentDetails.RelatedPlaylists?.Uploads };
var channelUploads = Request.Create(playlistItemSettings);

var searchSettings3 = new SearchSettings { Query = "find some stuff", ChannelId = channel.FirstItem.Id };
var channelSearch = Request.Create(searchSettings3).First().Items.ToList();
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.2.0 1,761 4/21/2018
1.1.0 1,410 3/3/2018
1.0.0 1,398 2/24/2018