Commit 7ebe4d6
Changed files (1)
src
preview
src/preview/bilibili.py
@@ -162,7 +162,10 @@ async def get_bilibili_vinfo(url_or_vid: int | str) -> dict:
v = video.Video(bvid=av2bv(vid))
info = await v.get_info()
info["title"] = info.get("title", "Title")
- info["description"] = glom(info, Coalesce("desc", "desc_v2.0.raw_text", default=""))
+ desc = glom(info, Coalesce("desc", "desc_v2.0.raw_text", default=""))
+ if desc == "-":
+ desc = ""
+ info["description"] = desc
info["author"] = glom(info, "owner.name", default="B站UP主")
info["channel"] = f"https://space.bilibili.com/{glom(info, 'owner.mid', default='')}"
info["pubdate"] = datetime.fromtimestamp(info["pubdate"], tz=ZoneInfo(TZ)).strftime("%Y-%m-%d %H:%M:%S")