[CHANGE] Working on auth hash
This commit is contained in:
@@ -10,7 +10,7 @@ public sealed class YouTubeClient : IDisposable
|
||||
public string? UserAgent { get; set; }
|
||||
public CookieContainer CookieContainer { get; } = new();
|
||||
public ClientState? ClientState { get; private set; }
|
||||
public Cookie? SapisidCookie => CookieContainer.GetAllCookies()["SAPISID"];
|
||||
public Cookie? SapisidCookie => CookieContainer.GetAllCookies()["SAPISID"] ?? CookieContainer.GetAllCookies()["__Secure-3PAPISID"];
|
||||
public HttpClient? GetHttpClient() => _httpClient;
|
||||
|
||||
private HttpClient? _httpClient;
|
||||
@@ -35,13 +35,17 @@ public sealed class YouTubeClient : IDisposable
|
||||
|
||||
public async Task GetStateAsync()
|
||||
{
|
||||
var state = await NetworkService.GetClientStateAsync(this);
|
||||
if (!state.IsSuccess)
|
||||
if (ClientState == null || !ClientState.LoggedIn)
|
||||
{
|
||||
return;
|
||||
var state = await NetworkService.GetClientStateAsync(this);
|
||||
if (!state.IsSuccess)
|
||||
{
|
||||
return;
|
||||
}
|
||||
ClientState = state.Value;
|
||||
}
|
||||
|
||||
ClientState = state.Value;
|
||||
var accountInfo = await NetworkService.GetCurrentAccountInfoAsync(this);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
|
Reference in New Issue
Block a user