Commit 64a8352

benny-dou <60535774+benny-dou@users.noreply.github.com>
2025-09-05 06:33:45
fix(bilibili): handle missing fields in post_info
1 parent 292dd70
Changed files (1)
src
preview
src/preview/bilibili.py
@@ -67,9 +67,9 @@ async def preview_bilibili(
     if author := post_info.get("author"):
         msg += f"\n๐Ÿ…ฑ๏ธ{author}"
 
-    if dt := post_info["dt"]:
+    if dt := post_info.get("dt"):
         msg += f"\n๐Ÿ•’{dt}"
-    if title := post_info["title"]:
+    if title := post_info.get("title"):
         msg += f"\n๐Ÿ“[{title}]({url})"
 
     if texts := post_info.get("texts"):