Commit 2455efb
Changed files (1)
src
preview
src/preview/twitter.py
@@ -245,7 +245,7 @@ async def get_tweet_info_via_tikhub(url: str = "", post_id: str = "", quote_info
else:
headers = {"authorization": f"Bearer {TOKEN.TIKHUB}", "accept": "application/json"}
resp = await hx_req(api_url, headers=headers, proxy=PROXY.TWITTER, check_keys=["data.author.screen_name"], check_kv={"data.id": post_id})
- if resp.get("hx_error"):
+ if resp.get("hx_error") or glom(resp, "data.author.screen_name") is None:
logger.error("Failed to get tweet info via TikHub")
return {}
data: dict = resp["data"]