[CHANGE] BackgroundServices
This commit is contained in:
@@ -20,7 +20,7 @@ public sealed class YouTubeClient : IDisposable
|
||||
public List<string> DatasyncIds { get; } = [];
|
||||
public Cookie? SapisidCookie => CookieContainer.GetAllCookies()["SAPISID"];
|
||||
public HttpClient HttpClient { get; }
|
||||
|
||||
|
||||
private YouTubeClient(CookieCollection cookies, string userAgent)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(userAgent))
|
||||
@@ -38,6 +38,12 @@ public sealed class YouTubeClient : IDisposable
|
||||
HttpClient = new HttpClient(GetHttpClientHandler());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Loads the given cookies and fetch client state.
|
||||
/// </summary>
|
||||
/// <param name="cookies">The cookies to use for making requests. Empty collection for anonymous requests.</param>
|
||||
/// <param name="userAgent">The user agent to use for the requests. Only WEB client is supported.</param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Result<YouTubeClient>> CreateAsync(CookieCollection cookies, string userAgent)
|
||||
{
|
||||
var client = new YouTubeClient(cookies, userAgent);
|
||||
|
Reference in New Issue
Block a user