Skip to content

Commit

Permalink
Merge pull request #159 from noahzark/patch-2
Browse files Browse the repository at this point in the history
修复B站动态生成失败的问题
  • Loading branch information
HibiKier authored May 14, 2022
2 parents 6d824e3 + f87c60e commit 428481b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plugins/bilibili_sub/data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,13 +333,13 @@ async def get_user_dynamic(
# 删除置顶
await page.evaluate(
"""
xs = document.getElementsByClassName('first-card-with-title');
xs = document.getElementsByClassName('bili-dyn-item__tag');
for (x of xs) {
x.remove();
x.parentNode.remove();
}
"""
)
card = await page.query_selector(".card")
card = await page.query_selector(".bili-dyn-list__item")
# 截图并保存
await card.screenshot(
path=dynamic_path / f"{local_user.sub_id}_{dynamic_upload_time}.jpg",
Expand Down Expand Up @@ -409,4 +409,4 @@ async def random_sub_data(self) -> Optional[BilibiliSub]:
if sub:
return sub
await self.reload_sub_data()
return await self.random_sub_data()
return await self.random_sub_data()

0 comments on commit 428481b

Please # to comment.