From 1620758cf7480a71d468b558708ea86a66aa5dd0 Mon Sep 17 00:00:00 2001 From: Emma Date: Wed, 12 Oct 2022 16:13:53 -0400 Subject: [PATCH 1/3] Adding two additional checks to the instance filter - Checking if the instance supports the api at all - Checking if the instance supports cors in web environments --- src/renderer/store/modules/invidious.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/store/modules/invidious.js b/src/renderer/store/modules/invidious.js index 1dfbbdf3596f..91424a5f38a9 100644 --- a/src/renderer/store/modules/invidious.js +++ b/src/renderer/store/modules/invidious.js @@ -24,7 +24,7 @@ const actions = { const response = await fetch(requestUrl) const json = await response.json() instances = json.filter((instance) => { - if (instance[0].includes('.onion') || instance[0].includes('.i2p')) { + if (instance[0].includes('.onion') || instance[0].includes('.i2p') || !instance[1].api || (!process.env.IS_ELECTRON && !instance[1].cors)) { return false } else { return true From 9734a159bc20b3763e928885e3a42e2b961e0f1e Mon Sep 17 00:00:00 2001 From: Emma Date: Thu, 13 Oct 2022 07:33:14 -0400 Subject: [PATCH 2/3] Removing instances without API from instances json --- static/invidious-instances.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/static/invidious-instances.json b/static/invidious-instances.json index 5d46c273e641..9dcd60b6d6c5 100644 --- a/static/invidious-instances.json +++ b/static/invidious-instances.json @@ -1,8 +1,5 @@ [ - { "url": "https://yewtu.be" }, { "url": "https://vid.puffyan.us" }, - { "url": "https://invidious.snopyta.org" }, - { "url": "https://invidious.kavin.rocks" }, { "url": "https://inv.riverside.rocks" }, { "url": "https://invidious.osi.kr" }, { "url": "https://y.com.sb" }, From 5e1aa964e51e249dea3c1085d976e4a3706752ea Mon Sep 17 00:00:00 2001 From: Emma Date: Thu, 13 Oct 2022 07:38:58 -0400 Subject: [PATCH 3/3] Modifying the hardcoded fallbacks --- src/renderer/store/modules/invidious.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderer/store/modules/invidious.js b/src/renderer/store/modules/invidious.js index 91424a5f38a9..dea8942ac617 100644 --- a/src/renderer/store/modules/invidious.js +++ b/src/renderer/store/modules/invidious.js @@ -51,8 +51,8 @@ const actions = { } else { console.error('unable to read static file for invidious instances') instances = [ - 'https://invidious.snopyta.org', - 'https://invidious.kavin.rocks/' + 'https://invidious.sethforprivacy.com', + 'https://invidious.namazso.eu' ] } }