1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
| const fs = require('fs');
let str = `vmess://11111111111111111111111`
let ips = ["204.246.164.5", "204.246.175.5", "108.159.231.5"]
let arr = str.split("vmess://") for(let i = 0;i < arr.length;i++){ let type = exec(arr[i]) if(type){ let index = ips.indexOf(type) if(index != -1){ ips[index] = "|" } } }
fs.writeFile('./1.json', JSON.stringify(ips.filter(v=>v!="|")), (err) => { if (err) { console.error('保存文件时出错:', err); return; } console.log('文件已保存'); });
function exec(str){ if(str.length <= 0){ return false; } node_data = atob(str) let obj = JSON.parse(node_data) return obj.add }
|