From 2d0441997cc780c83fdbab3e875e455db98551e4 Mon Sep 17 00:00:00 2001 From: bytedream Date: Wed, 13 Jul 2022 18:04:44 +0200 Subject: [PATCH] Add doodstream stubs --- src/match/matches.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/match/matches.ts b/src/match/matches.ts index a41a1bf..b178a13 100644 --- a/src/match/matches.ts +++ b/src/match/matches.ts @@ -15,6 +15,32 @@ export abstract class Match { notice?: string } +// DOES NOT WORK. +// The url can be extracted (sometimes??? wtf) without problems but to receive the actual video, custom request +// headers must be set. And because the javascript and browser ecosystem is so fucked up, there is no good way to +// do this with media which can be natively played with the browser, like here. +class Doodstream implements Match { + name = 'Doodstream' + id = 'doodstream' + reliability = Reliability.HIGH + domains = [ + 'doodstream.com', + 'dood.pm' + ] + regex = new RegExp(/(\/pass_md5\/.*?)'.*(\?token=.*?expiry=)/s) + + async match(match: RegExpMatchArray): Promise { + const response = await fetch(`https://${window.location.host}${match[1]}`, { + headers: { + 'Range': 'bytes=0-' + }, + referrer: `https://${window.location.host}/e/${window.location.pathname.split('/').slice(-1)[0]}`, + }); + + return `${await response.text()}1234567890${match[2]}${Date.now()}` + } +} + class Evoload implements Match { name = 'Evoload' id = 'evoload'