I'm creating a application that will search for lyrics based on what you are listening on Spotify. For that I need to fetch the html from sites that provide lyrics (yeah, I know, not really compliant to their EULA, but it's for school/private use). The original function (see below) broke, so I decided to do some research on other ways, as it appeared to me to be the function not being able to use https. So after a 'quick' Google session I've found another function, but it still gives the same error when I try to access https://www.musixmatch.com
(or another url on that domain): System.Net.WebException occurred The request was aborted: Could not create SSL/TLS secure channel.
But; when I use https://www.google.com
or https://stackoverflow.com
both functions work just fine. What is different to those sites in comparison to Musixmatch? Am I missing what the SSL/TLS secure channel
exactly is? The things I find on Google tell me that it has to do with the SSL (how I found the new function), but given that it functions correctly with other SSL pages, I guess that there has to be something else. I am using HTMLAgilityPack, not sure if that makes a difference.
Original function
As the source variable one can for example use https://www.musixmatch.com/lyrics/Hundredth/Restless
public string retrieveLyrics()
{
retrieveSource(true);
var htmlWeb = new HtmlWeb();
var documentNode = htmlWeb.Load(source).DocumentNode;
var findclasses = documentNode
.Descendants("p")
.Where(d => d.Attributes["class"]?.Value.Contains("mxm-lyrics__content") == true);
var text = string.Join(Environment.NewLine, findclasses.Select(x => x.InnerText));
return text;
}
To repeat the question: Why does the function work when using a site like https://www.google.com
, but not on https://www.musixmatch.com
?