YouTubeStreamDownloader 1.1.9
dotnet add package YouTubeStreamDownloader --version 1.1.9
NuGet\Install-Package YouTubeStreamDownloader -Version 1.1.9
<PackageReference Include="YouTubeStreamDownloader" Version="1.1.9" />
paket add YouTubeStreamDownloader --version 1.1.9
#r "nuget: YouTubeStreamDownloader, 1.1.9"
// Install YouTubeStreamDownloader as a Cake Addin #addin nuget:?package=YouTubeStreamDownloader&version=1.1.9 // Install YouTubeStreamDownloader as a Cake Tool #tool nuget:?package=YouTubeStreamDownloader&version=1.1.9
YouTubeStreamDownloader ๐ฌ
YouTubeStreamDownloader is a .NET 8 package that allows developers to interact with YouTube.
It provides functionality to retrieve video metadata, download videos, extract audio, get subtitles, and fetch playlist & channel details using the YoutubeExplode library.
๐ Features
โ
Retrieve Video Metadata (title, duration, author, etc.)
โ
Download YouTube Videos (highest quality available)
โ
Extract & Download Subtitles (SRT format)
โ
Fetch Playlists & Channel Videos
โ
Supports Dependency Injection (DI)
๐ฆ Installation
You can install YouTubeStreamDownloader via NuGet:
dotnet add package YouTubeStreamDownloader
OR via Package Manager:
Install-Package YouTubeStreamDownloader
๐ฅ Quick Start
1๏ธโฃ Retrieve Video Metadata
IYouTubeMetadataService downloader = new YouTubeMetadataService(new YoutubeClient());
var video = await downloader.GetVideoInfoAsync(TEST_VIDEO_URL);
Console.WriteLine($"Title: {video.Title}");
Console.WriteLine($"Duration: {video.Duration}");
Console.WriteLine($"Author: {video.Author}");
2๏ธโฃ Download YouTube Video
IYouTubeMetadataService downloader = new YouTubeMetadataService(new YoutubeClient());
var outputPath = "C:\\Videos";
string filePath = await downloader.DownloadVideoAsFileAsync(TEST_VIDEO_URL, outputPath);
Console.WriteLine($"Video downloaded successfully: {filePath}");
3๏ธโฃ Fetch All Playlists from a Channel
using Microsoft.Extensions.DependencyInjection;
using YouTubeStreamDownloader.Services;
var services = new ServiceCollection();
services.AddYouTubeMetadataService();
var provider = services.BuildServiceProvider();
var metadataService = provider.GetRequiredService<IYouTubeMetadataService>();
var playlists = await metadataService.GetAllPlaylistsAsync("https://www.youtube.com/@YourChannel");
foreach (var playlist in playlists)
{
Console.WriteLine($"{playlist.Title}: {playlist.Url}");
}
4๏ธโฃ Fetch All Videos from a Playlist
using Microsoft.Extensions.DependencyInjection;
using YouTubeStreamDownloader.Services;
var provider = new ServiceCollection()
.AddYouTubeMetadataService()
.BuildServiceProvider();
var metadataService = provider.GetRequiredService<IYouTubeMetadataService>();
var videos = await metadataService.GetAllVideosFromPlaylistAsync("https://www.youtube.com/playlist?list=YOUR_PLAYLIST_ID");
foreach (var video in videos)
{
Console.WriteLine($"{video.Title}: {video.Url}");
}
๐ Dependency Injection (DI)
To use YouTubeStreamDownloader in an ASP.NET Core or Console Application, register it in Program.cs
:
using Microsoft.Extensions.DependencyInjection;
using YouTubeStreamDownloader.Services;
var builder = WebApplication.CreateBuilder(args);
// Register the service
builder.Services.AddYouTubeMetadataService();
var app = builder.Build();
For Singleton DI:
builder.Services.AddYouTubeMetadataSingletonService();
๐งช Unit Testing
Unit tests use NSubstitute for mocking and FluentAssertions for validation.
Run all tests:
dotnet test
๐ก Roadmap
- Audio-only downloads
- Download progress tracking
- Convert video format (MP4, MP3)
- Multi-threaded downloads
- User authentication for private videos
- YouTube Live Stream support
๐ค Contributing
Want to contribute?
Follow these steps:
- Fork the repository.
- Clone your fork:
git clone https://github.com/your-username/YouTubeStreamDownloader.git
- Create a new branch:
git checkout -b feature/your-feature-name
- Make changes and commit:
git commit -m "Added new feature"
- Push to your fork:
git push origin feature/your-feature-name
- Create a Pull Request (PR).
๐ License
YouTubeStreamDownloader is licensed under the MIT License.
๐ Contact
๐ค Author: Shady Nagy
๐ง Email: info@ShadyNagy.com
๐ GitHub: ShadyNagy
๐ Website: https://shadynagy.com
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
-
net8.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0)
- YoutubeExplode (>= 6.5.3)
- YouTubeStreamDownloader.VideoMerger (>= 1.1.0)
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.1.9 | 31 | 2/19/2025 |
1.1.8 | 32 | 2/19/2025 |
1.1.7 | 31 | 2/19/2025 |
1.1.6 | 57 | 2/17/2025 |
1.1.5 | 59 | 2/17/2025 |
1.1.4 | 61 | 2/17/2025 |
1.1.3 | 59 | 2/17/2025 |
1.1.2 | 67 | 2/14/2025 |
1.1.1 | 74 | 2/14/2025 |
1.1.0 | 63 | 2/13/2025 |
1.0.8 | 66 | 2/13/2025 |
1.0.7 | 64 | 2/13/2025 |
1.0.6 | 62 | 2/13/2025 |
1.0.5 | 69 | 2/13/2025 |
1.0.4 | 71 | 2/12/2025 |
1.0.3 | 63 | 2/12/2025 |
1.0.2 | 65 | 2/12/2025 |
1.0.1 | 63 | 2/12/2025 |
1.0.0 | 75 | 2/12/2025 |
Initial release of YouTubeStreamDownloader.