From 79fc6584d7a8f6833eef1835398fb5d8f3be1b9a Mon Sep 17 00:00:00 2001 From: AnimeDL Date: Thu, 11 Apr 2024 08:29:48 -0700 Subject: [PATCH] Make sure segments are only generated if none exist Makes sure that it only generates byterange segments for the mpd if there are non already present. --- modules/module.transform-mpd.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/module.transform-mpd.ts b/modules/module.transform-mpd.ts index 11d6a55..ab00cd9 100644 --- a/modules/module.transform-mpd.ts +++ b/modules/module.transform-mpd.ts @@ -61,7 +61,7 @@ export async function parse(manifest: string, language?: LanguageItem, url?: str ret[host] = { audio: [], video: [] }; - if (playlist.sidx) { + if (playlist.sidx && playlist.segments.length == 0) { const item = await fetch(playlist.sidx.uri, { 'method': 'head' }); @@ -130,7 +130,7 @@ export async function parse(manifest: string, language?: LanguageItem, url?: str if (!Object.prototype.hasOwnProperty.call(ret, host)) ret[host] = { audio: [], video: [] }; - if (playlist.sidx) { + if (playlist.sidx && playlist.segments.length == 0) { const item = await fetch(playlist.sidx.uri, { 'method': 'head' });