mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 04:22:04 -04:00
Parse it from Set-Cookie because honestly fuck it
This commit is contained in:
@@ -185,10 +185,10 @@ public class KiwiFlare(string kfDomain, string? proxy = null, CancellationToken?
|
||||
}
|
||||
|
||||
_logger.Debug($"Set-Cookie header -> {JsonSerializer.Serialize(response.Headers.GetValues("Set-Cookie"))}");
|
||||
var cookies = container.GetAllCookies();
|
||||
_logger.Debug("JSON serialization of all the cookies");
|
||||
_logger.Debug(JsonSerializer.Serialize(cookies));
|
||||
return cookies["ttrs_clearance"]?.Value ?? throw new InvalidOperationException();
|
||||
var header = response.Headers.GetValues("Set-Cookie").First();
|
||||
var token = $"{header.Split("ttrs_clearance=")[1].Split("; ")[0]}";
|
||||
_logger.Debug($"Parsed token form the header: {token}");
|
||||
return token;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user