Skip to content

Commit

Permalink
v231116
Browse files Browse the repository at this point in the history
1. qBittorrentBlockXunlei will wait for the response of the WebUI forever
  • Loading branch information
tonyhsie committed Nov 16, 2023
1 parent 3ebed5b commit 7eb65e3
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions qBittorrentBlockXunlei/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ static void CCEHandler(object sender, ConsoleCancelEventArgs args)

static async Task Main(string[] args)
{
Console.Title = "qBittorrentBlockXunlei v231103";
Console.Title = "qBittorrentBlockXunlei v231116";

Console.OutputEncoding = Encoding.UTF8;
Console.CancelKeyPress += new ConsoleCancelEventHandler(CCEHandler);
Expand All @@ -72,15 +72,18 @@ static async Task Main(string[] args)
StringBuilder sbBanPeers = new StringBuilder();

// 取得 WebAPI 版本
try
responseBody = "";
while (responseBody == "")
{
responseBody = await client.GetStringAsync(sBaseUrl + sApp_webapiVersion);
}
catch
{
Console.WriteLine("Can't connent to qBittorrent WebUI!");
Console.OutputEncoding = eOutput;
return;
try
{
responseBody = await client.GetStringAsync(sBaseUrl + sApp_webapiVersion);
}
catch
{
Console.WriteLine("Can't connent to qBittorrent WebUI, wait " + iLoopInterval + " sec. to reconnect!");
Thread.Sleep(iLoopInterval * 1000);
}
}

// WebAPI 版本需 >= 2.3
Expand Down

0 comments on commit 7eb65e3

Please sign in to comment.