Repository navigation
Conversation
…t detection Cloudflare blocks requests from httpx because its TLS fingerprint (JA3/JA4) doesn't match any browser. Replace httpx.Client with curl_cffi Session using impersonate='chrome133a' so requests carry a Chrome 133 TLS fingerprint that Cloudflare accepts. - Replace httpx with curl_cffi in transports.py - Update pyproject.toml: httpx -> curl_cffi - Fix exception types (Timeout -> Timeout, add RequestException) - Fix cookie merge for None session.cookies - Use allow_redirects instead of follow_redirects (curl_cffi param name)
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Cloudflare blocks rdt-cli requests from this host (67.180.202.42, Comcast residential IP) with 403 responses. The root cause is TLS fingerprint (JA3/JA4) detection: httpx sends a non-browser TLS fingerprint that Cloudflare recognizes as a bot and blocks.
The browser works fine via xrdp because Chrome's TLS fingerprint is whitelisted. Headless Chrome also fails because Cloudflare's challenge ("Prove your humanity") requires human interaction.
Fix
Replace httpx with curl_cffi (Python library providing curl with browser impersonation) using
impersonate="chrome133a"— this sends a Chrome 133 TLS fingerprint that Cloudflare accepts.Changes
rdt_cli/transports.py: Replace httpx.Client with curl_cffi.requests.Session(impersonate="chrome133a")
pyproject.toml: Replace httpx>=0.27 with curl_cffi>=0.7
Verification
Tested on kavin-dc (67.180.202.42):
rdt whoami→ returns user profile with read+write capabilitiesrdt search "test" --limit 3→ returns valid Reddit search resultsDependencies
curl_cffi 0.16.3 is already in the rdt-cli venv. The chrome133a fingerprint is available in curl_cffi ≥ 0.7.