[CHANGE] Remove anon accounts && added simple caching for urls
This commit is contained in:
@@ -6,7 +6,7 @@ namespace Manager.YouTube;
|
||||
public static class NetworkService
|
||||
{
|
||||
public const string Origin = "https://www.youtube.com";
|
||||
private static readonly HttpClient HttpClient = new HttpClient();
|
||||
private static readonly HttpClient HttpClient = new();
|
||||
|
||||
public static async Task<Result<string>> MakeRequestAsync(HttpRequestMessage request, YouTubeClient client, bool skipAuthenticationHeader = false)
|
||||
{
|
||||
@@ -43,7 +43,7 @@ public static class NetworkService
|
||||
return ResultError.Fail($"Failed to get file to download, response code: {response.StatusCode}.");
|
||||
}
|
||||
|
||||
var data = await response.Content.ReadAsByteArrayAsync();;
|
||||
var data = await response.Content.ReadAsByteArrayAsync();
|
||||
|
||||
return new DownloadResult(data, response.Content.Headers.ContentType?.MediaType, response.Content.Headers.ContentDisposition?.FileName?.Trim('"'), response.Content.Headers.ContentLength ?? 0);
|
||||
}
|
||||
|
Reference in New Issue
Block a user