代码拉取完成,页面将自动刷新
同步操作将从 XanderYe/jd_scripts 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
import axios from "axios";
import {readFileSync, writeFileSync, unlinkSync} from "fs";
import {execSync} from "child_process";
import {requireConfig} from "./TS_USER_AGENTS";
let notify = require('./sendNotify'), message: string = '';
async function main() {
let cookiesArr: any = await requireConfig();
let cookiesNobyDa: {
cookie: string
}[] = []
for (let i = 0; i < cookiesArr.length; i++) {
cookiesNobyDa.push({cookie: cookiesArr[i]})
}
let data: any = '';
try {
data = await axios.get('https://raw.githubusercontent.com/NobyDa/Script/master/JD-DailyBonus/JD_DailyBonus.js', {timeout: 5000})
data = data.data
console.log('raw')
} catch (e) {
try {
data = await axios.get('https://ghproxy.com/https://raw.githubusercontent.com/NobyDa/Script/master/JD-DailyBonus/JD_DailyBonus.js', {timeout: 10000})
data = data.data
console.log('ghproxy')
} catch (e) {
data = '非脚本问题!网络错误,访问github失败'
}
}
if (data.indexOf('京东多合一签到脚本') > -1) {
data = data.replace('var OtherKey = ``;', `var OtherKey = \`${JSON.stringify(cookiesNobyDa)}\`;`)
data = data.replace(/ztmFUCxcPMNyUq0P/g, 'q8DNJdpcfRQ69gIx')
writeFileSync('./sign.js', data, 'utf-8')
execSync('node ./sign.js >> ./sign.log')
data = readFileSync('./sign.log', 'utf-8')
data = data.match(/【.*/gm)
message += data.join('\n').replace(/红包/g, '红包\n\n')
unlinkSync('./sign.js')
unlinkSync('./sign.log')
}
await notify.sendNotify('京东多合一签到脚本 via NobyDa@Github', message)
}
main().then()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。