mirror of
https://github.com/hex-ci/smzdm_script.git
synced 2026-06-16 15:06:51 +08:00
Update smzdm_task.js
This commit is contained in:
@@ -419,7 +419,7 @@ class SmzdmTaskBot extends SmzdmBot {
|
|||||||
|
|
||||||
if (task.task_redirect_url.link_type != 'other') {
|
if (task.task_redirect_url.link_type != 'other') {
|
||||||
// 模拟打开文章
|
// 模拟打开文章
|
||||||
await this.getArticleDetail(article.article_id);
|
await this.getArticleDetail(article.article_id, true);
|
||||||
|
|
||||||
$.log('等候 8 秒');
|
$.log('等候 8 秒');
|
||||||
await $.wait(8000);
|
await $.wait(8000);
|
||||||
@@ -469,7 +469,7 @@ class SmzdmTaskBot extends SmzdmBot {
|
|||||||
|
|
||||||
if (isRead) {
|
if (isRead) {
|
||||||
// 模拟打开文章
|
// 模拟打开文章
|
||||||
await this.getArticleDetail(article.article_id);
|
await this.getArticleDetail(article.article_id, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
$.log('延迟 15 秒模拟阅读文章');
|
$.log('延迟 15 秒模拟阅读文章');
|
||||||
@@ -971,7 +971,7 @@ class SmzdmTaskBot extends SmzdmBot {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 获取文章详情
|
// 获取文章详情
|
||||||
async getArticleDetail(id) {
|
async getArticleDetail(id, isQuiet = false) {
|
||||||
const { isSuccess, data, response } = await requestApi(`https://article-api.smzdm.com/article_detail/${id}`, {
|
const { isSuccess, data, response } = await requestApi(`https://article-api.smzdm.com/article_detail/${id}`, {
|
||||||
headers: this.getHeaders(),
|
headers: this.getHeaders(),
|
||||||
data: {
|
data: {
|
||||||
@@ -989,7 +989,9 @@ class SmzdmTaskBot extends SmzdmBot {
|
|||||||
return data.data;
|
return data.data;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$.log(`获取文章详情失败!${response}`);
|
if (!isQuiet) {
|
||||||
|
$.log(`获取文章详情失败!${response}`);
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user