Update gojowtf/gojowtf.js
Fetch and Save Remote Content / fetch (push) Has been cancelled

This commit is contained in:
aka paul
2026-04-23 14:26:02 +00:00
parent 904a711918
commit 7d4e12986b
+24 -4
View File
@@ -98,13 +98,33 @@ async function extractStreamUrl(slug) {
const data = await res.json(); const data = await res.json();
if (data?.sources?.length) { if (data?.sources?.length) {
data.sources.forEach(source => { for (const source of data.sources) {
let streamUrl = `https://mega-cloud.top/proxy${source.url}`;
let quality = source.quality;
if (server.id === 'kite') {
try {
const m3u8Res = await fetchv2(streamUrl, headers);
const m3u8Content = await m3u8Res.text();
const lines = m3u8Content.split('\n').filter(line => line.trim() !== '');
const targetLine = lines.find(line => !line.startsWith('#'));
if (targetLine) {
streamUrl = `https://mega-cloud.top/proxy/oppai/kite/${targetLine.trim()}`;
}
if (quality.toLowerCase() === 'master') {
quality = '1080p';
}
} catch (e) {
console.error("Error rewriting kite URL:", e);
}
}
streams.push({ streams.push({
title: `${server.id} - ${source.quality} - ${subType.toUpperCase()}`, title: `${server.id} - ${quality} - ${subType.toUpperCase()}`,
streamUrl: `https://mega-cloud.top/proxy${source.url}`, streamUrl: streamUrl,
headers: headers headers: headers
}); });
}); }
} }
} catch (e) { } catch (e) {
console.error(`Error fetching streams for server ${server.id} (${subType}):`, e); console.error(`Error fetching streams for server ${server.id} (${subType}):`, e);