From ff23e913768d02094f249bab967f9530d5bcadf9 Mon Sep 17 00:00:00 2001 From: Hong <104482316+socks1s@users.noreply.github.com> Date: Fri, 24 Jul 2026 13:09:19 +0800 Subject: [PATCH] fix(search): send auth cookies on x.com home fetch for ClientTransaction init --- twitter_cli/client.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/twitter_cli/client.py b/twitter_cli/client.py index 0436c8e..51d6778 100644 --- a/twitter_cli/client.py +++ b/twitter_cli/client.py @@ -1103,6 +1103,9 @@ def _ensure_client_transaction(self): # a different TLS fingerprint on the same IP — a detection vector. cffi_session = _get_cffi_session() ct_headers = _gen_ct_headers() + # Send auth cookies: X's guest homepage no longer embeds ondemand.s, + # so a cookieless fetch fails CT init and SearchTimeline returns 404. + ct_headers["Cookie"] = self._cookie_string or "auth_token=%s; ct0=%s" % (self._auth_token, self._ct0) home_page = cffi_session.get( "https://x.com", headers=ct_headers, timeout=10, )