1
0
mirror of https://git.sr.ht/~cadence/cloudtube synced 2024-11-10 02:27:29 +00:00

Strip slashes when loading instances

This commit is contained in:
Cadence Ember 2021-02-06 19:58:43 +13:00
parent c6363424cb
commit 7c31d04055
No known key found for this signature in database
GPG Key ID: BC1C2C61CF521B17

View File

@ -4,7 +4,7 @@ let globalList = []
function execute() { function execute() {
return request("https://api.invidious.io/instances.json?sort_by=health").then(res => res.json()).then(list => { return request("https://api.invidious.io/instances.json?sort_by=health").then(res => res.json()).then(list => {
list = list.filter(i => i[1].type === "https").map(i => i[1].uri) list = list.filter(i => i[1].type === "https").map(i => i[1].uri.replace(/\/+$/, ""))
globalList = list globalList = list
}).catch(error => { }).catch(error => {
console.error(error) console.error(error)