mirror of
https://git.luna-app.eu/50n50/sources
synced 2025-12-21 21:26:19 +01:00
Update torrentio/torrentio.js
This commit is contained in:
parent
0fba01bbac
commit
ee06888288
1 changed files with 14 additions and 4 deletions
|
|
@ -99,15 +99,25 @@ async function extractEpisodes(ID) {
|
||||||
let episodeCounter = 0;
|
let episodeCounter = 0;
|
||||||
|
|
||||||
for (const video of videos) {
|
for (const video of videos) {
|
||||||
if (video.season !== currentSeason) {
|
const adjustedSeason = video.season + 1;
|
||||||
currentSeason = video.season;
|
if (adjustedSeason !== currentSeason) {
|
||||||
|
currentSeason = adjustedSeason;
|
||||||
episodeCounter = 0;
|
episodeCounter = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
episodeCounter++;
|
episodeCounter++;
|
||||||
|
|
||||||
|
let adjustedId = video.id || "";
|
||||||
|
if (adjustedId) {
|
||||||
|
const idParts = adjustedId.split(':');
|
||||||
|
if (idParts.length === 3) {
|
||||||
|
idParts[1] = String(adjustedSeason);
|
||||||
|
adjustedId = idParts.join(':');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
results.push({
|
results.push({
|
||||||
href: "TV: " + (video.id || ""),
|
href: "TV: " + adjustedId,
|
||||||
number: episodeCounter
|
number: episodeCounter
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -147,7 +157,7 @@ async function extractStreamUrl(ID) {
|
||||||
|
|
||||||
const response = await fetchv2(endpoint);
|
const response = await fetchv2(endpoint);
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
|
console.log(JSON.stringify(data));
|
||||||
if (!data.streams || !Array.isArray(data.streams)) {
|
if (!data.streams || !Array.isArray(data.streams)) {
|
||||||
return JSON.stringify({
|
return JSON.stringify({
|
||||||
streams: [],
|
streams: [],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue