twitter_openapi_python
twitter_openapi_python copied to clipboard
build_header crashes when x-connection-hash is absent on Tweet Likes endpoint responses
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
- 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")
- Inspect the HTTP response headers returned by the API