private static async Task UpdateFileTrackerAsync(Torrent torrent, string newFilePath, string newSecureKey) { for (int i = 0; i < torrent.Trackers.Count; i++) { for (int j = 0; j < torrent.Trackers[i].Count; j++) { if (torrent.Trackers[i][j].Contains("tracker.dmhy.org") || torrent.Trackers[i][j].Contains("daydream.dmhy.best")) { torrent.Trackers[i][j] = $"https://daydream.dmhy.best/announce?secure={newSecureKey}"; } } } using (var stream = File.OpenWrite(newFilePath)) { await torrent.EncodeToAsync(stream); } }