i want to just convert youtube links to MP3 file in asp.net.I have research about that and do the code but the code gives exception like below:
The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. how to resolve that
protected void Button1_Click(object sender, EventArgs e)
{
try
{
string url = TextBox1.Text;
var source = @"C:\Users\Dipak";
var youtube = YouTube.Default;
var vid = youtube.GetVideo(url);
File.WriteAllBytes(source + vid.FullName, vid.GetBytes());
var inputFile = new MediaFile { Filename = source + vid.FullName };
var outputFile = new MediaFile { Filename = $"{source + vid.FullName}.mp3" };
using (var engine = new Engine())
{
engine.GetMetadata(inputFile);
engine.Convert(inputFile, outputFile);
}
}
catch (Exception exception)
{
}
}
I have found this types of code in Stack overflow but won't work