From 7000d5a08be72e09496aad30cba9f9f9cde11a4a Mon Sep 17 00:00:00 2001
From: bytedream <bytedream@protonmail.com>
Date: Sat, 11 Nov 2023 21:48:44 +0100
Subject: [PATCH] Lint

---
 src/entries/player/Player.svelte |  2 ++
 src/entries/popup/Popup.svelte   |  1 +
 src/lib/match.ts                 | 36 ++++++++++++++++----------------
 src/lib/settings.ts              |  2 +-
 src/lib/utils.ts                 |  2 +-
 5 files changed, 23 insertions(+), 20 deletions(-)

diff --git a/src/entries/player/Player.svelte b/src/entries/player/Player.svelte
index e3a0bbd..b010ce2 100644
--- a/src/entries/player/Player.svelte
+++ b/src/entries/player/Player.svelte
@@ -20,11 +20,13 @@
 {#if errorMessage}
 	<div id="message-container">
 		<p>
+			<!-- eslint-disable-next-line svelte/no-at-html-tags -->
 			{@html errorMessage}
 		</p>
 	</div>
 {/if}
 
+<!-- eslint-disable -->
 <style lang="scss" global>
 	body {
 		background-color: #131313;
diff --git a/src/entries/popup/Popup.svelte b/src/entries/popup/Popup.svelte
index 344ab92..5fa5e4d 100644
--- a/src/entries/popup/Popup.svelte
+++ b/src/entries/popup/Popup.svelte
@@ -121,6 +121,7 @@
 	>
 </main>
 
+<!-- eslint-disable -->
 <style lang="scss" global>
 	body {
 		background-color: #2b2a33;
diff --git a/src/lib/match.ts b/src/lib/match.ts
index e8a6a8b..0ffe004 100644
--- a/src/lib/match.ts
+++ b/src/lib/match.ts
@@ -60,10 +60,10 @@ export const DropLoad: Match = {
 	id: 'dropload',
 	reliability: Reliability.HIGH,
 	domains: ['dropload.ui'],
-	regex: /eval\(function\(p,a,c,k,e,d\).*?(?=\<\/script\>)/gms,
+	regex: /eval\(function\(p,a,c,k,e,d\).*?(?=<\/script>)/gms,
 
 	match: async (match: RegExpMatchArray) => {
-		let unpacked = await unpack(match[0]);
+		const unpacked = await unpack(match[0]);
 		return unpacked.match(/(?<=file:").*(?=")/)[0];
 	}
 };
@@ -73,7 +73,7 @@ export const Filemoon: Match = {
 	id: 'filemoon',
 	reliability: Reliability.HIGH,
 	domains: ['filemoon.sx', 'filemoon.in'],
-	regex: /eval\(function\(p,a,c,k,e,d\).*?(?=\<\/script\>)/gms,
+	regex: /eval\(function\(p,a,c,k,e,d\).*?(?=<\/script>)/gms,
 
 	match: async (match: RegExpMatchArray) => {
 		const unpacked = await unpack(match[0]);
@@ -98,10 +98,10 @@ export const Kwik: Match = {
 	id: 'kwik',
 	reliability: Reliability.HIGH,
 	domains: ['kwik.cx'],
-	regex: /eval\(function\(p,a,c,k,e,d\).*?(?=\<\/script\>)/gms,
+	regex: /eval\(function\(p,a,c,k,e,d\).*?(?=<\/script>)/gms,
 
 	match: async (match: RegExpMatchArray) => {
-		let unpacked = await unpack(match[0]);
+		const unpacked = await unpack(match[0]);
 		return unpacked.match(/(?<=source=').*(?=')/)[0];
 	}
 };
@@ -111,11 +111,11 @@ export const Mixdrop: Match = {
 	id: 'mixdrop',
 	reliability: Reliability.HIGH,
 	domains: ['mixdrop.co', 'mixdrop.to', 'mixdrop.ch', 'mixdrop.bz', 'mixdrop.gl'],
-	regex: /eval\(function\(p,a,c,k,e,d\).*?(?=\<\/script\>)/gms,
+	regex: /eval\(function\(p,a,c,k,e,d\).*?(?=<\/script>)/gms,
 
 	match: async (match: RegExpMatchArray) => {
-		let unpacked = await unpack(match[0]);
-		let url = unpacked.match(/(?<=MDCore.wurl=").*(?=")/)[0];
+		const unpacked = await unpack(match[0]);
+		const url = unpacked.match(/(?<=MDCore.wurl=").*(?=")/)[0];
 		return `https:${url}`;
 	}
 };
@@ -126,10 +126,10 @@ export const Mp4Upload: Match = {
 	reliability: Reliability.HIGH,
 	domains: ['mp4upload.com'],
 	replace: true,
-	regex: /eval\(function\(p,a,c,k,e,d\).*?(?=\<\/script\>)/gms,
+	regex: /eval\(function\(p,a,c,k,e,d\).*?(?=<\/script>)/gms,
 
 	match: async (match: RegExpMatchArray) => {
-		let unpacked = await unpack(match[0]);
+		const unpacked = await unpack(match[0]);
 		return unpacked.match(/(?<=player.src\(").*(?=")/)[0];
 	}
 };
@@ -141,14 +141,14 @@ export const Newgrounds: Match = {
 	domains: ['newgrounds.com'],
 	regex: /.*/gm,
 
-	match: async (match: RegExpMatchArray) => {
-		let id = window.location.pathname.split('/').slice(-1)[0];
-		let response = await fetch(`https://www.newgrounds.com/portal/video/${id}`, {
+	match: async () => {
+		const id = window.location.pathname.split('/').slice(-1)[0];
+		const response = await fetch(`https://www.newgrounds.com/portal/video/${id}`, {
 			headers: {
 				'X-Requested-With': 'XMLHttpRequest'
 			}
 		});
-		let json = await response.json();
+		const json = await response.json();
 		return decodeURI(json['sources'][Object.keys(json['sources'])[0]][0]['src']);
 	}
 };
@@ -192,10 +192,10 @@ export const SuperVideo: Match = {
 	id: 'supervideo',
 	reliability: Reliability.HIGH,
 	domains: ['supervideo.tv'],
-	regex: /eval\(function\(p,a,c,k,e,d\).*?(?=\<\/script\>)/gms,
+	regex: /eval\(function\(p,a,c,k,e,d\).*?(?=<\/script>)/gms,
 
 	match: async (match: RegExpMatchArray) => {
-		let unpacked = await unpack(match[0]);
+		const unpacked = await unpack(match[0]);
 		return unpacked.match(/(?<=file:").*(?=")/)[0];
 	}
 };
@@ -205,10 +205,10 @@ export const Upstream: Match = {
 	id: 'upstream',
 	reliability: Reliability.HIGH,
 	domains: ['upstream.to'],
-	regex: /eval\(function\(p,a,c,k,e,d\).*?(?=\<\/script\>)/gms,
+	regex: /eval\(function\(p,a,c,k,e,d\).*?(?=<\/script>)/gms,
 
 	match: async (match: RegExpMatchArray) => {
-		let unpacked = await unpack(match[0]);
+		const unpacked = await unpack(match[0]);
 		return unpacked.match(/(?<=file:").*(?=")/)[0];
 	}
 };
diff --git a/src/lib/settings.ts b/src/lib/settings.ts
index bad862a..c4f2563 100644
--- a/src/lib/settings.ts
+++ b/src/lib/settings.ts
@@ -16,7 +16,7 @@ export const Hosters = {
 		}
 	},
 	enable: async (match: Match) => {
-		let disabled = await storageGet('hosters.disabled', []);
+		const disabled = await storageGet('hosters.disabled', []);
 		const index = disabled.indexOf(match.id);
 		if (index !== -1) {
 			disabled.splice(index, 1);
diff --git a/src/lib/utils.ts b/src/lib/utils.ts
index 008697b..ee12d2d 100644
--- a/src/lib/utils.ts
+++ b/src/lib/utils.ts
@@ -1,6 +1,6 @@
 // Adapted from http://matthewfl.com/unPacker.html by matthew@matthewfl.com
 export async function unpack(packed: string): Promise<string> {
-	let context = `
+	const context = `
 		{
 			eval: function (c) {
 				packed = c;