updated music
This commit is contained in:
18
YoutubeExtension/Others/YTVideo.cs
Normal file
18
YoutubeExtension/Others/YTVideo.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using MediaToolkit;
|
||||
using MediaToolkit.Model;
|
||||
using VideoLibrary;
|
||||
|
||||
namespace YoutubeExtension.Downloader;
|
||||
|
||||
public class YoutubeHandler
|
||||
{
|
||||
|
||||
public static async Task<Stream> GetVideoStream(string videoURL)
|
||||
{
|
||||
var youtube = YouTube.Default;
|
||||
var video = await youtube.GetVideoAsync(videoURL);
|
||||
|
||||
return await video.StreamAsync();
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user