Commit 7ebe4d6

benny-dou <60535774+benny-dou@users.noreply.github.com>
2026-05-26 11:50:12
chore(bilibili): fix description field when it's '-'
1 parent c5f1f11
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")