Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复B站动态生成失败的问题 #159

Merged
merged 1 commit into from
May 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()