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

修复 bili动态链接在投稿视频时URL和分割线连在一起 #961

Merged
merged 1 commit into from
Aug 3, 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
5 changes: 3 additions & 2 deletions plugins/bilibili_sub/data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ async def _get_up_status(id_: int) -> Optional[str]:
video_info = await get_videos(id_)
latest_video_created = 0
video = None
dividing_line = "\n-------------\n"
if _user.uname != uname:
await BilibiliSub.update_sub_info(id_, uname=uname)
dynamic_img, dynamic_upload_time, link = await get_user_dynamic(id_, _user)
Expand All @@ -270,7 +271,7 @@ async def _get_up_status(id_: int) -> Optional[str]:
and video
and _user.latest_video_created < latest_video_created
):
rst = rst + "-------------\n" if rst else rst
rst = rst + dividing_line if rst else rst
await BilibiliSub.update_sub_info(
id_, latest_video_created=latest_video_created
)
Expand All @@ -281,7 +282,7 @@ async def _get_up_status(id_: int) -> Optional[str]:
f'Bvid:{video["bvid"]}\n'
f'直链:https://www.bilibili.com/video/{video["bvid"]}'
)
rst = None if rst == "-------------\n" else rst
rst = None if rst == dividing_line else rst
return rst


Expand Down