mirror of
https://github.com/hex-ci/smzdm_script.git
synced 2026-02-03 02:24:41 +08:00
Update smzdm_checkin.js
This commit is contained in:
@@ -14,8 +14,10 @@ const notify = require('./sendNotify');
|
||||
const $ = new Env('什么值得买签到');
|
||||
|
||||
class SmzdmCheckinBot extends SmzdmBot {
|
||||
constructor(cookie) {
|
||||
constructor(cookie, sk) {
|
||||
super(cookie);
|
||||
|
||||
this.sk = sk;
|
||||
}
|
||||
|
||||
async run() {
|
||||
@@ -34,7 +36,7 @@ class SmzdmCheckinBot extends SmzdmBot {
|
||||
headers: this.getHeaders(),
|
||||
data: {
|
||||
touchstone_event: '',
|
||||
sk: '1',
|
||||
sk: this.sk || '1',
|
||||
token: this.token,
|
||||
captcha: ''
|
||||
}
|
||||
@@ -141,6 +143,20 @@ class SmzdmCheckinBot extends SmzdmBot {
|
||||
return;
|
||||
}
|
||||
|
||||
let sks = [];
|
||||
|
||||
if (process.env.SMZDM_SK) {
|
||||
if (process.env.SMZDM_SK.indexOf('&') > -1) {
|
||||
sks = process.env.SMZDM_SK.split('&');
|
||||
}
|
||||
else if (process.env.SMZDM_SK.indexOf('\n') > -1) {
|
||||
sks = process.env.SMZDM_SK.split('\n');
|
||||
}
|
||||
else {
|
||||
sks = [process.env.SMZDM_SK];
|
||||
}
|
||||
}
|
||||
|
||||
let notifyContent = '';
|
||||
|
||||
for (let i = 0; i < cookies.length; i++) {
|
||||
@@ -150,6 +166,8 @@ class SmzdmCheckinBot extends SmzdmBot {
|
||||
continue;
|
||||
}
|
||||
|
||||
const sk = sks[i];
|
||||
|
||||
if (i > 0) {
|
||||
$.log('\n延迟 5 秒执行\n');
|
||||
await $.wait(5000);
|
||||
@@ -159,7 +177,7 @@ class SmzdmCheckinBot extends SmzdmBot {
|
||||
|
||||
$.log(sep);
|
||||
|
||||
const bot = new SmzdmCheckinBot(cookie);
|
||||
const bot = new SmzdmCheckinBot(cookie, sk);
|
||||
const msg = await bot.run();
|
||||
|
||||
notifyContent += sep + msg + '\n';
|
||||
|
||||
Reference in New Issue
Block a user