fix(core): unify user-agent

fix #544
This commit is contained in:
genteure 2023-11-05 17:58:41 +08:00
parent d576b448a0
commit b85988861e
2 changed files with 4 additions and 4 deletions

View File

@ -18,7 +18,7 @@ namespace BililiveRecorder.Core.Api.Http
internal const string HttpHeaderAcceptLanguage = "zh-CN";
internal const string HttpHeaderReferer = "https://live.bilibili.com/";
internal const string HttpHeaderOrigin = "https://live.bilibili.com";
internal const string HttpHeaderUserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36";
internal const string HttpHeaderUserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36";
private static readonly Regex matchCookieUidRegex = new Regex(@"DedeUserID=(\d+?);", RegexOptions.Compiled);
private static readonly Regex matchCookieBuvid3Regex = new Regex(@"buvid3=(.+?);", RegexOptions.Compiled);
private long uid;

View File

@ -21,9 +21,9 @@ namespace BililiveRecorder.Core.Recording
internal abstract class RecordTaskBase : IRecordTask
{
private const string HttpHeaderAccept = "*/*";
private const string HttpHeaderOrigin = "https://live.bilibili.com";
private const string HttpHeaderReferer = "https://live.bilibili.com/";
private const string HttpHeaderUserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36";
private const string HttpHeaderOrigin = Api.Http.HttpApiClient.HttpHeaderOrigin;
private const string HttpHeaderReferer = Api.Http.HttpApiClient.HttpHeaderReferer;
private const string HttpHeaderUserAgent = Api.Http.HttpApiClient.HttpHeaderUserAgent;
private const int timer_inverval = 2;
protected readonly Timer timer = new Timer(1000 * timer_inverval);