From 6afef148551680db0baabc52b366f569aee2d67d Mon Sep 17 00:00:00 2001 From: Sam Heinz <54530346+asylumexp@users.noreply.github.com> Date: Thu, 2 Jan 2025 13:10:36 +1000 Subject: [PATCH] [TB] Download via zip if file count is over 50 Due to rate limiting issues this is implemented again, it works now since TB reenabled HEAD method for zip downloads on their backend --- .../Services/TorrentClients/TorBoxTorrentClient.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/server/RdtClient.Service/Services/TorrentClients/TorBoxTorrentClient.cs b/server/RdtClient.Service/Services/TorrentClients/TorBoxTorrentClient.cs index 765e535..ad472f0 100644 --- a/server/RdtClient.Service/Services/TorrentClients/TorBoxTorrentClient.cs +++ b/server/RdtClient.Service/Services/TorrentClients/TorBoxTorrentClient.cs @@ -292,11 +292,19 @@ public class TorBoxTorrentClient(ILogger logger, IHttpClien var torrentId = await GetClient().Torrents.GetHashInfoAsync(torrent.Hash, skipCache: true); - foreach (var file in torrent.Files) + if (torrent.Files.Count >= 50) { - var newFile = $"https://torbox.app/fakedl/{torrentId?.Id}/{file.Id}"; + var newFile = $"https://torbox.app/fakedl/{torrentId?.Id}/zip"; files.Add(newFile); } + else + { + foreach (var file in torrent.Files) + { + var newFile = $"https://torbox.app/fakedl/{torrentId?.Id}/{file.Id}"; + files.Add(newFile); + } + } return files; }