get p2pServers without using eval+

merge-requests/521/merge^2
Moe 2024-10-10 19:18:20 -07:00
parent 4f1df193a0
commit 41d7214a45
1 changed files with 2 additions and 2 deletions

View File

@ -70,11 +70,11 @@ module.exports = function(s,config,lang,app){
}
}
fetch('https://cdn.shinobi.video/configs/p2pServers.js')
fetch('https://cdn.shinobi.video/configs/p2pServers.json')
.then(res => res.text())
.then((text) => {
try {
const parsedData = new Function(`return ${text}`)();
const parsedData = JSON.parse(text);
config.p2pServerList = parsedData;
} catch (err) {
s.debugLog(`Failed to parse server list: ${err.message}`);