Skip to content

Commit

Permalink
v240428
Browse files Browse the repository at this point in the history
1. Default loop interval is changed from 30 sec. to 10 sec.
2. Ban the client "XunLei *"
3. Simplify program message
  • Loading branch information
tonyhsie committed Apr 28, 2024
1 parent d57b065 commit d2c0119
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions qBittorrentBlockXunlei/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ internal class Program

// 時間相關常數
static readonly int iPauseBeforeExitMs = 2000;
static double dLoopIntervalSeconds = 30;
static double dLoopIntervalSeconds = 20;

// 進度檢查單位 (bytes)
static readonly long lProgressCheckBoundarySize = 50 * 1024 * 1024;
Expand Down Expand Up @@ -47,7 +47,7 @@ internal class Program
static readonly string sTotalSizeFieldText = "\"total_size\":";
static readonly string sPieceSizeFieldText = "\"piece_size\":";

static readonly List<string> lsLeechClients = new List<string>() { "-XL", "Xunlei", "7.", "aria2", "Xfplay", "dandanplay", "FDM", "go.torrent", "Mozilla", "github.com/anacrolix/torrent (devel) (anacrolix/torrent unknown)", "dt/torrent/", "Taipei-Torrent dev", "trafficConsume", "hp/torrent/" };
static readonly List<string> lsLeechClients = new List<string>() { "-XL", "Xunlei", "XunLei", "7.", "aria2", "Xfplay", "dandanplay", "FDM", "go.torrent", "Mozilla", "github.com/anacrolix/torrent (devel) (anacrolix/torrent unknown)", "dt/torrent/", "Taipei-Torrent dev", "trafficConsume", "hp/torrent/" };
static readonly List<string> lsAncientClients = new List<string>() { "TorrentStorm", "Azureus 1.", "Azureus 2.", "Azureus 3.", "Deluge 0.", "Deluge 1.0", "Deluge 1.1", "qBittorrent 0.", "qBittorrent 1.", "qBittorrent 2.", "Transmission 0.", "Transmission 1." };

static void CCEHandler(object sender, ConsoleCancelEventArgs args)
Expand All @@ -61,7 +61,7 @@ static void CCEHandler(object sender, ConsoleCancelEventArgs args)

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

Console.OutputEncoding = Encoding.UTF8;
Console.CancelKeyPress += new ConsoleCancelEventHandler(CCEHandler);
Expand Down Expand Up @@ -432,7 +432,7 @@ static async Task Main(string[] args)

DateTime dtNow = DateTime.Now;
TimeSpan tsLoopCost = dtNow - dtStart;
Console.WriteLine(dtNow + ", torrent count(all/pt/bt): " + iTorrentCount + "/" + (iTorrentCount - iPublicTorrentCount) + "/" + iPublicTorrentCount + ", loop interval: " + dLoopIntervalSeconds + " sec., loop cost: " + tsLoopCost.TotalSeconds + " sec.");
Console.WriteLine(dtNow + ", all/pt/bt: " + iTorrentCount + "/" + (iTorrentCount - iPublicTorrentCount) + "/" + iPublicTorrentCount + ", interval: " + dLoopIntervalSeconds + " sec., cost: " + tsLoopCost.TotalSeconds + " sec.");

int iSleepMs = (int)Math.Round(dLoopIntervalMs - tsLoopCost.TotalMilliseconds);
if (iSleepMs > 0)
Expand Down

0 comments on commit d2c0119

Please sign in to comment.