YouTubeStreamDownloader.VideoMerger
1.1.0
dotnet add package YouTubeStreamDownloader.VideoMerger --version 1.1.0
NuGet\Install-Package YouTubeStreamDownloader.VideoMerger -Version 1.1.0
<PackageReference Include="YouTubeStreamDownloader.VideoMerger" Version="1.1.0" />
paket add YouTubeStreamDownloader.VideoMerger --version 1.1.0
#r "nuget: YouTubeStreamDownloader.VideoMerger, 1.1.0"
// Install YouTubeStreamDownloader.VideoMerger as a Cake Addin #addin nuget:?package=YouTubeStreamDownloader.VideoMerger&version=1.1.0 // Install YouTubeStreamDownloader.VideoMerger as a Cake Tool #tool nuget:?package=YouTubeStreamDownloader.VideoMerger&version=1.1.0
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)
- Xabe.FFmpeg (>= 6.0.0)
- Xabe.FFmpeg.Downloader (>= 6.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on YouTubeStreamDownloader.VideoMerger:
Package | Downloads |
---|---|
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 playlists and channel information using the YoutubeExplode library. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial release of YouTubeStreamDownloader.VideoMerger.