From 2e13586ebb30eb5019cf83c0d3406b9fafac2dcb Mon Sep 17 00:00:00 2001 From: bytedream Date: Fri, 22 Oct 2021 23:40:21 +0200 Subject: [PATCH] Added mcloud.to --- SUPPORTED | 1 + src/match.ts | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/SUPPORTED b/SUPPORTED index 3b5cbee..9462a14 100644 --- a/SUPPORTED +++ b/SUPPORTED @@ -1,4 +1,5 @@ evoload.io +mcloud.to mixdrop.co streamtape.com streamzz.to diff --git a/src/match.ts b/src/match.ts index 11a6046..35c5bd8 100644 --- a/src/match.ts +++ b/src/match.ts @@ -18,6 +18,20 @@ class Evoload implements Match { } } +class MCloud implements Match { + async match(match: RegExpMatchArray): Promise { + const code = window.location.pathname.split('/').slice(-1)[0] + const response = await fetch(`https://mcloud.to/info/${code}?skey=${match[0]}`, { + headers: { + 'Content-Type': 'application/json' + }, + referrer: `https://mcloud.to/embed/${code}` + }) + const json = await response.json() + return json['media']['sources'][0]['file'] + } +} + class Mixdrop implements Match { async match(match: RegExpMatchArray): Promise { return `https://a-${match[1]}.${match[4]}.${match[5]}/v/${match[2]}.${match[6]}?s=${match[12]}&e=${match[13]}` @@ -65,6 +79,7 @@ class Vupload implements Match { // every match HAS to be on an separate line const matches = [ ['evoload.io', null, new Evoload()], + ['mcloud.to', new RegExp(/(?<=')\w+(?=';)/gm), new MCloud()], ['mixdrop.co', new RegExp(/(?<=\|)\w{2,}/gm), new Mixdrop()], ['streamtape.com', new RegExp(/id=\S*(?=')/gm), new Streamtape()], ['streamzz.to', new RegExp(/https?:\/\/get.streamz.tw\/getlink-\w+\.dll/gm), null],