From 19247ce30d835715e8d56cc7cbedf4b0331362cd Mon Sep 17 00:00:00 2001 From: localhost Date: Fri, 11 Aug 2023 22:02:51 +0100 Subject: [PATCH] remove onion and i2p --- utils/metadata.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/metadata.js b/utils/metadata.js index a417da1..a72369e 100644 --- a/utils/metadata.js +++ b/utils/metadata.js @@ -2,7 +2,8 @@ const fetch = require('node-fetch') async function getInstance() { const instances = await (await fetch('https://api.invidious.io/instances.json?pretty=1')).json() - return `https://${instances[Math.floor(Math.random() * instances.length)][0]}` + const sorted = instances.filter(o => o[1].type == 'https') + return `https://${sorted[Math.floor(Math.random() * sorted.length)][0]}` } async function getPipedInstance() {