Update for TorBoxNET v1.0.0.42 changes
This commit is contained in:
parent
0987b1f18c
commit
6bac21b426
1 changed files with 5 additions and 5 deletions
|
|
@ -30,7 +30,7 @@ public class TorBoxTorrentClient(ILogger<TorBoxTorrentClient> logger, IHttpClien
|
||||||
// Get the server time to fix up the timezones on results
|
// Get the server time to fix up the timezones on results
|
||||||
if (_offset == null)
|
if (_offset == null)
|
||||||
{
|
{
|
||||||
var serverTime = rdtNetClient.Api.GetIsoTimeAsync();
|
var serverTime = DateTimeOffset.UtcNow;
|
||||||
_offset = serverTime.Offset;
|
_offset = serverTime.Offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -127,7 +127,7 @@ public class TorBoxTorrentClient(ILogger<TorBoxTorrentClient> logger, IHttpClien
|
||||||
if (result.Error == "ACTIVE_LIMIT")
|
if (result.Error == "ACTIVE_LIMIT")
|
||||||
{
|
{
|
||||||
var magnetLinkInfo = MonoTorrent.MagnetLink.Parse(magnetLink);
|
var magnetLinkInfo = MonoTorrent.MagnetLink.Parse(magnetLink);
|
||||||
return magnetLinkInfo.InfoHash.ToHex().ToLowerInvariant();
|
return magnetLinkInfo.InfoHashes.V1!.ToHex().ToLowerInvariant();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -145,7 +145,7 @@ public class TorBoxTorrentClient(ILogger<TorBoxTorrentClient> logger, IHttpClien
|
||||||
using (var stream = new MemoryStream(bytes))
|
using (var stream = new MemoryStream(bytes))
|
||||||
{
|
{
|
||||||
var torrent = MonoTorrent.Torrent.Load(stream);
|
var torrent = MonoTorrent.Torrent.Load(stream);
|
||||||
return torrent!.InfoHash.ToHex()!.ToLowerInvariant();
|
return torrent!.InfoHashes.V1!.ToHex().ToLowerInvariant();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -197,7 +197,7 @@ public class TorBoxTorrentClient(ILogger<TorBoxTorrentClient> logger, IHttpClien
|
||||||
bool zipped = segments[5] == "zip";
|
bool zipped = segments[5] == "zip";
|
||||||
string fileId = zipped ? "0" : segments[5];
|
string fileId = zipped ? "0" : segments[5];
|
||||||
|
|
||||||
var result = await GetClient().Unrestrict.LinkAsync(torrentID: segments[4], fileID: fileId, zipped: zipped);
|
var result = await GetClient().Torrents.RequestDownloadAsync(Convert.ToInt32(segments[4]), Convert.ToInt32(fileId), zipped);
|
||||||
|
|
||||||
if (result?.Error != null)
|
if (result?.Error != null)
|
||||||
{
|
{
|
||||||
|
|
@ -302,7 +302,7 @@ public class TorBoxTorrentClient(ILogger<TorBoxTorrentClient> logger, IHttpClien
|
||||||
var files = new List<String>();
|
var files = new List<String>();
|
||||||
|
|
||||||
var torrentId = await GetClient().Torrents.GetInfoAsync(torrent.Hash, skipCache: true);
|
var torrentId = await GetClient().Torrents.GetInfoAsync(torrent.Hash, skipCache: true);
|
||||||
if (Settings.Get.Provider.Zipped == true && rdTorrent.Files!.Count() > 100 && torrentId!.AllowZipped == true)
|
if (Settings.Get.Provider.Zipped == true)
|
||||||
{
|
{
|
||||||
var newFile = $"https://torbox.app/fakedl/{torrentId?.Id}/zip";
|
var newFile = $"https://torbox.app/fakedl/{torrentId?.Id}/zip";
|
||||||
files.Add(newFile);
|
files.Add(newFile);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue