Skip to content

Commit

Permalink
Merge pull request #961 from Gaomengkai/main
Browse files Browse the repository at this point in the history
修复 bili动态链接在投稿视频时URL和分割线连在一起
  • Loading branch information
HibiKier authored Aug 3, 2022
2 parents ba960d1 + 41b60b6 commit 1b8753f
Showing 1 changed file with 3 additions and 2 deletions.
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

0 comments on commit 1b8753f

Please sign in to comment.