优化下载

This commit is contained in:
nilaoda 2023-04-12 18:04:13 +08:00
parent e26ca8bf42
commit f873cbc2dd
1 changed files with 5 additions and 2 deletions

View File

@ -11,12 +11,15 @@ namespace N_m3u8DL_RE.Common.Util
{ {
AllowAutoRedirect = false, AllowAutoRedirect = false,
AutomaticDecompression = DecompressionMethods.All, AutomaticDecompression = DecompressionMethods.All,
ServerCertificateCustomValidationCallback = (sender, cert, chain, sslPolicyErrors) => true ServerCertificateCustomValidationCallback = (sender, cert, chain, sslPolicyErrors) => true,
MaxConnectionsPerServer = 1024,
}; };
public static readonly HttpClient AppHttpClient = new(HttpClientHandler) public static readonly HttpClient AppHttpClient = new(HttpClientHandler)
{ {
Timeout = TimeSpan.FromSeconds(100) Timeout = TimeSpan.FromSeconds(100),
DefaultRequestVersion = HttpVersion.Version20,
DefaultVersionPolicy = HttpVersionPolicy.RequestVersionOrHigher,
}; };
private static async Task<HttpResponseMessage> DoGetAsync(string url, Dictionary<string, string>? headers = null) private static async Task<HttpResponseMessage> DoGetAsync(string url, Dictionary<string, string>? headers = null)