Update Kokoshka.ts

There are some old dodo domains like d-s.io which fail to load the stream, so instead after fetching the link I replaced it with working domain like dsvplay.com
This commit is contained in:
GSTAR 2025-10-15 18:40:33 +02:00 committed by WebStreamr
parent bab7c80361
commit e126970047
No known key found for this signature in database

View file

@ -79,9 +79,15 @@ export class Kokoshka extends Source {
if (json.embed_url) urls.push(json.embed_url);
if (Array.isArray(json.sources)) urls.push(...json.sources.map((s: any) => s.file));
for (const embed of urls) {
const cleaned = embed.replace(/\\/g, '').replace(/^http:/, 'https:');
const url = new URL(cleaned);
for (let embed of urls) {
embed = embed.replace(/\\/g, '').replace(/^http:/, 'https:');
// --- Replace Dodo domain ---
if (embed.startsWith('https://d-s.io/')) {
embed = embed.replace('https://d-s.io/e/', 'https://dsvplay.com/e/');
}
const url = new URL(embed);
if (await testUrl(url)) {
results.push({
url,
@ -111,9 +117,15 @@ export class Kokoshka extends Source {
if (json.embed_url) urls.push(json.embed_url);
if (Array.isArray(json.sources)) urls.push(...json.sources.map((s: any) => s.file));
for (const embed of urls) {
const cleaned = embed.replace(/\\/g, '').replace(/^http:/, 'https:');
const url = new URL(cleaned);
for (let embed of urls) {
embed = embed.replace(/\\/g, '').replace(/^http:/, 'https:');
// --- Replace Dodo domain ---
if (embed.startsWith('https://d-s.io/')) {
embed = embed.replace('https://d-s.io/e/', 'https://dsvplay.com/e/');
}
const url = new URL(embed);
if (await testUrl(url)) {
results.push({
url,
@ -133,4 +145,4 @@ export class Kokoshka extends Source {
return [];
}
}
}
}