![]() |
VOOZH | about |
dotnet add package OnTube --version 1.0.0
NuGet\Install-Package OnTube -Version 1.0.0
<PackageReference Include="OnTube" Version="1.0.0" />
<PackageVersion Include="OnTube" Version="1.0.0" />Directory.Packages.props
<PackageReference Include="OnTube" />Project file
paket add OnTube --version 1.0.0
#r "nuget: OnTube, 1.0.0"
#:package OnTube@1.0.0
#addin nuget:?package=OnTube&version=1.0.0Install as a Cake Addin
#tool nuget:?package=OnTube&version=1.0.0Install as a Cake Tool
<p align="center"> <img src='Images/ontube.png' alt='Icon'> </p>
OnTube is a library that provides an interface to easily convert YouTube videos to audio files and download them with any resolution. Behind a layer of abstraction, this library works by scraping raw page data and exploiting reverse-engineered internal endpoints.
Extension packages:
You are free by using this project or its source code, for any purpose that will improve this package for future.
OnTube is available on NuGet. Install the provider package. See the in the docs for additional downloads.
dotnet add package OnTube
OnTube exposes its functionality through a single entry point — the OntubeAudioConverter class.
Create an instance of this class and use the provided operations on Videos and Audio properties to send requests.
To download the video from YouTube.
using OnTube;
var youtube = new OntubeAudioConverter();
// You can specify the video URL
var videoUrl = "https://www.youtube.com/watch?v=BcmUqwC_2Uc";
// You can specify the Folder path for example in D
var folderPath = @"D:\music";
//You can specify the file name as you like
var fileName = "song1";
//Finally, you can specify the resolution of video
int quality = 360;
var downloadedVideo = await youtube.DownloadVideoAsync(videoUrl, folderPath, fileName, quality);
//check if every thing is going well
if (downloadedVideo.IsSuccess != false)
{
Console.WriteLine($"Audio file saved at: {downloadedVideo.Data}");
}
else
{
Console.WriteLine($"{downloadedVideo.Message}");
}
Every YouTube video has a number of streams available, differing in containers, video quality, bitrate, framerate, and other parameters.
Warning: Muxed streams contain both audio and video, but these streams are limited in quality (up to 720p30). Some videos when you download them in a low quality you got a video without sound so, try to download with high quality.
To convert the YT video to audio.
using OnTube;
var youtube = new OntubeAudioConverter();
// You can specify the video URL
var videoUrl = "https://www.youtube.com/watch?v=BcmUqwC_2Uc";
// You can specify the Folder path for example in D
var folderPath = @"D:\music";
//You can specify the file name as you like
var fileName = "song1";
var convertedAudio = await youtube.ConvertToAudioAsync(videoUrl, folderPath, fileName);
//check if every thing is going well
if (convertedAudio.IsSuccess != false)
{
Console.WriteLine($"Audio file saved at: {convertedAudio.Data}");
}
else
{
Console.WriteLine($"{convertedAudio.Message}");
}
Once the audio is obtained, you can find it in the purposed folder with a format of type mp3.
In the end don't hesitate to share your ability in developing this packge.
Pull requests are welcome but before that please open an issue first to discuss what you want to change. please follow me for more C# blogs linkedin
This project is licensed under the MIT License.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 net6.0 is compatible. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 318 | 4/28/2024 |