From e3f1855a97c875f014db9f69ae58987f2e9aede8 Mon Sep 17 00:00:00 2001 From: TheBeastLT Date: Wed, 25 Dec 2024 08:39:09 +0200 Subject: [PATCH] fix playing TB cloud files due to link cacheing, close #328 --- addon/moch/torbox.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addon/moch/torbox.js b/addon/moch/torbox.js index 83c9181..e4976fe 100644 --- a/addon/moch/torbox.js +++ b/addon/moch/torbox.js @@ -62,7 +62,7 @@ export async function getItemMeta(itemId, apiKey) { id: `${KEY}:${itemId}:${file.id}`, title: file.name, released: new Date(createDate.getTime() - index).toISOString(), - streams: [{ url: `${apiKey}/null/${itemId}-${file.id}/null` }] + streams: [{ url: `${apiKey}/${itemId}-${file.id}/null/null` }] })) } } @@ -88,8 +88,8 @@ export async function resolve({ ip, apiKey, infoHash, cachedEntryInfo, fileIndex } async function _resolve(apiKey, infoHash, cachedEntryInfo, fileIndex, ip) { - if (infoHash === 'null') { - const [type, rootId, fileId] = cachedEntryInfo.split('-'); + if (infoHash?.includes('-')) { + const [type, rootId, fileId] = infoHash.split('-'); return getDownloadLink(apiKey, type, rootId, fileId, ip); } const torrent = await _createOrFindTorrent(apiKey, infoHash);