Skip to content

Make the web-search fingerprint configurable and track curl_cffi's newest Chrome - #16

Open
guuse wants to merge 1 commit into
0xMH:mainfrom
guuse:fix/web-search-impersonate-configurable
Open

Make the web-search fingerprint configurable and track curl_cffi's newest Chrome#16
guuse wants to merge 1 commit into
0xMH:mainfrom
guuse:fix/web-search-impersonate-configurable

Conversation

@guuse

@guuse guuse commented Sep 8, 2026

Copy link
Copy Markdown

Problem

The web-search fallback added in 3.1.5 builds its session with a hardcoded impersonate="chrome124". Chrome 124 is from April 2024 and Akamai no longer accepts that fingerprint, so the fallback fails with:

curl: (92) HTTP/2 stream 1 was not closed cleanly: INTERNAL_ERROR

Since the mobile search API currently returns 401 no token provided (#15), that leaves search with no working path at all.

Measurements

From a residential NL IP, curl_cffi 0.15.0:

impersonate HTTP result
chrome124 HTTP/2 curl (92) INTERNAL_ERROR — 0.1s
chrome124 HTTP/1.1 curl (28) timeout — 25s
chrome146 HTTP/2 HTTP 200, payload parses — 0.5s
chrome146 HTTP/1.1 HTTP 200, payload parses — 0.5s

Only the fingerprint matters. Forcing HTTP/1.1 doesn't help, and priming Akamai's cookies by loading funda.nl first isn't needed either.

Fix

Default to curl_cffi's own "chrome" alias, which resolves to its newest Chrome target, instead of pinning a release that will age out again. The next Akamai rotation then only needs a pip install -U curl_cffi, with no pyfunda release:

client = Funda()                               # newest Chrome target
client = Funda(web_impersonate="chrome131")    # pin a specific one

The alias exists across the whole supported curl_cffi>=0.14.0 range, so the dependency floor doesn't need raising:

curl_cffi "chrome" resolves to
0.14.0 chrome142
0.15.0 chrome146
0.16.3 chrome150

Notes

  • FINGERPRINT_POOL in _transport.py is deliberately untouched. It mimics the Funda app rather than a browser, so a newest-Chrome default would be wrong there.
  • API is backwards compatible. web_impersonate has a default and is the last init field, so existing positional and keyword calls are unaffected. The default behaviour does change (chrome124 → newest), which is the point.
  • No version bump, since that triggers the publish workflow — left as a release decision.
  • Existing suite passes (50 tests), plus 4 new ones in tests/test_web_session.py.

…west

The web-search fallback added in 3.1.5 builds its session with a hardcoded
`impersonate="chrome124"`. Chrome 124 is from April 2024, and Akamai no longer
accepts that fingerprint, so the fallback fails with:

    curl: (92) HTTP/2 stream 1 was not closed cleanly: INTERNAL_ERROR

Measured from a residential NL IP on curl_cffi 0.15.0:

    chrome124 + HTTP/2      curl (92) INTERNAL_ERROR   (0.1s)
    chrome124 + HTTP/1.1    curl (28) timeout          (25s)
    chrome146 + HTTP/2      HTTP 200, payload parses   (0.5s)
    chrome146 + HTTP/1.1    HTTP 200, payload parses   (0.5s)

Only the fingerprint matters. Forcing HTTP/1.1 does not help, and priming
Akamai's cookies by loading funda.nl first is not needed either.

Rather than bump the pin to another release that will age out too, default to
curl_cffi's own `"chrome"` alias, which resolves to its newest Chrome target. A
`pip install -U curl_cffi` then recovers from the next rotation without a
pyfunda release. `Funda(web_impersonate=...)` pins a specific target when
needed. The alias exists across the whole supported curl_cffi>=0.14.0 range
(0.14.0 -> chrome142, 0.15.0 -> chrome146, 0.16.3 -> chrome150), so the
dependency floor does not need raising.

The mobile transport's FINGERPRINT_POOL is deliberately left alone: it mimics
the Funda app rather than a browser, so a newest-Chrome default would be wrong
there.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R1DFuoA2djNRuzmWKLi4Sr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant