From 038f708b3681eaef317a2773d5096cde0906134a Mon Sep 17 00:00:00 2001 From: bytedream Date: Mon, 13 Sep 2021 17:13:49 +0200 Subject: [PATCH] Fixed vivo.sx / vivo.st regex and unwanted return --- src/index.ts | 2 -- src/match.ts | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/index.ts b/src/index.ts index 308d186..20d1df4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -24,8 +24,6 @@ chrome.storage.local.get(['all', 'disabled'], function (result) { re = document.body.innerHTML.match(regex) } - return - if (matchClass === null) { if (regex === null) { location.assign(document.body.innerHTML) diff --git a/src/match.ts b/src/match.ts index c8dd999..11a6046 100644 --- a/src/match.ts +++ b/src/match.ts @@ -38,7 +38,7 @@ class TheVideoMe implements Match { class Vivo implements Match { async match(match: RegExpMatchArray): Promise { - return this.rot47(decodeURIComponent(match[1])) + return this.rot47(decodeURIComponent(match[0])) } // decrypts a string with the rot47 algorithm (https://en.wikipedia.org/wiki/ROT13#Variants) @@ -71,8 +71,8 @@ const matches = [ ['thevideome.com', new RegExp(/(?<=\|)\w{2,}/gm), new TheVideoMe()], ['vidlox.me', new RegExp(/(?<=\[")\S+?(?=")/gm), null], ['vidoza.net', new RegExp(/(?<=src:(\s*)?")\S*(?=")/gm), null], - ['vivo.st', new RegExp(/source:\s*'(\S+)'/gm), new Vivo()], - ['vivo.sx', new RegExp(/source:\s*'(\S+)'/gm), new Vivo()], + ['vivo.st', new RegExp(/(?<=source:\s')(\S+)(?=')/gm), new Vivo()], + ['vivo.sx', new RegExp(/(?<=source:\s')(\S+)(?=')/gm), new Vivo()], ['voe.sx', new RegExp(/https?:\/\/\S*m3u8(?=")/gm), null], ['vupload.com', new RegExp(/(?<=class\|)\w*/gm), new Vupload()] ]