MCPcopy Create free account
hub / github.com/smallfawn/QLScriptPublic / completeVideoCoinTasks

Method completeVideoCoinTasks

wxapp/niuniuduanju.js:349–380  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

347 }
348
349 async completeVideoCoinTasks() {
350 try {
351 let userInfo = await this.getUserInfo();
352 let nextStep = Number(userInfo.okLookVideoNum || 0) + 1;
353 if (nextStep < 1) nextStep = 1;
354 if (nextStep > VIDEO_COUNT_STEPS.length) {
355 $.log(`账号[${this.index}] 看视频次数前置: 今日已完成`);
356 return;
357 }
358
359 for (let step = nextStep; step <= VIDEO_COUNT_STEPS.length; step++) {
360 await this.updateUserWatchCount(VIDEO_COUNT_STEPS[step - 1], step);
361 try {
362 const result = await this.request({ apiPath: "/app/integral/lookVideoNum" });
363 $.log(`账号[${this.index}] 看视频次数金币[${step}/${VIDEO_COUNT_STEPS.length}]: ${result.msg || "success"}`);
364 userInfo = await this.getUserInfo();
365 if (Number(userInfo.okLookVideoNum || 0) >= VIDEO_COUNT_STEPS.length) break;
366 } catch (e) {
367 const message = String(e.message || e);
368 if (/已领取|已完成|今日.*完成|重复|不能重复|已经.*领取/.test(message)) {
369 $.log(`账号[${this.index}] 看视频次数金币: 今日已完成`);
370 break;
371 }
372 $.log(`账号[${this.index}] 看视频次数金币[${step}/${VIDEO_COUNT_STEPS.length}]: ${message}`);
373 if (e.code === 401 || /token|登录|验证失败/.test(message)) this.removeCachedToken();
374 break;
375 }
376 }
377 } catch (e) {
378 $.log(`账号[${this.index}] 看视频次数前置失败: ${e.message || e}`);
379 }
380 }
381
382 async completeVideoDurationTasks() {
383 try {

Callers 1

doDailyTasksMethod · 0.95

Calls 5

getUserInfoMethod · 0.95
updateUserWatchCountMethod · 0.95
requestMethod · 0.95
removeCachedTokenMethod · 0.95
logMethod · 0.45

Tested by

no test coverage detected