1
0
mirror of https://git.sr.ht/~cadence/cloudtube synced 2024-12-22 13:07:00 +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() {
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
}).catch(error => {
console.error(error)