stealthhttp 0.7.0__tar.gz → 0.9.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/Cargo.lock +9 -8
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/Cargo.toml +2 -1
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/PKG-INFO +4 -1
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/pyproject.toml +3 -2
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/__init__.py +49 -4
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/_fallback.py +6 -2
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/auto_bypass.py +107 -67
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/auto_profile.py +19 -19
- stealthhttp-0.9.2/python/stealthhttp/auto_update.py +118 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/backends/curl_backend.py +1 -1
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/backends/native_backend.py +8 -6
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/backends/wreq_backend.py +1 -1
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/behavior.py +22 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/browser_pool.py +1 -1
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/bypasses/__init__.py +2 -2
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/bypasses/akamai.py +3 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/bypasses/captcha.py +3 -2
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/bypasses/solver.py +21 -1
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/captcha_farm.py +1 -1
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/cdp_solver.py +2 -2
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/clienthints.py +10 -7
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/coherence.py +4 -4
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/collectors/akamai.py +50 -16
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/collectors/datadome.py +17 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/collectors/imperva.py +17 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/collectors/kasada.py +16 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/collectors/perimeterx.py +24 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/collectors/shape.py +13 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/detection.py +1 -1
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/geo.py +1 -1
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/identity.py +5 -5
- stealthhttp-0.9.2/python/stealthhttp/jsdb_ext.py +313 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/jsenv.py +204 -110
- stealthhttp-0.9.2/python/stealthhttp/jsenv_types.py +159 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/prepare.py +13 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/response.py +3 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/selfcheck.py +3 -2
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/session.py +48 -4
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/session_ext.py +6 -3
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/site_recipes.py +1 -1
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/solving/audio.py +1 -1
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/solving/browser.py +3 -3
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/solving/providers.py +1 -1
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/stealth_audit.py +1 -1
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/tls_clone.py +1 -1
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/src/fingerprint/headers.rs +14 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/src/fingerprint/profile.rs +17 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/src/lib.rs +2 -2
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/src/transport/engine.rs +79 -12
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/src/transport/tls.rs +59 -12
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/tests/test_fingerprint.py +3 -3
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/tests/test_jsemu.py +2 -1
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/tests/test_jsemu_live.py +3 -2
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/tests/test_session.py +53 -21
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/.cargo/config.toml +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/.github/workflows/release.yml +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/.gitignore +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/CHANGELOG.md +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/LICENSE +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/README.md +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/benchmarks/bench.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/benchmarks/bench_native.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/examples/basic.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/_loader.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/_rotation.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/adaptive_persona.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/ambient.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/antidetect.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/async_session.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/backends/__init__.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/backends/base.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/browser_cookies.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/browser_fsm.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/browsing.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/bypasses/cloudflare.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/bypasses/datadome.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/bypasses/flow.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/bypasses/imperva.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/bypasses/kasada.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/bypasses/perimeterx.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/bypasses/shape.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/canvas_webgl_sim.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/capabilities.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/captcha.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/cdp_transport.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/challenge.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/challenge_vm.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/collectors/__init__.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/consistency.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/cookie_intel.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/cookies.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/cover_traffic.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/device_db.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/dns_intel.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/dns_tunnel.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/doh.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/entropy_mask.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/error_analysis.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/exceptions.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/fingerprint_diff.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/forms.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/graphql.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/h2_frames.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/har.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/header_canon.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/health_monitor.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/honeypot_oracle.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/hooks.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/hsts.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/httpcache.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/humanize.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/immortal.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/js_sandbox.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/jsdb.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/lifecycle.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/lint.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/mesh.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/middleware.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/multipart.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/parsing.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/poison_detect.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/pow.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/predictive_rate.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/proto_chameleon.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/proxy.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/proxy_scoring.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/quic_fingerprint.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/record_replay.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/redirect_intel.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/replay_attack.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/request_graph.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/resp_diff.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/response_decoder.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/response_intel.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/retry.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/rhythm.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/rotation.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/self_audit.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/sensors.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/session_coord.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/session_dna.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/smart_proxy.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/smart_retry.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/solving/__init__.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/solving/base.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/solving/local.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/solving/orchestrator.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/solving/vision.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/strategy.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/synth_fingerprint.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/tcp_tuning.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/tests/test_cdp_solver.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/tests/test_features_v3.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/tests/test_features_v3_live.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/tests/test_v030_features.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/tests/test_v040_features.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/tests/test_v050_batch1.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/tests/test_v050_batch2.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/tests/test_v050_integrations.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/tests/test_v050_live.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/tls_ext.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/tls_intel.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/tls_session.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/traffic.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/traffic_morph.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/waf_recon.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/websocket.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/python/stealthhttp/ws_tunnel.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/src/fingerprint/ja3.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/src/fingerprint/ja4.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/src/fingerprint/mod.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/src/pow.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/src/proxypool.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/src/rotation.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/src/transport/decode.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/src/transport/mod.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/tests/conftest.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/tests/test_audio.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/tests/test_bypass.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/tests/test_bypasses.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/tests/test_bypasses_live.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/tests/test_emulation.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/tests/test_features_v2.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/tests/test_features_v2_live.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/tests/test_humanize.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/tests/test_live_bypass.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/tests/test_live_detection.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/tests/test_live_trust.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/tests/test_new_features.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/tests/test_policies.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/tests/test_routing.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/tests/test_solving.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/tests/test_vision.py +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/.github/FUNDING.yml +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/.github/workflows/CI.yml +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/.gitignore +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/CHANGELOG.md +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/CONTRIBUTING.md +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/Cargo.toml +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/LICENSE +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/README.md +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/benches/main.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/examples/akamai.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/examples/client.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/examples/server.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/client.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/codec/error.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/codec/framed_read.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/codec/framed_write.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/codec/mod.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/error.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/ext.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/frame/data.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/frame/go_away.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/frame/head.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/frame/headers.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/frame/mod.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/frame/ping.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/frame/priority.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/frame/reason.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/frame/reset.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/frame/settings.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/frame/stream_id.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/frame/util.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/frame/window_update.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/fuzz_bridge.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/hpack/decoder.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/hpack/encoder.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/hpack/header.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/hpack/huffman/mod.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/hpack/huffman/table.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/hpack/mod.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/hpack/table.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/hpack/test/fixture.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/hpack/test/fuzz.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/hpack/test/mod.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/lib.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/proto/connection.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/proto/error.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/proto/go_away.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/proto/mod.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/proto/peer.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/proto/ping_pong.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/proto/settings.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/proto/streams/buffer.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/proto/streams/counts.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/proto/streams/flow_control.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/proto/streams/mod.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/proto/streams/prioritize.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/proto/streams/recv.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/proto/streams/send.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/proto/streams/state.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/proto/streams/store.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/proto/streams/stream.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/proto/streams/streams.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/server.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/h2/src/share.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/Cargo.toml +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/LICENSE +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/README.md +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/body/incoming.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/body/length.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/body/mod.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/cfg.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/client/conn/http1.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/client/conn/http2.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/client/conn/mod.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/client/dispatch.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/client/mod.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/client/tests.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/common/buf.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/common/date.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/common/either.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/common/future.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/common/io/compat.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/common/io/mod.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/common/io/rewind.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/common/lock.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/common/mod.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/common/task.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/common/time.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/common/watch.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/error.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/ext/h1_reason_phrase.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/ext/informational.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/ext/mod.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/ffi/body.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/ffi/client.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/ffi/error.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/ffi/http_types.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/ffi/io.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/ffi/macros.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/ffi/mod.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/ffi/task.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/headers.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/lib.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/mock.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/proto/h1/conn.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/proto/h1/decode.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/proto/h1/dispatch.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/proto/h1/encode.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/proto/h1/io.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/proto/h1/mod.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/proto/h1/role.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/proto/h2/client.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/proto/h2/mod.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/proto/h2/ping.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/proto/h2/server.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/proto/h2/upgrade.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/proto/mod.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/rt/bounds.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/rt/io.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/rt/mod.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/rt/timer.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/server/conn/http1.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/server/conn/http2.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/server/conn/mod.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/server/mod.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/service/http.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/service/mod.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/service/service.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/service/util.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/trace.rs +0 -0
- {stealthhttp-0.7.0 → stealthhttp-0.9.2}/vendor/hyper/src/upgrade.rs +0 -0
|
@@ -120,9 +120,9 @@ checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04"
|
|
|
120
120
|
|
|
121
121
|
[[package]]
|
|
122
122
|
name = "cc"
|
|
123
|
-
version = "1.4.
|
|
123
|
+
version = "1.4.4"
|
|
124
124
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
125
|
-
checksum = "
|
|
125
|
+
checksum = "0ad534f4357a5264cce5019c989cf66a4f0dc4e0d1b1d15f8aacec0ff7360273"
|
|
126
126
|
dependencies = [
|
|
127
127
|
"find-msvc-tools",
|
|
128
128
|
"jobserver",
|
|
@@ -231,9 +231,9 @@ dependencies = [
|
|
|
231
231
|
|
|
232
232
|
[[package]]
|
|
233
233
|
name = "either"
|
|
234
|
-
version = "1.
|
|
234
|
+
version = "1.18.0"
|
|
235
235
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
236
|
-
checksum = "
|
|
236
|
+
checksum = "252afb9ae5eaa683babdc6a068b3f5726eb19e05070c731f9b2a23a7c3e8ed34"
|
|
237
237
|
|
|
238
238
|
[[package]]
|
|
239
239
|
name = "equivalent"
|
|
@@ -243,9 +243,9 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
|
|
|
243
243
|
|
|
244
244
|
[[package]]
|
|
245
245
|
name = "find-msvc-tools"
|
|
246
|
-
version = "0.1.
|
|
246
|
+
version = "0.1.11"
|
|
247
247
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
248
|
-
checksum = "
|
|
248
|
+
checksum = "d45db016d36b838f563236e9193d0ee6ce38f3f68b6c94e914b4929c96bbb890"
|
|
249
249
|
|
|
250
250
|
[[package]]
|
|
251
251
|
name = "flate2"
|
|
@@ -632,9 +632,9 @@ checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"
|
|
|
632
632
|
|
|
633
633
|
[[package]]
|
|
634
634
|
name = "pkg-config"
|
|
635
|
-
version = "0.3.
|
|
635
|
+
version = "0.3.34"
|
|
636
636
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
637
|
-
checksum = "
|
|
637
|
+
checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548"
|
|
638
638
|
|
|
639
639
|
[[package]]
|
|
640
640
|
name = "portable-atomic"
|
|
@@ -897,6 +897,7 @@ dependencies = [
|
|
|
897
897
|
"http",
|
|
898
898
|
"http-body-util",
|
|
899
899
|
"hyper",
|
|
900
|
+
"libc",
|
|
900
901
|
"md-5",
|
|
901
902
|
"pin-project-lite",
|
|
902
903
|
"pyo3",
|
|
@@ -49,13 +49,14 @@ bytes = { version = "1", optional = true }
|
|
|
49
49
|
futures-util = { version = "0.3", default-features = false, features = ["std"], optional = true }
|
|
50
50
|
tokio = { version = "1", features = ["rt-multi-thread", "net", "time", "macros", "sync", "io-util"], optional = true }
|
|
51
51
|
pin-project-lite = { version = "0.2", optional = true }
|
|
52
|
+
libc = { version = "0.2", optional = true }
|
|
52
53
|
|
|
53
54
|
[features]
|
|
54
55
|
default = ["transport"]
|
|
55
56
|
extension-module = ["pyo3/extension-module"]
|
|
56
57
|
transport = [
|
|
57
58
|
"boring", "boring-sys", "foreign-types", "brotli-decompressor", "flate2", "zstd", "tokio-boring", "h2", "hyper", "http-body-util", "http", "bytes",
|
|
58
|
-
"futures-util", "tokio", "pin-project-lite",
|
|
59
|
+
"futures-util", "tokio", "pin-project-lite", "libc",
|
|
59
60
|
]
|
|
60
61
|
|
|
61
62
|
[patch.crates-io]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: stealthhttp
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.9.2
|
|
4
4
|
Classifier: Development Status :: 3 - Alpha
|
|
5
5
|
Classifier: Intended Audience :: Developers
|
|
6
6
|
Classifier: License :: OSI Approved :: MIT License
|
|
@@ -9,12 +9,15 @@ Classifier: Programming Language :: Rust
|
|
|
9
9
|
Classifier: Topic :: Internet :: WWW/HTTP
|
|
10
10
|
Requires-Dist: wreq>=2.0 ; extra == 'all'
|
|
11
11
|
Requires-Dist: curl-cffi>=0.7 ; extra == 'all'
|
|
12
|
+
Requires-Dist: certifi ; extra == 'all'
|
|
13
|
+
Requires-Dist: certifi ; extra == 'certs'
|
|
12
14
|
Requires-Dist: curl-cffi>=0.7 ; extra == 'curl'
|
|
13
15
|
Requires-Dist: pytest>=7.0 ; extra == 'dev'
|
|
14
16
|
Requires-Dist: pytest-asyncio>=0.23 ; extra == 'dev'
|
|
15
17
|
Requires-Dist: maturin>=1.5 ; extra == 'dev'
|
|
16
18
|
Requires-Dist: wreq>=2.0 ; extra == 'wreq'
|
|
17
19
|
Provides-Extra: all
|
|
20
|
+
Provides-Extra: certs
|
|
18
21
|
Provides-Extra: curl
|
|
19
22
|
Provides-Extra: dev
|
|
20
23
|
Provides-Extra: wreq
|
|
@@ -7,7 +7,7 @@ build-backend = "maturin"
|
|
|
7
7
|
|
|
8
8
|
[project]
|
|
9
9
|
name = "stealthhttp"
|
|
10
|
-
version = "0.
|
|
10
|
+
version = "0.9.2"
|
|
11
11
|
description = "HTTP with TLS fingerprint impersonation, rotation and proxy health tracking"
|
|
12
12
|
readme = "README.md"
|
|
13
13
|
requires-python = ">=3.9"
|
|
@@ -27,7 +27,8 @@ dependencies = []
|
|
|
27
27
|
# At least one transport backend is required at runtime.
|
|
28
28
|
wreq = ["wreq>=2.0"]
|
|
29
29
|
curl = ["curl_cffi>=0.7"]
|
|
30
|
-
|
|
30
|
+
certs = ["certifi"]
|
|
31
|
+
all = ["wreq>=2.0", "curl_cffi>=0.7", "certifi"]
|
|
31
32
|
dev = ["pytest>=7.0", "pytest-asyncio>=0.23", "maturin>=1.5"]
|
|
32
33
|
|
|
33
34
|
[tool.maturin]
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from stealthhttp import Session
|
|
4
4
|
|
|
5
|
-
s = Session(browser="
|
|
5
|
+
s = Session(browser="chrome151", proxy="http://user:pass@ip:port")
|
|
6
6
|
r = s.get("https://example.com", timeout=15)
|
|
7
7
|
print(r.status_code, r.text)
|
|
8
8
|
|
|
@@ -116,7 +116,13 @@ from .response_decoder import ContentDecoder, CharsetDetector, EncodingNegotiato
|
|
|
116
116
|
from .fingerprint_diff import FingerprintDiff, format_diff, similarity_score
|
|
117
117
|
from .cdp_transport import CdpSession
|
|
118
118
|
from .cdp_solver import StealthBrowser, find_chrome, solve_challenge as cdp_solve
|
|
119
|
-
|
|
119
|
+
try:
|
|
120
|
+
from .auto_bypass import AutoSession, BypassLearner, StrategyRecord, STRATEGIES
|
|
121
|
+
except ImportError:
|
|
122
|
+
AutoSession = None # type: ignore[assignment,misc]
|
|
123
|
+
BypassLearner = None # type: ignore[assignment,misc]
|
|
124
|
+
StrategyRecord = None # type: ignore[assignment,misc]
|
|
125
|
+
STRATEGIES = {} # type: ignore[assignment]
|
|
120
126
|
from .site_recipes import SiteRecipe, get_recipe, apply_recipe, RECIPES
|
|
121
127
|
from .forms import Form, FormField, FormExtractor, fill_form, submit_form
|
|
122
128
|
from .graphql import GraphQLClient, GraphQLResponse, GraphQLError
|
|
@@ -154,8 +160,9 @@ from .dns_tunnel import DNSTunnel, DoHRelay, EDNSClientSubnet, DNSCache, DNSReco
|
|
|
154
160
|
from .replay_attack import ReplayAttackDetector, RequestMutator, ReplayProtection, detect_replay_protection, mutate_request
|
|
155
161
|
from .browser_fsm import BrowserStateMachine, NavigationFSM, BrowserState, StateTransition
|
|
156
162
|
from .quic_fingerprint import QUICProfile, AltSvcTracker, QUICFingerprint, H3Negotiator, quic_fingerprint, parse_alt_svc, should_use_h3
|
|
163
|
+
from .auto_update import latest_chrome, auto_update, latest_profile, check_outdated
|
|
157
164
|
|
|
158
|
-
__version__ = "0.
|
|
165
|
+
__version__ = "0.9.2"
|
|
159
166
|
|
|
160
167
|
__all__ = [
|
|
161
168
|
"Session", "Response", "ProxyPool", "CookieJar", "Cookie",
|
|
@@ -266,12 +273,50 @@ __all__ = [
|
|
|
266
273
|
# v0.6.0: QUIC fingerprint intelligence
|
|
267
274
|
"QUICProfile", "AltSvcTracker", "QUICFingerprint", "H3Negotiator",
|
|
268
275
|
"quic_fingerprint", "parse_alt_svc", "should_use_h3",
|
|
276
|
+
# v0.9.0: auto-update
|
|
277
|
+
"latest_chrome", "auto_update", "latest_profile", "check_outdated",
|
|
269
278
|
# module-level verbs
|
|
270
279
|
"request", "get", "post", "put", "patch", "delete", "head", "options",
|
|
280
|
+
"quick_get", "quick_post",
|
|
271
281
|
]
|
|
272
282
|
|
|
283
|
+
import threading as _threading
|
|
284
|
+
_quick_lock = _threading.Lock()
|
|
285
|
+
_quick_sessions: dict[str, Session] = {}
|
|
273
286
|
|
|
274
|
-
|
|
287
|
+
|
|
288
|
+
def _quick_session(proxy: str | None = None, browser: str = "chrome151",
|
|
289
|
+
verify: bool = True) -> Session:
|
|
290
|
+
key = f"{browser}|{proxy or ''}|{verify}"
|
|
291
|
+
s = _quick_sessions.get(key)
|
|
292
|
+
if s is not None and not s._closed:
|
|
293
|
+
return s
|
|
294
|
+
with _quick_lock:
|
|
295
|
+
s = _quick_sessions.get(key)
|
|
296
|
+
if s is not None and not s._closed:
|
|
297
|
+
return s
|
|
298
|
+
s = Session(browser=browser, proxy=proxy, verify=verify,
|
|
299
|
+
auto_bypass=False, detect_bans=False,
|
|
300
|
+
cache=False, referer_chain=False)
|
|
301
|
+
_quick_sessions[key] = s
|
|
302
|
+
return s
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
def quick_get(url: str, *, proxy: str | None = None,
|
|
306
|
+
browser: str = "chrome151", verify: bool = True,
|
|
307
|
+
timeout: float = 15, **kw: Any) -> Response:
|
|
308
|
+
"""Lightweight GET — reuses a shared session, skips bypass/cache/ban detection."""
|
|
309
|
+
return _quick_session(proxy, browser, verify).get(url, timeout=timeout, **kw)
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
def quick_post(url: str, *, proxy: str | None = None,
|
|
313
|
+
browser: str = "chrome151", verify: bool = True,
|
|
314
|
+
timeout: float = 15, **kw: Any) -> Response:
|
|
315
|
+
"""Lightweight POST — reuses a shared session, skips bypass/cache/ban detection."""
|
|
316
|
+
return _quick_session(proxy, browser, verify).post(url, timeout=timeout, **kw)
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
def request(method: str, url: str, *, browser: str = "chrome151", **kw: Any) -> Response:
|
|
275
320
|
"""One-shot request. Prefer a :class:`Session` for anything repeated —
|
|
276
321
|
it reuses connections and keeps cookies."""
|
|
277
322
|
session_keys = (
|
|
@@ -167,6 +167,7 @@ def _h2_priority(family: str) -> tuple[int, int, bool]:
|
|
|
167
167
|
_GREASE_CHARS = [" ", "(", ")", "-", ".", "/", ":", ";", "=", "?", "_"]
|
|
168
168
|
_BRAND_ORDERS = [[0, 1, 2], [0, 2, 1], [1, 0, 2], [1, 2, 0], [2, 0, 1], [2, 1, 0]]
|
|
169
169
|
|
|
170
|
+
_GREASE_VERSIONS = ["8", "99", "24"]
|
|
170
171
|
_BRAND_NAME = {"edge": "Microsoft Edge", "opera": "Opera", "chrome": "Google Chrome"}
|
|
171
172
|
|
|
172
173
|
|
|
@@ -176,7 +177,7 @@ def sec_ch_ua(family: str, major: int) -> str | None:
|
|
|
176
177
|
return None
|
|
177
178
|
i = major % 11
|
|
178
179
|
greasey = f"Not{_GREASE_CHARS[i]}A{_GREASE_CHARS[(i + 1) % 11]}Brand"
|
|
179
|
-
greasey_version =
|
|
180
|
+
greasey_version = _GREASE_VERSIONS[major % 3]
|
|
180
181
|
brand = _BRAND_NAME.get(family, "Google Chrome")
|
|
181
182
|
|
|
182
183
|
order = _BRAND_ORDERS[major % 6]
|
|
@@ -229,7 +230,10 @@ _CHROME_BUILDS: dict[int, str] = {
|
|
|
229
230
|
131: "131.0.6778.109", 132: "132.0.6834.83", 133: "133.0.6943.98",
|
|
230
231
|
134: "134.0.6998.165", 135: "135.0.7049.84", 136: "136.0.7103.99",
|
|
231
232
|
137: "137.0.7151.69", 138: "138.0.7204.93", 139: "139.0.7259.58",
|
|
232
|
-
140: "140.0.7314.50", 141: "141.0.7369.99",
|
|
233
|
+
140: "140.0.7314.50", 141: "141.0.7369.99", 142: "142.0.7424.82",
|
|
234
|
+
143: "143.0.7479.65", 144: "144.0.7534.73", 145: "145.0.7589.91",
|
|
235
|
+
146: "146.0.7644.68", 147: "147.0.7699.54", 148: "148.0.7754.87",
|
|
236
|
+
149: "149.0.7809.70", 150: "150.0.7864.56", 151: "151.0.7919.90",
|
|
233
237
|
}
|
|
234
238
|
|
|
235
239
|
|
|
@@ -8,7 +8,6 @@ from pathlib import Path
|
|
|
8
8
|
from typing import Any
|
|
9
9
|
from urllib.parse import urlsplit
|
|
10
10
|
|
|
11
|
-
from .cdp_solver import StealthBrowser, find_chrome
|
|
12
11
|
from .proxy import detect_ban
|
|
13
12
|
from .response import Response
|
|
14
13
|
from .session import Session
|
|
@@ -17,18 +16,28 @@ log = logging.getLogger(__name__)
|
|
|
17
16
|
_BLOCK_STATUSES = frozenset({403, 429, 503})
|
|
18
17
|
|
|
19
18
|
STRATEGIES = (
|
|
20
|
-
"header_variation", "
|
|
21
|
-
"
|
|
19
|
+
"warm_visit", "header_variation", "sensor_submit", "captcha_solve",
|
|
20
|
+
"browser_switch", "proxy_rotate", "delay_long", "useragent_downgrade",
|
|
22
21
|
)
|
|
23
22
|
|
|
23
|
+
_WARM_PATHS: dict[str, list[str]] = {
|
|
24
|
+
"ebay.com": ["/deals", "/sch/i.html?_nkw=test"],
|
|
25
|
+
"ebay.de": ["/deals"],
|
|
26
|
+
"ebay.co.uk": ["/deals"],
|
|
27
|
+
"ebay.fr": ["/deals"],
|
|
28
|
+
"reddit.com": ["/r/all/.rss", "/.well-known/security.txt"],
|
|
29
|
+
"www.reddit.com": ["/r/all/.rss", "/.well-known/security.txt"],
|
|
30
|
+
}
|
|
31
|
+
|
|
24
32
|
_WAF_PRIORS: dict[str, tuple[str, ...]] = {
|
|
25
|
-
"cloudflare": ("
|
|
26
|
-
"akamai": ("
|
|
27
|
-
"datadome": ("
|
|
28
|
-
"perimeterx": ("
|
|
29
|
-
"imperva": ("header_variation", "
|
|
30
|
-
"kasada": ("
|
|
31
|
-
"shape": ("
|
|
33
|
+
"cloudflare": ("warm_visit", "sensor_submit", "captcha_solve", "browser_switch", "header_variation", "delay_long"),
|
|
34
|
+
"akamai": ("warm_visit", "sensor_submit", "header_variation", "browser_switch"),
|
|
35
|
+
"datadome": ("sensor_submit", "captcha_solve", "warm_visit", "header_variation", "proxy_rotate"),
|
|
36
|
+
"perimeterx": ("sensor_submit", "captcha_solve", "warm_visit", "browser_switch", "header_variation"),
|
|
37
|
+
"imperva": ("header_variation", "warm_visit", "browser_switch", "proxy_rotate"),
|
|
38
|
+
"kasada": ("sensor_submit", "warm_visit", "browser_switch", "proxy_rotate"),
|
|
39
|
+
"shape": ("warm_visit", "browser_switch", "header_variation", "sensor_submit"),
|
|
40
|
+
"reddit": ("warm_visit", "header_variation", "browser_switch", "delay_long"),
|
|
32
41
|
}
|
|
33
42
|
|
|
34
43
|
|
|
@@ -209,6 +218,7 @@ class BypassLearner:
|
|
|
209
218
|
("imperva", "incapsula" in srv or b"reese84" in body[:8192]),
|
|
210
219
|
("kasada", b"ips.js" in b4k or b"kpsdk" in b4k),
|
|
211
220
|
("shape", b"boa.js" in b4k or "shape" in srv),
|
|
221
|
+
("reddit", "snooserv" in srv),
|
|
212
222
|
("ratelimit", status == 429),
|
|
213
223
|
]
|
|
214
224
|
return next((n for n, c in checks if c), None)
|
|
@@ -226,6 +236,8 @@ class AutoSession(Session):
|
|
|
226
236
|
max_retries: int = 3,
|
|
227
237
|
learner: BypassLearner | None = None,
|
|
228
238
|
learner_db: str | Path | None = None,
|
|
239
|
+
solver_key: str | None = None,
|
|
240
|
+
solver_provider: str | None = None,
|
|
229
241
|
**kwargs: Any,
|
|
230
242
|
) -> None:
|
|
231
243
|
kwargs.setdefault("auto_bypass", True)
|
|
@@ -238,6 +250,7 @@ class AutoSession(Session):
|
|
|
238
250
|
self._learner = BypassLearner(db_path=learner_db)
|
|
239
251
|
else:
|
|
240
252
|
self._learner = BypassLearner()
|
|
253
|
+
self._init_solver(solver_key, solver_provider)
|
|
241
254
|
|
|
242
255
|
@property
|
|
243
256
|
def learner(self) -> BypassLearner:
|
|
@@ -330,15 +343,12 @@ class AutoSession(Session):
|
|
|
330
343
|
return r.response if r.success and r.response else None
|
|
331
344
|
|
|
332
345
|
def _strat_cookie_replay(self, _resp, method, url, _bkw, kw) -> Response | None:
|
|
333
|
-
|
|
334
|
-
cookies = self._try_cdp_solve(url)
|
|
335
|
-
if not cookies: return None
|
|
336
|
-
return self._bypass_request(method, url, **{**kw, "cookies": {**(kw.get("cookies") or {}), **cookies}})
|
|
346
|
+
return None
|
|
337
347
|
|
|
338
348
|
def _strat_browser_switch(self, resp, method, url, bkw, kw) -> Response | None:
|
|
339
349
|
cur = kw.get("browser") or self._browsers[0]
|
|
340
350
|
if len(self._browsers) < 2:
|
|
341
|
-
alt = "firefox128" if "chrome" in cur else "
|
|
351
|
+
alt = "firefox128" if "chrome" in cur else "chrome151"
|
|
342
352
|
else:
|
|
343
353
|
alt = next((b for b in self._browsers if b != cur), cur)
|
|
344
354
|
p = self.profile(alt)
|
|
@@ -356,16 +366,88 @@ class AutoSession(Session):
|
|
|
356
366
|
time.sleep(random.uniform(30.0, 60.0))
|
|
357
367
|
return self._bypass_request(method, url, **kw)
|
|
358
368
|
|
|
359
|
-
def
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
+
def _strat_warm_visit(self, _resp, method, url, _bkw, kw) -> Response | None:
|
|
370
|
+
host = urlsplit(url).hostname or ""
|
|
371
|
+
domain = host.lstrip("www.")
|
|
372
|
+
paths = _WARM_PATHS.get(domain, [])
|
|
373
|
+
if not paths:
|
|
374
|
+
paths = ["/robots.txt", "/favicon.ico", "/sitemap.xml"]
|
|
375
|
+
origin = f"{urlsplit(url).scheme}://{urlsplit(url).netloc}"
|
|
376
|
+
for path in paths:
|
|
377
|
+
warm_url = f"{origin}{path}" if path.startswith("/") else path
|
|
378
|
+
try:
|
|
379
|
+
wr = self._bypass_request("GET", warm_url, timeout=15)
|
|
380
|
+
if wr.status_code < 400:
|
|
381
|
+
time.sleep(random.uniform(0.5, 1.5))
|
|
382
|
+
r = self._bypass_request(method, url, **kw)
|
|
383
|
+
if not self._is_blocked(r):
|
|
384
|
+
return r
|
|
385
|
+
except Exception:
|
|
386
|
+
continue
|
|
387
|
+
return None
|
|
388
|
+
|
|
389
|
+
def _strat_sensor_submit(self, resp, method, url, _bkw, kw) -> Response | None:
|
|
390
|
+
r = self.bypass.attempt(self._bypass_request, url, resp, self.jsenv,
|
|
391
|
+
user_agent=self.profile(kw.get("browser") or self._browsers[0]).user_agent,
|
|
392
|
+
**{k: v for k, v in kw.items()
|
|
393
|
+
if k in ("headers", "timeout", "kind", "verify", "resolve", "browser")})
|
|
394
|
+
return r.response if r.success and r.response else None
|
|
395
|
+
|
|
396
|
+
def _init_solver(self, key: str | None, provider: str | None) -> None:
|
|
397
|
+
import os
|
|
398
|
+
if key or provider:
|
|
399
|
+
self._attach_solver(key or "", provider or "capsolver")
|
|
400
|
+
return
|
|
401
|
+
for env, prov in (("CAPSOLVER_API_KEY", "capsolver"),
|
|
402
|
+
("ANTICAPTCHA_API_KEY", "anti-captcha"),
|
|
403
|
+
("TWOCAPTCHA_API_KEY", "2captcha")):
|
|
404
|
+
k = os.environ.get(env)
|
|
405
|
+
if k:
|
|
406
|
+
self._attach_solver(k, prov)
|
|
407
|
+
return
|
|
408
|
+
|
|
409
|
+
def _attach_solver(self, key: str, provider: str) -> None:
|
|
410
|
+
try:
|
|
411
|
+
from .solving.providers import (
|
|
412
|
+
CapsolverProvider, AntiCaptchaProvider, TwoCaptchaProvider)
|
|
413
|
+
from .bypasses.solver import CaptchaSolver
|
|
414
|
+
providers = {"capsolver": CapsolverProvider,
|
|
415
|
+
"anti-captcha": AntiCaptchaProvider,
|
|
416
|
+
"2captcha": TwoCaptchaProvider}
|
|
417
|
+
cls = providers.get(provider)
|
|
418
|
+
if not cls:
|
|
419
|
+
return
|
|
420
|
+
prov = cls(api_key=key, session=self)
|
|
421
|
+
def _solve_cb(ch):
|
|
422
|
+
from .captcha import Vendor
|
|
423
|
+
vendor_map = {"turnstile": Vendor.TURNSTILE,
|
|
424
|
+
"hcaptcha": Vendor.HCAPTCHA,
|
|
425
|
+
"recaptcha": Vendor.RECAPTCHA_V2,
|
|
426
|
+
"datadome": Vendor.HCAPTCHA}
|
|
427
|
+
v = vendor_map.get(ch.captcha_type)
|
|
428
|
+
if not v or v not in prov.capabilities():
|
|
429
|
+
return None
|
|
430
|
+
from .solving.base import Task
|
|
431
|
+
task = Task(vendor=v, website_url=ch.page_url,
|
|
432
|
+
website_key=ch.sitekey or None,
|
|
433
|
+
action=ch.action or None)
|
|
434
|
+
result = prov.solve(task)
|
|
435
|
+
return result.token if result else None
|
|
436
|
+
solver = CaptchaSolver(callback=_solve_cb)
|
|
437
|
+
self.bypass.solver = solver
|
|
438
|
+
except Exception:
|
|
439
|
+
log.debug("solver init failed for %s", provider, exc_info=True)
|
|
440
|
+
|
|
441
|
+
def _strat_captcha_solve(self, resp, method, url, _bkw, kw) -> Response | None:
|
|
442
|
+
solver = getattr(self.bypass, "solver", None)
|
|
443
|
+
if solver is None or not solver.can_solve():
|
|
444
|
+
return None
|
|
445
|
+
ok, final, detail = solver.attempt_with_solver(
|
|
446
|
+
self._bypass_request, url, resp, self.jsenv,
|
|
447
|
+
vendor=self.bypass.detect_vendor(
|
|
448
|
+
resp.status_code, resp.headers, resp.content,
|
|
449
|
+
cookies=getattr(resp, "cookies", None)) or "")
|
|
450
|
+
return final if ok else None
|
|
369
451
|
|
|
370
452
|
def _strat_useragent_downgrade(self, _resp, method, url, _bkw, kw) -> Response | None:
|
|
371
453
|
ua = self.profile(kw.get("browser") or self._browsers[0]).user_agent
|
|
@@ -374,23 +456,6 @@ class AutoSession(Session):
|
|
|
374
456
|
hdrs = {**(kw.get("headers") or {}), "user-agent": ua}
|
|
375
457
|
return self._bypass_request(method, url, **{**kw, "headers": hdrs})
|
|
376
458
|
|
|
377
|
-
def _try_cdp_solve(self, url: str) -> dict[str, str]:
|
|
378
|
-
if not find_chrome():
|
|
379
|
-
return {}
|
|
380
|
-
host = urlsplit(url).hostname or ""
|
|
381
|
-
try:
|
|
382
|
-
proxy = self.proxies.acquire(host)
|
|
383
|
-
except Exception:
|
|
384
|
-
proxy = None
|
|
385
|
-
try:
|
|
386
|
-
with StealthBrowser(
|
|
387
|
-
profile=self._browsers[0], proxy=proxy,
|
|
388
|
-
) as browser:
|
|
389
|
-
return browser.solve(url)
|
|
390
|
-
except Exception:
|
|
391
|
-
log.debug("CDP solve failed for %s", url, exc_info=True)
|
|
392
|
-
return {}
|
|
393
|
-
|
|
394
459
|
def _try_replay_bypass(self, method: str, url: str,
|
|
395
460
|
resp: Response, **kwargs) -> Response | None:
|
|
396
461
|
try:
|
|
@@ -417,28 +482,3 @@ class AutoSession(Session):
|
|
|
417
482
|
return retry_resp
|
|
418
483
|
return None
|
|
419
484
|
|
|
420
|
-
def _try_cdp_fetch(self, url: str, method: str, **kwargs) -> Response | None:
|
|
421
|
-
if not find_chrome():
|
|
422
|
-
return None
|
|
423
|
-
host = urlsplit(url).hostname or ""
|
|
424
|
-
try:
|
|
425
|
-
proxy = self.proxies.acquire(host)
|
|
426
|
-
except Exception:
|
|
427
|
-
proxy = None
|
|
428
|
-
try:
|
|
429
|
-
with StealthBrowser(profile=self._browsers[0], proxy=proxy) as browser:
|
|
430
|
-
result = browser.solve_and_fetch(
|
|
431
|
-
url, method=method, headers=kwargs.get("headers"),
|
|
432
|
-
)
|
|
433
|
-
if not result or "s" not in result:
|
|
434
|
-
return None
|
|
435
|
-
return Response(
|
|
436
|
-
url=result.get("u", url),
|
|
437
|
-
status_code=result["s"],
|
|
438
|
-
content=result.get("b", "").encode("utf-8", "replace"),
|
|
439
|
-
headers=result.get("h", {}),
|
|
440
|
-
cookies=result.get("cookies", {}),
|
|
441
|
-
)
|
|
442
|
-
except Exception:
|
|
443
|
-
log.debug("CDP fetch failed for %s", url, exc_info=True)
|
|
444
|
-
return None
|
|
@@ -13,31 +13,31 @@ from typing import Dict, List, Optional, Tuple
|
|
|
13
13
|
# ---------------------------------------------------------------------------
|
|
14
14
|
|
|
15
15
|
WAF_PREFERENCES: Dict[str, List[str]] = {
|
|
16
|
-
"cloudflare": ["
|
|
17
|
-
"akamai": ["
|
|
18
|
-
"datadome": ["
|
|
19
|
-
"perimeterx": ["
|
|
20
|
-
"imperva": ["
|
|
21
|
-
"kasada": ["
|
|
22
|
-
"shape": ["
|
|
16
|
+
"cloudflare": ["chrome151", "chrome150"],
|
|
17
|
+
"akamai": ["chrome151", "edge151"],
|
|
18
|
+
"datadome": ["chrome151", "firefox148"],
|
|
19
|
+
"perimeterx": ["chrome150", "safari18_5"],
|
|
20
|
+
"imperva": ["chrome151", "firefox147"],
|
|
21
|
+
"kasada": ["chrome151"],
|
|
22
|
+
"shape": ["chrome151", "edge151"],
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
COUNTRY_PREFERENCES: Dict[str, List[str]] = {
|
|
26
|
-
"US": ["
|
|
27
|
-
"JP": ["
|
|
28
|
-
"DE": ["
|
|
29
|
-
"CN": ["
|
|
30
|
-
"RU": ["
|
|
31
|
-
"BR": ["
|
|
32
|
-
"KR": ["
|
|
26
|
+
"US": ["chrome151", "edge151", "safari18_5"],
|
|
27
|
+
"JP": ["chrome151", "safari18_5"],
|
|
28
|
+
"DE": ["firefox148", "chrome151"],
|
|
29
|
+
"CN": ["chrome150", "edge151"],
|
|
30
|
+
"RU": ["chrome151", "firefox148"],
|
|
31
|
+
"BR": ["chrome151", "chrome150"],
|
|
32
|
+
"KR": ["chrome151", "edge151"],
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
_DEFAULT_PROFILES: List[str] = [
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
36
|
+
"chrome151",
|
|
37
|
+
"chrome150",
|
|
38
|
+
"firefox148",
|
|
39
|
+
"firefox147",
|
|
40
|
+
"edge151",
|
|
41
41
|
"safari18_5",
|
|
42
42
|
]
|
|
43
43
|
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"""Browser profile auto-update.
|
|
2
|
+
|
|
3
|
+
Fetches the latest stable Chrome version from Google's version API and
|
|
4
|
+
updates the module-level default so stealthhttp always uses the freshest
|
|
5
|
+
fingerprint without manual code changes.
|
|
6
|
+
|
|
7
|
+
from stealthhttp.auto_update import latest_chrome, auto_update
|
|
8
|
+
|
|
9
|
+
print(latest_chrome()) # e.g. 151
|
|
10
|
+
auto_update() # sets DEFAULT_BROWSER = "chrome151"
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
import json
|
|
16
|
+
import os
|
|
17
|
+
import time
|
|
18
|
+
import urllib.request
|
|
19
|
+
from pathlib import Path
|
|
20
|
+
from typing import Optional
|
|
21
|
+
|
|
22
|
+
_CHROME_VERSIONS_URL = (
|
|
23
|
+
"https://versionhistory.googleapis.com/v1/chrome/platforms/win/channels/stable/versions"
|
|
24
|
+
)
|
|
25
|
+
_CHROMIUM_DASH_URL = (
|
|
26
|
+
"https://chromiumdash.appspot.com/fetch/milestones"
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
_CACHE_FILE = Path(__file__).parent / ".latest_chrome"
|
|
30
|
+
_CACHE_TTL = 86400
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _fetch_latest_major() -> int | None:
|
|
34
|
+
"""Query Google's version API for the current stable Chrome major."""
|
|
35
|
+
for url in (_CHROME_VERSIONS_URL, _CHROMIUM_DASH_URL):
|
|
36
|
+
try:
|
|
37
|
+
req = urllib.request.Request(url, headers={"Accept": "application/json"})
|
|
38
|
+
with urllib.request.urlopen(req, timeout=10) as resp:
|
|
39
|
+
data = json.loads(resp.read())
|
|
40
|
+
if isinstance(data, dict) and "versions" in data:
|
|
41
|
+
ver = data["versions"][0]["version"]
|
|
42
|
+
return int(ver.split(".")[0])
|
|
43
|
+
if isinstance(data, list) and data:
|
|
44
|
+
milestones = sorted(data, key=lambda m: m.get("milestone", 0), reverse=True)
|
|
45
|
+
return int(milestones[0]["milestone"])
|
|
46
|
+
except Exception:
|
|
47
|
+
continue
|
|
48
|
+
return None
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def _read_cache() -> tuple[int | None, float]:
|
|
52
|
+
"""Read cached version. Returns (major, timestamp)."""
|
|
53
|
+
try:
|
|
54
|
+
text = _CACHE_FILE.read_text().strip()
|
|
55
|
+
parts = text.split(":")
|
|
56
|
+
return int(parts[0]), float(parts[1])
|
|
57
|
+
except Exception:
|
|
58
|
+
return None, 0.0
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def _write_cache(major: int) -> None:
|
|
62
|
+
try:
|
|
63
|
+
_CACHE_FILE.write_text(f"{major}:{time.time():.0f}")
|
|
64
|
+
except Exception:
|
|
65
|
+
pass
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def latest_chrome(*, force_refresh: bool = False) -> int:
|
|
69
|
+
"""Return the latest stable Chrome major version.
|
|
70
|
+
|
|
71
|
+
Uses a 24h file cache to avoid hitting Google on every import.
|
|
72
|
+
Falls back to the hardcoded default if the network is unavailable.
|
|
73
|
+
"""
|
|
74
|
+
cached, ts = _read_cache()
|
|
75
|
+
if not force_refresh and cached and (time.time() - ts) < _CACHE_TTL:
|
|
76
|
+
return cached
|
|
77
|
+
|
|
78
|
+
fetched = _fetch_latest_major()
|
|
79
|
+
if fetched:
|
|
80
|
+
_write_cache(fetched)
|
|
81
|
+
return fetched
|
|
82
|
+
|
|
83
|
+
return cached or 151
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
def auto_update() -> str:
|
|
87
|
+
"""Fetch the latest Chrome version and update DEFAULT_BROWSER globally.
|
|
88
|
+
|
|
89
|
+
Returns the new default browser string (e.g. "chrome152").
|
|
90
|
+
"""
|
|
91
|
+
major = latest_chrome(force_refresh=True)
|
|
92
|
+
new_default = f"chrome{major}"
|
|
93
|
+
|
|
94
|
+
from . import session
|
|
95
|
+
session.DEFAULT_BROWSER = new_default
|
|
96
|
+
|
|
97
|
+
return new_default
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
def latest_profile() -> str:
|
|
101
|
+
"""Return the profile string for the latest stable Chrome."""
|
|
102
|
+
return f"chrome{latest_chrome()}"
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
def check_outdated(current: str) -> Optional[str]:
|
|
106
|
+
"""If *current* profile is outdated, return the latest. Otherwise None."""
|
|
107
|
+
try:
|
|
108
|
+
if not current.startswith("chrome"):
|
|
109
|
+
return None
|
|
110
|
+
ver_str = current.replace("chrome", "")
|
|
111
|
+
current_major = int(ver_str)
|
|
112
|
+
except (ValueError, IndexError):
|
|
113
|
+
return None
|
|
114
|
+
|
|
115
|
+
latest = latest_chrome()
|
|
116
|
+
if latest > current_major:
|
|
117
|
+
return f"chrome{latest}"
|
|
118
|
+
return None
|
|
@@ -102,7 +102,7 @@ class CurlBackend:
|
|
|
102
102
|
resolve: dict | None = None, **_: Any) -> Response:
|
|
103
103
|
resolve_key = tuple(_resolve_entries(resolve)) if resolve else ()
|
|
104
104
|
session = self._session(verify, resolve_key)
|
|
105
|
-
target = self.resolve(req.profile_name or "
|
|
105
|
+
target = self.resolve(req.profile_name or "chrome151")
|
|
106
106
|
|
|
107
107
|
kwargs: dict[str, Any] = {
|
|
108
108
|
"impersonate": target,
|