From f94d8a9df257ba3ac78feddc038a3ebebebe4c08 Mon Sep 17 00:00:00 2001 From: Emma Date: Thu, 13 Oct 2022 18:09:15 -0400 Subject: [PATCH] Filtering out invidious instances that don't support the API (#2714) * 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 * Removing instances without API from instances json * Modifying the hardcoded fallbacks --- src/renderer/store/modules/invidious.js | 6 +++--- static/invidious-instances.json | 3 --- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/renderer/store/modules/invidious.js b/src/renderer/store/modules/invidious.js index 1dfbbdf3..dea8942a 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 @@ -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' ] } } diff --git a/static/invidious-instances.json b/static/invidious-instances.json index 5d46c273..9dcd60b6 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" },