Skip to content

Commit

Permalink
增加请求超时时间
Browse files Browse the repository at this point in the history
  • Loading branch information
91270 committed Jul 10, 2021
1 parent 309da94 commit 08c0071
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Emby.MeiamSub.DevTool/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ class Program
{
static void Main(string[] args)
{
Console.WriteLine(ComputeFileHash($"X:\\Favorites\\Movie\\八佰 (2020)\\八佰 (2020) 1080p TrueHD.mkv"));
//Console.WriteLine(ComputeFileHash($"D:\\Documents\\Downloads\\testidx.avi"));
//Console.WriteLine(ComputeFileHash($"X:\\Favorites\\Movie\\八佰 (2020)\\八佰 (2020) 1080p TrueHD.mkv"));
Console.WriteLine(ComputeFileHash($"D:\\Documents\\Downloads\\testidx.avi"));
Console.ReadKey();
}

Expand Down
8 changes: 6 additions & 2 deletions Emby.MeiamSub.Shooter/ShooterProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ private async Task<IEnumerable<RemoteSubtitleInfo>> SearchSubtitlesAsync(Subtitl

HttpRequestOptions options = new HttpRequestOptions
{
Url = $"http://shooter.cn/api/subapi.php",
Url = $"http://www.shooter.cn/api/subapi.php",
UserAgent = "Emby.MeiamSub.Shooter",
TimeoutMs = 30000,
AcceptHeader = "*/*",
};

Expand Down Expand Up @@ -179,7 +180,10 @@ private async Task<SubtitleResponse> DownloadSubAsync(string info)

var response = await _httpClient.GetResponse(new HttpRequestOptions
{
Url = downloadSub.Url
Url = downloadSub.Url,
UserAgent = "Emby.MeiamSub.Shooter",
TimeoutMs = 30000,
AcceptHeader = "*/*",
});

_logger.Debug($"MeiamSub.Shooter DownloadSub | Response -> { response.StatusCode }");
Expand Down
10 changes: 8 additions & 2 deletions Emby.MeiamSub.Thunder/ThunderProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ private async Task<IEnumerable<RemoteSubtitleInfo>> SearchSubtitlesAsync(Subtitl

var response = await _httpClient.GetResponse(new HttpRequestOptions
{
Url = $"http://sub.xmp.sandai.net:8000/subxl/{cid}.json"
Url = $"http://sub.xmp.sandai.net:8000/subxl/{cid}.json",
UserAgent = "Emby.MeiamSub.Thunder",
TimeoutMs = 30000,
AcceptHeader = "*/*",
});

_logger.Debug($"MeiamSub.Thunder Search | Response -> { _jsonSerializer.SerializeToString(response) }");
Expand Down Expand Up @@ -159,7 +162,10 @@ private async Task<SubtitleResponse> DownloadSubAsync(string info)

var response = await _httpClient.GetResponse(new HttpRequestOptions
{
Url = downloadSub.Url
Url = downloadSub.Url,
UserAgent = "Emby.MeiamSub.Thunder",
TimeoutMs = 30000,
AcceptHeader = "*/*",
});

_logger.Debug($"MeiamSub.Thunder DownloadSub | Response -> { response.StatusCode }");
Expand Down

0 comments on commit 08c0071

Please sign in to comment.