* Update _get_gql_ops.py
Make it way faster by keeping connection alive
* Update _get_gql_ops.py
---------
Co-authored-by: vladkens <[email protected]>
* fix(api): refresh GraphQL queryIds (issue #306)
X rotated the GraphQL operation IDs around 2026-05; the previous IDs
return HTTP 404. Updated 13 OP_* constants from a fresh bundle.
Retweeters and Bookmarks were not present in the bundle, left as is.
* fix(xclid): fall back to XClientTransaction lib (issue #306)
Around 2026-04 X removed the e=>e+"."+ script-list pattern from its
bundle, which breaks get_scripts_list() and the native key derivation.
Adds an optional adapter that uses the upstream XClientTransaction
PyPI package (the same algorithm this module is ported from) when it
is installed. The native code path is preserved as a fallback so
existing setups are not affected.
To enable: pip install XClientTransaction
* fix(utils): handle X 2026 schema with legacy=null (issue #306)
X recently changed the GraphQL response shape for Tweet/User:
* legacy is now null (not a dict)
* Tweet fields previously inside legacy (full_text, entities,
created_at, user_id_str, *_count) are on the top level
* User fields are split between top-level and the new sub-objects
core (screen_name, name, created_at), avatar.image_url,
location.location, privacy.protected, verification.verified,
profile_bio.description
* Even when legacy is still a dict (e.g. nested User in
core.user_results.result) it is partial, missing screen_name/name/
created_at because those live in core.*
The old to_old_obj did **obj['legacy'], which raises TypeError on the
new schema. Replaced with a flatten that:
1. Merges the optional legacy with the top-level (top-level wins)
2. Pulls well-known fields from the new sub-objects up to the top level
3. Sets safe defaults for fields the parser dereferences directly
Verified end-to-end with api.search('python lang:en', limit=2):
24 tweets parsed successfully.
Backward compatible: when legacy is the old, complete dict, the merge
produces a flat dict equivalent to the previous output.
---------
Co-authored-by: vladkens <[email protected]>