Commit 701f021
Changed files (1)
src
preview
src/preview/weibo.py
@@ -150,9 +150,9 @@ async def parse_weibo_info(post_id: str, data: dict | None = None, **kwargs) ->
if not data:
weibo_url = f"https://m.weibo.cn/detail/{post_id}"
logger.info(f"Weibo link preview for {weibo_url}")
- headers = {"referer": "https://m.weibo.cn"}
+ headers = {"referer": "https://m.weibo.cn", "cookie": await get_weibo_cookies()}
try:
- resp = await hx_req(weibo_url, headers=headers, rformat="text")
+ resp = await hx_req(weibo_url, headers=headers, mobile=True, rformat="text")
if not resp.get("text"):
info["error_msg"] = f"Weibo webpage not found: {weibo_url}"
return info