mirror of
https://github.com/BililiveRecorder/BililiveRecorder.git
synced 2024-11-16 11:42:22 +08:00
不输出“任务已取消”错误
This commit is contained in:
parent
ab89126199
commit
54fb2c2626
|
@ -19,7 +19,7 @@ namespace BililiveRecorder.Core
|
|||
|
||||
static BililiveAPI()
|
||||
{
|
||||
httpclient = new HttpClient { Timeout = TimeSpan.FromSeconds(5) };
|
||||
httpclient = new HttpClient { Timeout = TimeSpan.FromSeconds(10) };
|
||||
httpclient.DefaultRequestHeaders.Add("Accept", "application/json, text/javascript, */*; q=0.01");
|
||||
httpclient.DefaultRequestHeaders.Add("Referer", "https://live.bilibili.com/");
|
||||
httpclient.DefaultRequestHeaders.Add("User-Agent", Utils.UserAgent);
|
||||
|
@ -100,6 +100,10 @@ namespace BililiveRecorder.Core
|
|||
var j = JObject.Parse(s);
|
||||
return j;
|
||||
}
|
||||
catch (TaskCanceledException)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
finally
|
||||
{
|
||||
semaphoreSlim.Release();
|
||||
|
|
Loading…
Reference in New Issue
Block a user