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