twitter_openapi_python icon indicating copy to clipboard operation
twitter_openapi_python copied to clipboard

build_header crashes when x-connection-hash is absent on Tweet Likes endpoint responses

Open shungiku opened this issue 2 weeks ago • 0 comments
trafficstars

Summary Twitter’s internal API stopped returning the x-connection-hash header for at least get_likes responses around 2025‑11‑04. The helper twitter_openapi_python.utils.api.build_header unconditionally reads headers["x-connection-hash"], so the call now raises KeyError in normal use.

Steps to Reproduce

  1. Authenticate with valid cookies and create a client
client = TwitterOpenapiPython().get_client_from_cookies(cookies)
tweet_api = client.get_tweet_api()
tweet_api.get_likes(user_id="your-id")
  1. Inspect the HTTP response headers returned by the API

shungiku avatar Nov 06 '25 14:11 shungiku