Skip to content
This repository has been archived by the owner on Jan 10, 2022. It is now read-only.

Commit

Permalink
fix(upTask): 去除单独的硬币数获取
Browse files Browse the repository at this point in the history
  • Loading branch information
catlair committed Jun 19, 2021
1 parent d7f13ed commit 9e8de87
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
4 changes: 1 addition & 3 deletions src/dailyTask/getFollow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,7 @@ export default async function (page: Page): Promise<Page> {
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}个`);
Expand Down
15 changes: 0 additions & 15 deletions src/dailyTask/upTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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<boolean> {
await this.page.waitForTimeout(3000);
await playVideo(this.page, logger);
Expand Down

0 comments on commit 9e8de87

Please sign in to comment.