diff --git a/torrentio/torrentio.js b/torrentio/torrentio.js index d40249f..adaa620 100644 --- a/torrentio/torrentio.js +++ b/torrentio/torrentio.js @@ -99,15 +99,25 @@ async function extractEpisodes(ID) { let episodeCounter = 0; for (const video of videos) { - if (video.season !== currentSeason) { - currentSeason = video.season; + const adjustedSeason = video.season + 1; + if (adjustedSeason !== currentSeason) { + currentSeason = adjustedSeason; episodeCounter = 0; } episodeCounter++; + let adjustedId = video.id || ""; + if (adjustedId) { + const idParts = adjustedId.split(':'); + if (idParts.length === 3) { + idParts[1] = String(adjustedSeason); + adjustedId = idParts.join(':'); + } + } + results.push({ - href: "TV: " + (video.id || ""), + href: "TV: " + adjustedId, number: episodeCounter }); } @@ -147,7 +157,7 @@ async function extractStreamUrl(ID) { const response = await fetchv2(endpoint); const data = await response.json(); - + console.log(JSON.stringify(data)); if (!data.streams || !Array.isArray(data.streams)) { return JSON.stringify({ streams: [],