From 9462048a29916853e692899cd0e35ee6f7b14861 Mon Sep 17 00:00:00 2001 From: barelyprofessional <150058423+barelyprofessional@users.noreply.github.com> Date: Tue, 22 Jul 2025 23:01:33 -0500 Subject: [PATCH] HtmlAgilityPack interprets a string to Load() as a path apparently --- KfChatDotNetBot/Services/KfTokenService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/KfChatDotNetBot/Services/KfTokenService.cs b/KfChatDotNetBot/Services/KfTokenService.cs index b619a10..9c24f33 100644 --- a/KfChatDotNetBot/Services/KfTokenService.cs +++ b/KfChatDotNetBot/Services/KfTokenService.cs @@ -87,7 +87,7 @@ public class KfTokenService response.EnsureSuccessStatusCode(); var content = await response.Content.ReadAsStringAsync(_ctx); var document = new HtmlDocument(); - document.Load(content); + document.LoadHtml(content); var challengeData = document.DocumentNode.SelectSingleNode("//html[@id=\"sssg\"]"); if (response.StatusCode == HttpStatusCode.NonAuthoritativeInformation && challengeData != null) { @@ -100,7 +100,7 @@ public class KfTokenService public async Task IsLoggedIn() { var document = new HtmlDocument(); - document.Load(await GetLoginPage()); + document.LoadHtml(await GetLoginPage()); var html = document.DocumentNode.SelectSingleNode("//html"); if (html == null) throw new Exception("Caught a null when retrieving html element"); if (!html.Attributes.Contains("data-logged-in"))