From 9e8de8708fa7ebb4a2ab40d0e682bd420389487c Mon Sep 17 00:00:00 2001 From: catlair Date: Sat, 19 Jun 2021 22:11:47 +0800 Subject: [PATCH] =?UTF-8?q?fix(upTask):=20=E5=8E=BB=E9=99=A4=E5=8D=95?= =?UTF-8?q?=E7=8B=AC=E7=9A=84=E7=A1=AC=E5=B8=81=E6=95=B0=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/dailyTask/getFollow.ts | 4 +--- src/dailyTask/upTask.ts | 15 --------------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/src/dailyTask/getFollow.ts b/src/dailyTask/getFollow.ts index 0967350..1269e9a 100644 --- a/src/dailyTask/getFollow.ts +++ b/src/dailyTask/getFollow.ts @@ -139,9 +139,7 @@ export default async function (page: Page): Promise { await paginationToJump(page, pageNum, logger); await page.util.wt(3, 6); //等待页面真正的渲染完成 - await page.waitForSelector('.follow-content.section:not(.loading)', { - timeout: 13000, - }); + await page.waitForSelector('.follow-content.section:not(.loading)'); await page.util.wt(1, 3); //获取到的$$包含头像和昵称(两者都可点击) logger.trace(`选择第${num + 1}个`); diff --git a/src/dailyTask/upTask.ts b/src/dailyTask/upTask.ts index 456a5a1..d48e430 100644 --- a/src/dailyTask/upTask.ts +++ b/src/dailyTask/upTask.ts @@ -252,7 +252,6 @@ export class UPTask { //只在本页操作 await this.page.util.removeTarget(); const runArray: any = [ - this.getCoinNum(), this.page.waitForNavigation(), this.contributeType === 0 ? $$item[num].$eval('a', (a: HTMLAnchorElement) => a.click()) @@ -283,20 +282,6 @@ export class UPTask { return true; } - async getCoinNum() { - try { - const res = await this.page.waitForResponse( - 'https://api.bilibili.com/x/web-interface/nav', - ); - this.userNav = (await res.json()).data; - DailyTask.money = this.userNav?.money; - logger.debug('剩余硬币数', DailyTask.money); - return res; - } catch (error) { - logger.trace('获取硬币数失败', error.message); - } - } - async videoHandle(): Promise { await this.page.waitForTimeout(3000); await playVideo(this.page, logger);