25 lines
632 B
C#
25 lines
632 B
C#
using System.Net.Http;
|
|
using System.Net.Http.Headers;
|
|
using System.Reflection;
|
|
|
|
namespace YoutubeDownloader.Core.Utils;
|
|
|
|
public static class Http
|
|
{
|
|
public static HttpClient Client { get; } =
|
|
new()
|
|
{
|
|
DefaultRequestHeaders =
|
|
{
|
|
// Required by some of the services we're using
|
|
UserAgent =
|
|
{
|
|
new ProductInfoHeaderValue(
|
|
"YoutubeDownloader",
|
|
Assembly.GetExecutingAssembly().GetName().Version?.ToString(3)
|
|
),
|
|
},
|
|
},
|
|
};
|
|
}
|