AutoMihoyoBBS
AutoMihoyoBBS copied to clipboard
请问能否增加云原神签到功能?
请问能否增加云原神签到功能?
github里是有云原神签到的脚本的
建一个js文件 用qinglong运行就行 需要手机进行抓包,不会就放弃吧
哦 青龙的nodejs还要 axios 依赖
const _config = {
combo_token: 'ai=4;ci=1;bi=hk4e_cn',
type: '2',
app_version: '',
sys_version: '',
device_id: '',
device_name: '',
device_model: '',
app_id: ' '',
tokens: [
'oi=;ct=;si=;'
],
}
// 先用手机抓到数据然后上面的数据补全就行, tokens里面有多少个账号就填多少个,用 , 隔开
//云原神签到
const axios = require("axios");
function yunys (config, i = 0) {
return new Promise(async (resolve) => {
try {
let url =
"https://api-cloudgame.mihoyo.com/hk4e_cg_cn/wallet/wallet/get";
const header = {
headers: {
"x-rpc-combo_token": config.tokens[i] + config.combo_token,
"x-rpc-client_type": config.type,
"x-rpc-app_version": config.app_version,
"x-rpc-sys_version": config.sys_version,
"x-rpc-channel": "mihoyo",
"x-rpc-device_id": config.device_id,
"x-rpc-device_name": config.device_name,
"x-rpc-device_model": config.device_model,
"x-rpc-app_id": config.app_id,
"Referer": "https://app.mihoyo.com",
"Host": "api-cloudgame.mihoyo.com",
"Connection": "Keep-Alive",
"Accept-Encoding": "gzip",
"User-Agent": "okhttp/3.14.9"
},
};
let res = await axios.get(url, header);
if (res.data.retcode == 0) {
data = `签到成功! 当前账号: ${config.tokens[i].split(';')[0].split('=')[1]},剩余总时间为${res.data.data.free_time.free_time}分钟`;
} else {
data = res.data.error_msg;
}
console.log(data);
} catch (err) {
console.log(err);
data = "签到接口请求出错"
}
resolve("【云原神】:" + data);
});
}
for (let i = 0; i < _config.tokens.length; i++) {
yunys(_config, i)
}
module.exports = yunys;
建一个js文件 用qinglong运行就行 需要手机进行抓包,不会就放弃吧
const _config = { combo_token: 'ai=4;ci=1;bi=hk4e_cn', type: '2', app_version: '', sys_version: '', device_id: '', device_name: '', device_model: '', app_id: ' '', tokens: [ 'oi=;ct=;si=;' ], } // 先用手机抓到数据然后上面的数据补全就行, tokens里面有多少个账号就填多少个,用 , 隔开 //云原神签到 const axios = require("axios"); function yunys (config, i = 0) { return new Promise(async (resolve) => { try { let url = "https://api-cloudgame.mihoyo.com/hk4e_cg_cn/wallet/wallet/get"; const header = { headers: { "x-rpc-combo_token": config.tokens[i] + config.combo_token, "x-rpc-client_type": config.type, "x-rpc-app_version": config.app_version, "x-rpc-sys_version": config.sys_version, "x-rpc-channel": "mihoyo", "x-rpc-device_id": config.device_id, "x-rpc-device_name": config.device_name, "x-rpc-device_model": config.device_model, "x-rpc-app_id": config.app_id, "Referer": "https://app.mihoyo.com", "Host": "api-cloudgame.mihoyo.com", "Connection": "Keep-Alive", "Accept-Encoding": "gzip", "User-Agent": "okhttp/3.14.9" }, }; let res = await axios.get(url, header); if (res.data.retcode == 0) { data = `签到成功! 当前账号: ${config.tokens[i].split(';')[0].split('=')[1]},剩余总时间为${res.data.data.free_time.free_time}分钟`; } else { data = res.data.error_msg; } console.log(data); } catch (err) { console.log(err); data = "签到接口请求出错" } resolve("【云原神】:" + data); }); } for (let i = 0; i < _config.tokens.length; i++) { yunys(_config, i) } module.exports = yunys;
谢谢大佬