[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
This commit is contained in:
Sam Heinz 2025-01-02 13:10:36 +10:00
parent 78daeeeaf3
commit 6afef14855

View file

@ -292,11 +292,19 @@ public class TorBoxTorrentClient(ILogger<TorBoxTorrentClient> 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;
}