mirror of
https://github.com/FreeTubeApp/FreeTube
synced 2024-11-27 04:09:55 +01:00
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
This commit is contained in:
parent
21a31cf6f5
commit
f94d8a9df2
@ -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'
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -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" },
|
||||
|
Loading…
Reference in New Issue
Block a user