mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 12:32:03 -04:00
Changed from stream to string as reusing the stream doesn't work
This commit is contained in:
@@ -78,14 +78,14 @@ public class KfTokenService
|
|||||||
throw new Exception("Failed to solve the challenge");
|
throw new Exception("Failed to solve the challenge");
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<Stream> GetLoginPage()
|
private async Task<string> GetLoginPage()
|
||||||
{
|
{
|
||||||
_logger.Debug("Checking clearance token is actually valid first");
|
_logger.Debug("Checking clearance token is actually valid first");
|
||||||
await CheckClearanceToken();
|
await CheckClearanceToken();
|
||||||
using var client = new HttpClient(GetHttpClientHandler());
|
using var client = new HttpClient(GetHttpClientHandler());
|
||||||
var response = await client.GetAsync($"https://{_kfDomain}/login", _ctx);
|
var response = await client.GetAsync($"https://{_kfDomain}/login", _ctx);
|
||||||
response.EnsureSuccessStatusCode();
|
response.EnsureSuccessStatusCode();
|
||||||
var content = await response.Content.ReadAsStreamAsync(_ctx);
|
var content = await response.Content.ReadAsStringAsync(_ctx);
|
||||||
var document = new HtmlDocument();
|
var document = new HtmlDocument();
|
||||||
document.Load(content);
|
document.Load(content);
|
||||||
var challengeData = document.DocumentNode.SelectSingleNode("//html[@id=\"sssg\"]");
|
var challengeData = document.DocumentNode.SelectSingleNode("//html[@id=\"sssg\"]");
|
||||||
|
|||||||
Reference in New Issue
Block a user