mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 04:22:04 -04:00
HtmlAgilityPack interprets a string to Load() as a path apparently
This commit is contained in:
@@ -87,7 +87,7 @@ public class KfTokenService
|
|||||||
response.EnsureSuccessStatusCode();
|
response.EnsureSuccessStatusCode();
|
||||||
var content = await response.Content.ReadAsStringAsync(_ctx);
|
var content = await response.Content.ReadAsStringAsync(_ctx);
|
||||||
var document = new HtmlDocument();
|
var document = new HtmlDocument();
|
||||||
document.Load(content);
|
document.LoadHtml(content);
|
||||||
var challengeData = document.DocumentNode.SelectSingleNode("//html[@id=\"sssg\"]");
|
var challengeData = document.DocumentNode.SelectSingleNode("//html[@id=\"sssg\"]");
|
||||||
if (response.StatusCode == HttpStatusCode.NonAuthoritativeInformation && challengeData != null)
|
if (response.StatusCode == HttpStatusCode.NonAuthoritativeInformation && challengeData != null)
|
||||||
{
|
{
|
||||||
@@ -100,7 +100,7 @@ public class KfTokenService
|
|||||||
public async Task<bool> IsLoggedIn()
|
public async Task<bool> IsLoggedIn()
|
||||||
{
|
{
|
||||||
var document = new HtmlDocument();
|
var document = new HtmlDocument();
|
||||||
document.Load(await GetLoginPage());
|
document.LoadHtml(await GetLoginPage());
|
||||||
var html = document.DocumentNode.SelectSingleNode("//html");
|
var html = document.DocumentNode.SelectSingleNode("//html");
|
||||||
if (html == null) throw new Exception("Caught a null when retrieving html element");
|
if (html == null) throw new Exception("Caught a null when retrieving html element");
|
||||||
if (!html.Attributes.Contains("data-logged-in"))
|
if (!html.Attributes.Contains("data-logged-in"))
|
||||||
|
|||||||
Reference in New Issue
Block a user