stealthhttp 0.10.0__tar.gz → 0.10.1__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.
Files changed (341) hide show
  1. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/.gitignore +2 -0
  2. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/Cargo.lock +8 -8
  3. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/PKG-INFO +1 -1
  4. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/pyproject.toml +1 -1
  5. stealthhttp-0.10.1/python/stealthhttp/auto_format_update.py +137 -0
  6. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/collectors/datadome.py +12 -1
  7. stealthhttp-0.10.1/python/stealthhttp/js_bridge.py +207 -0
  8. stealthhttp-0.10.1/python/stealthhttp/js_dom_stubs.py +164 -0
  9. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/solving/native_hcaptcha.py +49 -38
  10. stealthhttp-0.10.1/python/stealthhttp/solving/native_kasada.py +159 -0
  11. stealthhttp-0.10.0/python/stealthhttp/solving/native_kasada.py +0 -310
  12. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/.cargo/config.toml +0 -0
  13. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/.github/workflows/release.yml +0 -0
  14. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/CHANGELOG.md +0 -0
  15. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/Cargo.toml +0 -0
  16. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/LICENSE +0 -0
  17. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/README.md +0 -0
  18. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/benchmarks/bench.py +0 -0
  19. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/benchmarks/bench_native.py +0 -0
  20. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/examples/basic.py +0 -0
  21. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/__init__.py +0 -0
  22. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/_fallback.py +0 -0
  23. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/_loader.py +0 -0
  24. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/_rotation.py +0 -0
  25. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/adaptive_persona.py +0 -0
  26. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/ambient.py +0 -0
  27. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/antidetect.py +0 -0
  28. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/async_session.py +0 -0
  29. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/auto_bypass.py +0 -0
  30. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/auto_profile.py +0 -0
  31. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/auto_update.py +0 -0
  32. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/backends/__init__.py +0 -0
  33. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/backends/base.py +0 -0
  34. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/backends/curl_backend.py +0 -0
  35. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/backends/native_backend.py +0 -0
  36. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/backends/wreq_backend.py +0 -0
  37. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/behavior.py +0 -0
  38. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/browser_cookies.py +0 -0
  39. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/browser_fsm.py +0 -0
  40. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/browser_pool.py +0 -0
  41. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/browsing.py +0 -0
  42. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/bypasses/__init__.py +0 -0
  43. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/bypasses/akamai.py +0 -0
  44. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/bypasses/captcha.py +0 -0
  45. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/bypasses/cloudflare.py +0 -0
  46. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/bypasses/datadome.py +0 -0
  47. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/bypasses/flow.py +0 -0
  48. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/bypasses/imperva.py +0 -0
  49. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/bypasses/kasada.py +0 -0
  50. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/bypasses/perimeterx.py +0 -0
  51. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/bypasses/shape.py +0 -0
  52. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/bypasses/solver.py +0 -0
  53. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/canvas_webgl_sim.py +0 -0
  54. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/capabilities.py +0 -0
  55. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/captcha.py +0 -0
  56. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/captcha_farm.py +0 -0
  57. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/cdp_solver.py +0 -0
  58. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/cdp_transport.py +0 -0
  59. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/challenge.py +0 -0
  60. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/challenge_vm.py +0 -0
  61. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/clienthints.py +0 -0
  62. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/coherence.py +0 -0
  63. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/collectors/__init__.py +0 -0
  64. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/collectors/akamai.py +0 -0
  65. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/collectors/imperva.py +0 -0
  66. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/collectors/kasada.py +0 -0
  67. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/collectors/perimeterx.py +0 -0
  68. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/collectors/shape.py +0 -0
  69. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/consistency.py +0 -0
  70. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/cookie_intel.py +0 -0
  71. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/cookies.py +0 -0
  72. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/cover_traffic.py +0 -0
  73. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/detection.py +0 -0
  74. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/device_db.py +0 -0
  75. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/dns_intel.py +0 -0
  76. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/dns_tunnel.py +0 -0
  77. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/doh.py +0 -0
  78. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/entropy_mask.py +0 -0
  79. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/error_analysis.py +0 -0
  80. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/exceptions.py +0 -0
  81. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/fingerprint_diff.py +0 -0
  82. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/forms.py +0 -0
  83. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/geo.py +0 -0
  84. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/graphql.py +0 -0
  85. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/h2_frames.py +0 -0
  86. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/har.py +0 -0
  87. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/header_canon.py +0 -0
  88. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/health_monitor.py +0 -0
  89. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/honeypot_oracle.py +0 -0
  90. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/hooks.py +0 -0
  91. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/hsts.py +0 -0
  92. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/httpcache.py +0 -0
  93. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/humanize.py +0 -0
  94. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/identity.py +0 -0
  95. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/immortal.py +0 -0
  96. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/js_sandbox.py +0 -0
  97. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/jsdb.py +0 -0
  98. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/jsdb_ext.py +0 -0
  99. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/jsenv.py +0 -0
  100. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/jsenv_real.py +0 -0
  101. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/jsenv_types.py +0 -0
  102. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/lifecycle.py +0 -0
  103. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/lint.py +0 -0
  104. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/mesh.py +0 -0
  105. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/middleware.py +0 -0
  106. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/multipart.py +0 -0
  107. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/parsing.py +0 -0
  108. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/poison_detect.py +0 -0
  109. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/pow.py +0 -0
  110. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/predictive_rate.py +0 -0
  111. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/prepare.py +0 -0
  112. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/proto_chameleon.py +0 -0
  113. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/proxy.py +0 -0
  114. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/proxy_scoring.py +0 -0
  115. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/quic_fingerprint.py +0 -0
  116. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/record_replay.py +0 -0
  117. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/redirect_intel.py +0 -0
  118. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/replay_attack.py +0 -0
  119. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/request_graph.py +0 -0
  120. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/resp_diff.py +0 -0
  121. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/response.py +0 -0
  122. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/response_decoder.py +0 -0
  123. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/response_intel.py +0 -0
  124. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/retry.py +0 -0
  125. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/rhythm.py +0 -0
  126. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/rotation.py +0 -0
  127. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/self_audit.py +0 -0
  128. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/selfcheck.py +0 -0
  129. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/sensors.py +0 -0
  130. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/session.py +0 -0
  131. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/session_coord.py +0 -0
  132. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/session_dna.py +0 -0
  133. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/session_ext.py +0 -0
  134. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/session_helpers.py +0 -0
  135. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/site_recipes.py +0 -0
  136. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/smart_proxy.py +0 -0
  137. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/smart_retry.py +0 -0
  138. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/solving/__init__.py +0 -0
  139. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/solving/audio.py +0 -0
  140. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/solving/base.py +0 -0
  141. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/solving/browser.py +0 -0
  142. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/solving/local.py +0 -0
  143. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/solving/native_arkose.py +0 -0
  144. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/solving/native_recaptcha.py +0 -0
  145. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/solving/native_recaptcha_v3.py +0 -0
  146. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/solving/native_turnstile.py +0 -0
  147. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/solving/orchestrator.py +0 -0
  148. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/solving/providers.py +0 -0
  149. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/solving/vision.py +0 -0
  150. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/stealth_audit.py +0 -0
  151. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/strategy.py +0 -0
  152. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/synth_fingerprint.py +0 -0
  153. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/tcp_tuning.py +0 -0
  154. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/tests/test_cdp_solver.py +0 -0
  155. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/tests/test_features_v3.py +0 -0
  156. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/tests/test_features_v3_live.py +0 -0
  157. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/tests/test_native_solvers.py +0 -0
  158. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/tests/test_v030_features.py +0 -0
  159. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/tests/test_v040_features.py +0 -0
  160. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/tests/test_v050_batch1.py +0 -0
  161. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/tests/test_v050_batch2.py +0 -0
  162. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/tests/test_v050_integrations.py +0 -0
  163. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/tests/test_v050_live.py +0 -0
  164. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/tls_clone.py +0 -0
  165. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/tls_ext.py +0 -0
  166. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/tls_intel.py +0 -0
  167. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/tls_session.py +0 -0
  168. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/traffic.py +0 -0
  169. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/traffic_morph.py +0 -0
  170. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/waf_recon.py +0 -0
  171. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/websocket.py +0 -0
  172. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/python/stealthhttp/ws_tunnel.py +0 -0
  173. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/scripts/ci_check.sh +0 -0
  174. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/src/fingerprint/headers.rs +0 -0
  175. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/src/fingerprint/ja3.rs +0 -0
  176. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/src/fingerprint/ja4.rs +0 -0
  177. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/src/fingerprint/mod.rs +0 -0
  178. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/src/fingerprint/profile.rs +0 -0
  179. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/src/lib.rs +0 -0
  180. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/src/pow.rs +0 -0
  181. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/src/proxypool.rs +0 -0
  182. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/src/rotation.rs +0 -0
  183. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/src/transport/decode.rs +0 -0
  184. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/src/transport/engine/connection.rs +0 -0
  185. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/src/transport/engine/io.rs +0 -0
  186. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/src/transport/engine/priority.rs +0 -0
  187. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/src/transport/engine.rs +0 -0
  188. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/src/transport/mod.rs +0 -0
  189. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/src/transport/tls.rs +0 -0
  190. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/tests/conftest.py +0 -0
  191. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/tests/test_audio.py +0 -0
  192. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/tests/test_bypass.py +0 -0
  193. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/tests/test_bypasses.py +0 -0
  194. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/tests/test_bypasses_live.py +0 -0
  195. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/tests/test_emulation.py +0 -0
  196. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/tests/test_features_v2.py +0 -0
  197. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/tests/test_features_v2_live.py +0 -0
  198. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/tests/test_fingerprint.py +0 -0
  199. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/tests/test_humanize.py +0 -0
  200. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/tests/test_jsemu.py +0 -0
  201. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/tests/test_jsemu_live.py +0 -0
  202. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/tests/test_live_bypass.py +0 -0
  203. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/tests/test_live_detection.py +0 -0
  204. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/tests/test_live_trust.py +0 -0
  205. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/tests/test_new_features.py +0 -0
  206. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/tests/test_policies.py +0 -0
  207. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/tests/test_routing.py +0 -0
  208. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/tests/test_session.py +0 -0
  209. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/tests/test_solving.py +0 -0
  210. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/tests/test_vision.py +0 -0
  211. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/.github/FUNDING.yml +0 -0
  212. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/.github/workflows/CI.yml +0 -0
  213. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/.gitignore +0 -0
  214. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/CHANGELOG.md +0 -0
  215. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/CONTRIBUTING.md +0 -0
  216. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/Cargo.toml +0 -0
  217. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/LICENSE +0 -0
  218. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/README.md +0 -0
  219. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/benches/main.rs +0 -0
  220. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/examples/akamai.rs +0 -0
  221. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/examples/client.rs +0 -0
  222. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/examples/server.rs +0 -0
  223. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/client.rs +0 -0
  224. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/codec/error.rs +0 -0
  225. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/codec/framed_read.rs +0 -0
  226. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/codec/framed_write.rs +0 -0
  227. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/codec/mod.rs +0 -0
  228. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/error.rs +0 -0
  229. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/ext.rs +0 -0
  230. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/frame/data.rs +0 -0
  231. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/frame/go_away.rs +0 -0
  232. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/frame/head.rs +0 -0
  233. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/frame/headers.rs +0 -0
  234. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/frame/mod.rs +0 -0
  235. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/frame/ping.rs +0 -0
  236. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/frame/priority.rs +0 -0
  237. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/frame/reason.rs +0 -0
  238. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/frame/reset.rs +0 -0
  239. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/frame/settings.rs +0 -0
  240. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/frame/stream_id.rs +0 -0
  241. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/frame/util.rs +0 -0
  242. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/frame/window_update.rs +0 -0
  243. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/fuzz_bridge.rs +0 -0
  244. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/hpack/decoder.rs +0 -0
  245. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/hpack/encoder.rs +0 -0
  246. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/hpack/header.rs +0 -0
  247. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/hpack/huffman/mod.rs +0 -0
  248. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/hpack/huffman/table.rs +0 -0
  249. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/hpack/mod.rs +0 -0
  250. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/hpack/table.rs +0 -0
  251. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/hpack/test/fixture.rs +0 -0
  252. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/hpack/test/fuzz.rs +0 -0
  253. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/hpack/test/mod.rs +0 -0
  254. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/lib.rs +0 -0
  255. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/proto/connection.rs +0 -0
  256. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/proto/error.rs +0 -0
  257. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/proto/go_away.rs +0 -0
  258. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/proto/mod.rs +0 -0
  259. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/proto/peer.rs +0 -0
  260. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/proto/ping_pong.rs +0 -0
  261. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/proto/settings.rs +0 -0
  262. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/proto/streams/buffer.rs +0 -0
  263. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/proto/streams/counts.rs +0 -0
  264. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/proto/streams/flow_control.rs +0 -0
  265. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/proto/streams/mod.rs +0 -0
  266. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/proto/streams/prioritize.rs +0 -0
  267. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/proto/streams/recv.rs +0 -0
  268. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/proto/streams/send.rs +0 -0
  269. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/proto/streams/state.rs +0 -0
  270. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/proto/streams/store.rs +0 -0
  271. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/proto/streams/stream.rs +0 -0
  272. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/proto/streams/streams.rs +0 -0
  273. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/server.rs +0 -0
  274. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/h2/src/share.rs +0 -0
  275. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/Cargo.toml +0 -0
  276. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/LICENSE +0 -0
  277. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/README.md +0 -0
  278. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/body/incoming.rs +0 -0
  279. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/body/length.rs +0 -0
  280. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/body/mod.rs +0 -0
  281. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/cfg.rs +0 -0
  282. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/client/conn/http1.rs +0 -0
  283. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/client/conn/http2.rs +0 -0
  284. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/client/conn/mod.rs +0 -0
  285. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/client/dispatch.rs +0 -0
  286. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/client/mod.rs +0 -0
  287. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/client/tests.rs +0 -0
  288. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/common/buf.rs +0 -0
  289. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/common/date.rs +0 -0
  290. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/common/either.rs +0 -0
  291. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/common/future.rs +0 -0
  292. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/common/io/compat.rs +0 -0
  293. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/common/io/mod.rs +0 -0
  294. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/common/io/rewind.rs +0 -0
  295. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/common/lock.rs +0 -0
  296. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/common/mod.rs +0 -0
  297. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/common/task.rs +0 -0
  298. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/common/time.rs +0 -0
  299. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/common/watch.rs +0 -0
  300. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/error.rs +0 -0
  301. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/ext/h1_reason_phrase.rs +0 -0
  302. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/ext/informational.rs +0 -0
  303. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/ext/mod.rs +0 -0
  304. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/ffi/body.rs +0 -0
  305. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/ffi/client.rs +0 -0
  306. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/ffi/error.rs +0 -0
  307. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/ffi/http_types.rs +0 -0
  308. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/ffi/io.rs +0 -0
  309. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/ffi/macros.rs +0 -0
  310. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/ffi/mod.rs +0 -0
  311. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/ffi/task.rs +0 -0
  312. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/headers.rs +0 -0
  313. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/lib.rs +0 -0
  314. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/mock.rs +0 -0
  315. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/proto/h1/conn.rs +0 -0
  316. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/proto/h1/decode.rs +0 -0
  317. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/proto/h1/dispatch.rs +0 -0
  318. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/proto/h1/encode.rs +0 -0
  319. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/proto/h1/io.rs +0 -0
  320. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/proto/h1/mod.rs +0 -0
  321. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/proto/h1/role.rs +0 -0
  322. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/proto/h2/client.rs +0 -0
  323. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/proto/h2/mod.rs +0 -0
  324. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/proto/h2/ping.rs +0 -0
  325. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/proto/h2/server.rs +0 -0
  326. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/proto/h2/upgrade.rs +0 -0
  327. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/proto/mod.rs +0 -0
  328. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/rt/bounds.rs +0 -0
  329. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/rt/io.rs +0 -0
  330. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/rt/mod.rs +0 -0
  331. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/rt/timer.rs +0 -0
  332. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/server/conn/http1.rs +0 -0
  333. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/server/conn/http2.rs +0 -0
  334. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/server/conn/mod.rs +0 -0
  335. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/server/mod.rs +0 -0
  336. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/service/http.rs +0 -0
  337. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/service/mod.rs +0 -0
  338. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/service/service.rs +0 -0
  339. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/service/util.rs +0 -0
  340. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/trace.rs +0 -0
  341. {stealthhttp-0.10.0 → stealthhttp-0.10.1}/vendor/hyper/src/upgrade.rs +0 -0
@@ -25,3 +25,5 @@ venv/
25
25
  .claude-flow/
26
26
  .swarm/
27
27
  .claude/
28
+ python/stealthhttp/.ddv_version
29
+ python/stealthhttp/.latest_chrome
@@ -85,9 +85,9 @@ dependencies = [
85
85
 
86
86
  [[package]]
87
87
  name = "boring"
88
- version = "5.5.1"
88
+ version = "5.6.0"
89
89
  source = "registry+https://github.com/rust-lang/crates.io-index"
90
- checksum = "4a03220c5209cb3feb5cb0516b5fd9d121fc3a6d1b9ac07f13c2a9ca5d9df4e4"
90
+ checksum = "78768ebbcd8b284d61c52e2058a4de72e61015aa2b41da2489b29a5211c7a2d5"
91
91
  dependencies = [
92
92
  "bitflags",
93
93
  "boring-sys",
@@ -98,9 +98,9 @@ dependencies = [
98
98
 
99
99
  [[package]]
100
100
  name = "boring-sys"
101
- version = "5.5.1"
101
+ version = "5.6.0"
102
102
  source = "registry+https://github.com/rust-lang/crates.io-index"
103
- checksum = "34694a68abe0d6600d51f0790e463cff05c18e8274992bdbd0839bbb5b86ec55"
103
+ checksum = "30c5445059ff90c02d95d05345f2b5f13c135150eb8ac6432ea182d47420799e"
104
104
  dependencies = [
105
105
  "bindgen",
106
106
  "cmake",
@@ -126,9 +126,9 @@ checksum = "776dfebd015e2d8732c684a2c71003674ccb49457b539b9e82151ba38e96dd7c"
126
126
 
127
127
  [[package]]
128
128
  name = "cc"
129
- version = "1.11.2"
129
+ version = "1.11.3"
130
130
  source = "registry+https://github.com/rust-lang/crates.io-index"
131
- checksum = "33ef9e3e8154a45c7a95cff4c1299702106ad94062d7bb85fdc5d3a5afd91d45"
131
+ checksum = "02f0e023adb368345ce0ca6cdfc0f24a06554468d0e8503e14a0841de79bfa69"
132
132
  dependencies = [
133
133
  "find-msvc-tools",
134
134
  "jobserver",
@@ -982,9 +982,9 @@ dependencies = [
982
982
 
983
983
  [[package]]
984
984
  name = "tokio-boring"
985
- version = "5.5.1"
985
+ version = "5.6.0"
986
986
  source = "registry+https://github.com/rust-lang/crates.io-index"
987
- checksum = "98af1e895aca8aa5c68b7c1289cb97d90f27a0b2da8c8ff8d06150d9fe43cc35"
987
+ checksum = "c708fb8a3aad6d0c88f3740dc0c62b239253112789228dd2927d09ff6ea2d8f0"
988
988
  dependencies = [
989
989
  "antidote",
990
990
  "boring",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stealthhttp
3
- Version: 0.10.0
3
+ Version: 0.10.1
4
4
  Classifier: Development Status :: 3 - Alpha
5
5
  Classifier: Intended Audience :: Developers
6
6
  Classifier: License :: OSI Approved :: MIT License
@@ -7,7 +7,7 @@ build-backend = "maturin"
7
7
 
8
8
  [project]
9
9
  name = "stealthhttp"
10
- version = "0.10.0"
10
+ version = "0.10.1"
11
11
  description = "HTTP with TLS fingerprint impersonation, rotation and proxy health tracking"
12
12
  readme = "README.md"
13
13
  requires-python = ">=3.9"
@@ -0,0 +1,137 @@
1
+ """Auto-update sensor formats from live vendor endpoints.
2
+
3
+ Anti-bot vendors (DataDome, Akamai, PX) update their challenge scripts
4
+ regularly. Hardcoded format versions go stale within weeks. This module
5
+ fetches current versions from vendor CDNs at startup and caches them.
6
+
7
+ from stealthhttp.auto_format_update import current_ddv, current_akamai_ver
8
+
9
+ ddv = current_ddv() # e.g. "5.12.1" (fetched from js.datadome.co)
10
+ ver = current_akamai_ver("https://target.com", session)
11
+
12
+ No external API — just reading the same public JS files that real browsers load.
13
+ """
14
+
15
+ from __future__ import annotations
16
+
17
+ import json
18
+ import os
19
+ import re
20
+ import time
21
+ from pathlib import Path
22
+
23
+ _CACHE_DIR = Path(__file__).parent
24
+ _CACHE_TTL = 43200 # 12 hours
25
+
26
+ _DDV_CACHE: dict[str, tuple[str, float]] = {}
27
+ _AKAMAI_CACHE: dict[str, tuple[str, float]] = {}
28
+
29
+
30
+ def current_ddv(*, session=None) -> str:
31
+ """Fetch current DataDome tags.js version from CDN.
32
+
33
+ Real browsers load this script on every DD-protected page. We read
34
+ the version from the same URL.
35
+ """
36
+ cached = _DDV_CACHE.get("ddv")
37
+ if cached and time.time() - cached[1] < _CACHE_TTL:
38
+ return cached[0]
39
+
40
+ version = "5.11.5" # fallback
41
+ try:
42
+ if session is None:
43
+ import urllib.request
44
+ req = urllib.request.Request(
45
+ "https://js.datadome.co/tags.js",
46
+ headers={"User-Agent": "Mozilla/5.0"})
47
+ with urllib.request.urlopen(req, timeout=10) as resp:
48
+ body = resp.read(2000).decode("utf-8", "replace")
49
+ else:
50
+ resp = session.get("https://js.datadome.co/tags.js", timeout=10)
51
+ body = resp.text[:2000]
52
+
53
+ m = re.search(r'version["\s:]+["\']([\d.]+)["\']', body)
54
+ if m:
55
+ version = m.group(1)
56
+ except Exception:
57
+ pass
58
+
59
+ _DDV_CACHE["ddv"] = (version, time.time())
60
+
61
+ # Persist to disk for cold starts
62
+ cache_file = _CACHE_DIR / ".ddv_version"
63
+ try:
64
+ cache_file.write_text(f"{version}\n{int(time.time())}")
65
+ except OSError:
66
+ pass
67
+
68
+ return version
69
+
70
+
71
+ def current_akamai_ver(target_url: str, session) -> str:
72
+ """Extract bmak.ver from the live Akamai sensor script on a target site.
73
+
74
+ Each site may have a different script version. The version string
75
+ is embedded in the challenge script and must be included in sensor_data.
76
+ """
77
+ cached = _AKAMAI_CACHE.get(target_url)
78
+ if cached and time.time() - cached[1] < _CACHE_TTL:
79
+ return cached[0]
80
+
81
+ version = ""
82
+ try:
83
+ resp = session.get(target_url, timeout=15)
84
+ # Find sensor script URL
85
+ scripts = re.findall(
86
+ rb'src="([^"]*(?:_sec/cp_challenge|akam/)[^"]*)"', resp.content)
87
+ for script_path in scripts[:2]:
88
+ path = script_path.decode("ascii", "replace")
89
+ if not path.startswith("http"):
90
+ from urllib.parse import urlsplit
91
+ parts = urlsplit(target_url)
92
+ path = f"{parts.scheme}://{parts.netloc}{path}"
93
+ sr = session.get(path, headers={"referer": target_url}, timeout=10)
94
+ if sr.status_code == 200:
95
+ m = re.search(r'bmak\.ver\s*=\s*["\']([^"\']+)', sr.text)
96
+ if m:
97
+ version = m.group(1)
98
+ break
99
+ except Exception:
100
+ pass
101
+
102
+ if version:
103
+ _AKAMAI_CACHE[target_url] = (version, time.time())
104
+ return version
105
+
106
+
107
+ def current_px_app_id(body: bytes) -> str:
108
+ """Extract PerimeterX app ID from page HTML."""
109
+ patterns = [
110
+ re.compile(rb'["\']appId["\']\s*:\s*["\']([A-Za-z0-9]+)["\']'),
111
+ re.compile(rb'_pxAppId\s*[=:]\s*["\']?(PX[A-Za-z0-9]{6,12})["\']?'),
112
+ ]
113
+ for p in patterns:
114
+ m = p.search(body)
115
+ if m:
116
+ return m.group(1).decode("ascii", "replace")
117
+ return ""
118
+
119
+
120
+ def invalidate_caches() -> None:
121
+ """Force re-fetch on next call."""
122
+ _DDV_CACHE.clear()
123
+ _AKAMAI_CACHE.clear()
124
+
125
+
126
+ def load_cached_ddv() -> str:
127
+ """Load DDV from disk cache (cold start, no network)."""
128
+ cache_file = _CACHE_DIR / ".ddv_version"
129
+ try:
130
+ parts = cache_file.read_text().strip().split("\n")
131
+ if len(parts) >= 2:
132
+ ver, ts = parts[0], int(parts[1])
133
+ if time.time() - ts < _CACHE_TTL * 2:
134
+ return ver
135
+ except (OSError, ValueError):
136
+ pass
137
+ return "5.11.5"
@@ -39,6 +39,17 @@ class DataDomeCollector:
39
39
  def __init__(self, cid: str = "", dd_key: str = ""):
40
40
  self.cid = cid
41
41
  self.dd_key = dd_key
42
+ self._cached_ddv: str = ""
43
+
44
+ def _ddv(self) -> str:
45
+ if self._cached_ddv:
46
+ return self._cached_ddv
47
+ try:
48
+ from ..auto_format_update import current_ddv
49
+ self._cached_ddv = current_ddv()
50
+ except Exception:
51
+ self._cached_ddv = "5.11.5"
52
+ return self._cached_ddv
42
53
 
43
54
  def generate(self, jsenv: JsEnvironment, events: InteractionSequence,
44
55
  page_url: str = "", *, timestamp: int | None = None,
@@ -57,7 +68,7 @@ class DataDomeCollector:
57
68
  "Referer": page_url,
58
69
  "request": page_url,
59
70
  "responsePage": "origin",
60
- "ddv": "5.11.5",
71
+ "ddv": self._ddv(),
61
72
  }
62
73
  return urlencode(data)
63
74
 
@@ -0,0 +1,207 @@
1
+ """QuickJS execution bridge with real HTTP networking.
2
+
3
+ Vendor challenge scripts (Kasada ips.js, CF Turnstile, Akamai challenge)
4
+ run here in QuickJS (170KB, MIT) with:
5
+ - XMLHttpRequest/fetch that proxy through stealthhttp's native transport
6
+ - DOM/navigator stubs from real device fingerprints
7
+ - Interceptors to capture tokens from outgoing requests
8
+
9
+ The JS thinks it's in a browser. Network goes through our TLS stack.
10
+
11
+ bridge = JsBridge(session, jsenv, base_url="https://target.com")
12
+ bridge.execute(vendor_js_code)
13
+ tokens = bridge.captured_headers # x-kpsdk-ct, _abck, etc.
14
+ """
15
+
16
+ from __future__ import annotations
17
+
18
+ import json
19
+ import time
20
+ from dataclasses import dataclass, field
21
+ from urllib.parse import urljoin
22
+
23
+ from .js_dom_stubs import build_dom, build_promise
24
+
25
+
26
+ def _require_quickjs():
27
+ try:
28
+ import quickjs
29
+ return quickjs
30
+ except ImportError as exc:
31
+ raise RuntimeError("JsBridge needs QuickJS: pip install quickjs") from exc
32
+
33
+
34
+ @dataclass
35
+ class CapturedRequest:
36
+ method: str = ""
37
+ url: str = ""
38
+ headers: dict[str, str] = field(default_factory=dict)
39
+ body: str = ""
40
+ timestamp: float = 0.0
41
+
42
+
43
+ _TOKEN_MARKERS = (
44
+ "kpsdk", "abck", "datadome", "clearance", "token",
45
+ "sensor", "reese", "captcha", "turnstile",
46
+ )
47
+
48
+
49
+ class JsBridge:
50
+ """QuickJS sandbox with real networking through stealthhttp Session."""
51
+
52
+ def __init__(self, session, jsenv, *, base_url: str = "",
53
+ timeout: float = 30.0, max_requests: int = 20):
54
+ self._session = session
55
+ self._jsenv = jsenv
56
+ self._base_url = base_url
57
+ self._timeout = timeout
58
+ self._max_requests = max_requests
59
+ self._request_count = 0
60
+
61
+ self.captured_requests: list[CapturedRequest] = []
62
+ self.captured_headers: dict[str, str] = {}
63
+ self.captured_cookies: dict[str, str] = {}
64
+ self.errors: list[str] = []
65
+
66
+ quickjs = _require_quickjs()
67
+ self._ctx = quickjs.Context()
68
+ self._setup()
69
+
70
+ def _setup(self) -> None:
71
+ self._ctx.add_callable("__py_xhr", self._handle_xhr)
72
+ self._ctx.add_callable("__py_log", self._handle_log)
73
+ self._ctx.eval(build_promise())
74
+ self._ctx.eval(build_dom(self._jsenv, self._base_url))
75
+ self._ctx.eval(self._xhr_js())
76
+ self._ctx.eval(self._fetch_js())
77
+ self._ctx.eval(self._console_js())
78
+
79
+ @staticmethod
80
+ def _xhr_js() -> str:
81
+ return """
82
+ function XMLHttpRequest(){
83
+ this._m='';this._u='';this._h={};this._a=true;
84
+ this.readyState=0;this.status=0;this.statusText='';
85
+ this.responseText='';this.responseType='';this.response=null;
86
+ this.onreadystatechange=null;this.onload=null;this.onerror=null;
87
+ this.withCredentials=false;this.timeout=0;
88
+ }
89
+ XMLHttpRequest.prototype.open=function(m,u,a){this._m=m;this._u=u;this._a=a!==false;this.readyState=1;if(this.onreadystatechange)this.onreadystatechange()};
90
+ XMLHttpRequest.prototype.setRequestHeader=function(k,v){this._h[k]=v};
91
+ XMLHttpRequest.prototype.send=function(b){
92
+ var r=__py_xhr(this._m,this._u,JSON.stringify(this._h),b||'');
93
+ var p=JSON.parse(r);this.status=p.status;this.statusText=p.statusText||'';
94
+ this.responseText=p.body;this.response=p.body;this.readyState=4;
95
+ if(this.onreadystatechange)this.onreadystatechange();
96
+ if(this.onload)this.onload();
97
+ };
98
+ XMLHttpRequest.prototype.abort=function(){};
99
+ XMLHttpRequest.prototype.getResponseHeader=function(){return null};
100
+ XMLHttpRequest.prototype.getAllResponseHeaders=function(){return''};
101
+ XMLHttpRequest.prototype.overrideMimeType=function(){};
102
+ """
103
+
104
+ @staticmethod
105
+ def _fetch_js() -> str:
106
+ return """
107
+ function fetch(url,opts){
108
+ opts=opts||{};var m=(opts.method||'GET').toUpperCase();
109
+ var h=opts.headers||{};var b=opts.body||'';
110
+ if(typeof h.entries==='function'){var o={};h.forEach(function(v,k){o[k]=v});h=o}
111
+ var r=__py_xhr(m,typeof url==='string'?url:url.href||'',JSON.stringify(h),typeof b==='string'?b:'');
112
+ var p=JSON.parse(r);
113
+ return Promise.resolve({ok:p.status>=200&&p.status<300,status:p.status,statusText:p.statusText||'',
114
+ headers:{get:function(){return null},has:function(){return false}},
115
+ text:function(){return Promise.resolve(p.body)},
116
+ json:function(){return Promise.resolve(JSON.parse(p.body))},
117
+ arrayBuffer:function(){return Promise.resolve(new ArrayBuffer(0))},
118
+ clone:function(){return this}});
119
+ }
120
+ var Headers=function(i){this._h=i||{}};
121
+ Headers.prototype.get=function(k){return this._h[k]||null};
122
+ Headers.prototype.set=function(k,v){this._h[k]=v};
123
+ Headers.prototype.has=function(k){return k in this._h};
124
+ Headers.prototype.forEach=function(cb){for(var k in this._h)cb(this._h[k],k)};
125
+ """
126
+
127
+ @staticmethod
128
+ def _console_js() -> str:
129
+ return """
130
+ var console={log:function(){__py_log(Array.prototype.join.call(arguments,' '))},
131
+ error:function(){__py_log('ERR:'+Array.prototype.join.call(arguments,' '))},
132
+ warn:function(){},info:function(){},debug:function(){}};
133
+ """
134
+
135
+ def _handle_xhr(self, method: str, url: str, headers_json: str,
136
+ body: str) -> str:
137
+ if self._request_count >= self._max_requests:
138
+ return json.dumps({"status": 429, "body": "", "statusText": "Too Many Requests"})
139
+ self._request_count += 1
140
+
141
+ if url and not url.startswith("http"):
142
+ url = urljoin(self._base_url, url)
143
+
144
+ headers = {}
145
+ try:
146
+ headers = json.loads(headers_json) if headers_json else {}
147
+ except (json.JSONDecodeError, TypeError):
148
+ pass
149
+
150
+ cap = CapturedRequest(method=method, url=url, headers=dict(headers),
151
+ body=body, timestamp=time.time())
152
+ self.captured_requests.append(cap)
153
+
154
+ for k, v in headers.items():
155
+ if any(tok in k.lower() for tok in _TOKEN_MARKERS):
156
+ self.captured_headers[k] = v
157
+
158
+ try:
159
+ resp = self._session.request(
160
+ method, url, headers=headers,
161
+ data=body if body else None,
162
+ timeout=min(self._timeout, 15))
163
+ for k, v in (getattr(resp, "cookies", {}) or {}).items():
164
+ self.captured_cookies[k] = v
165
+ return json.dumps({
166
+ "status": resp.status_code,
167
+ "statusText": "OK" if resp.status_code == 200 else "",
168
+ "body": resp.text[:50000] if hasattr(resp, "text") else "",
169
+ })
170
+ except Exception as exc:
171
+ self.errors.append(f"XHR {method} {url}: {exc}")
172
+ return json.dumps({"status": 0, "body": "", "statusText": str(exc)})
173
+
174
+ def _handle_log(self, msg: str) -> None:
175
+ pass
176
+
177
+ def execute(self, js_code: str, *, catch_errors: bool = True) -> str | None:
178
+ try:
179
+ result = self._ctx.eval(js_code)
180
+ return str(result) if result is not None else None
181
+ except Exception as exc:
182
+ if not catch_errors:
183
+ raise
184
+ self.errors.append(f"JS: {exc}")
185
+ return None
186
+
187
+ def execute_url(self, script_url: str) -> str | None:
188
+ try:
189
+ resp = self._session.get(script_url,
190
+ headers={"referer": self._base_url},
191
+ timeout=15)
192
+ if resp.status_code == 200 and resp.text:
193
+ return self.execute(resp.text)
194
+ except Exception as exc:
195
+ self.errors.append(f"fetch+exec {script_url}: {exc}")
196
+ return None
197
+
198
+ def get_global(self, name: str) -> str | None:
199
+ try:
200
+ result = self._ctx.eval(
201
+ f"typeof {name}!=='undefined'?JSON.stringify({name}):null")
202
+ return str(result) if result is not None else None
203
+ except Exception:
204
+ return None
205
+
206
+ def close(self) -> None:
207
+ self._ctx = None
@@ -0,0 +1,164 @@
1
+ """DOM/navigator/window stubs for the QuickJS bridge.
2
+
3
+ Separated from js_bridge.py for the 500-line limit. These stubs make
4
+ vendor challenge scripts (Kasada, CF, Akamai) believe they run in a
5
+ real browser. All values come from JsEnvironment (real device data).
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ import json
11
+ import time
12
+ from urllib.parse import urlsplit
13
+
14
+
15
+ def build_dom(jsenv, base_url: str = "") -> str:
16
+ """Full DOM/navigator/window/screen stubs as JavaScript source."""
17
+ e = jsenv
18
+ s = e.screen
19
+ w = e.window
20
+ j = json.dumps
21
+ parts = urlsplit(base_url) if base_url else None
22
+ hostname = parts.hostname or "" if parts else ""
23
+ origin = f"{parts.scheme}://{parts.netloc}" if parts else ""
24
+ path = parts.path or "/" if parts else "/"
25
+ nav_langs = json.dumps(e.nav_languages)
26
+ plugins_len = len(e.plugins)
27
+ nav_ts = int(time.time() * 1000) - 5000
28
+
29
+ return f"""
30
+ var window = this; var self = this; var globalThis = this;
31
+ var document = {{
32
+ createElement: function(tag) {{
33
+ var el = {{tagName: tag.toUpperCase(), children: [], style: {{}},
34
+ childNodes: [], parentNode: null, className: '', id: '',
35
+ innerHTML: '', innerText: '', textContent: '',
36
+ setAttribute: function(k,v){{this[k]=v}},
37
+ getAttribute: function(k){{return this[k]||null}},
38
+ appendChild: function(c){{this.children.push(c);c.parentNode=this;return c}},
39
+ removeChild: function(c){{return c}},
40
+ addEventListener: function(){{}}, removeEventListener: function(){{}},
41
+ dispatchEvent: function(){{return true}},
42
+ getBoundingClientRect: function(){{return{{top:0,left:0,bottom:100,right:100,width:100,height:100,x:0,y:0}}}},
43
+ cloneNode: function(){{return document.createElement(tag)}},
44
+ querySelector: function(){{return null}},
45
+ querySelectorAll: function(){{return []}},
46
+ getElementsByTagName: function(){{return []}},
47
+ getElementsByClassName: function(){{return []}},
48
+ focus:function(){{}}, blur:function(){{}}, click:function(){{}},
49
+ }};
50
+ if(tag==='canvas'){{
51
+ el.width=300;el.height=150;
52
+ el.getContext=function(){{return{{
53
+ fillRect:function(){{}},clearRect:function(){{}},strokeRect:function(){{}},
54
+ fillText:function(){{}},strokeText:function(){{}},
55
+ measureText:function(t){{return{{width:t.length*7,actualBoundingBoxAscent:10,actualBoundingBoxDescent:2}}}},
56
+ beginPath:function(){{}},closePath:function(){{}},moveTo:function(){{}},lineTo:function(){{}},
57
+ arc:function(){{}},arcTo:function(){{}},bezierCurveTo:function(){{}},quadraticCurveTo:function(){{}},
58
+ fill:function(){{}},stroke:function(){{}},drawImage:function(){{}},putImageData:function(){{}},
59
+ getImageData:function(x,y,w,h){{return{{data:new Array(w*h*4).fill(0),width:w,height:h}}}},
60
+ createLinearGradient:function(){{return{{addColorStop:function(){{}}}}}},
61
+ createRadialGradient:function(){{return{{addColorStop:function(){{}}}}}},
62
+ createPattern:function(){{return null}},
63
+ save:function(){{}},restore:function(){{}},scale:function(){{}},rotate:function(){{}},
64
+ translate:function(){{}},transform:function(){{}},setTransform:function(){{}},
65
+ canvas:el,fillStyle:'#000',strokeStyle:'#000',lineWidth:1,
66
+ font:'10px sans-serif',textAlign:'start',textBaseline:'alphabetic',
67
+ globalAlpha:1.0,globalCompositeOperation:'source-over',
68
+ }}}};
69
+ el.toDataURL=function(){{return'data:image/png;base64,iVBOR'}};
70
+ el.toBlob=function(cb){{if(cb)cb(null)}};
71
+ }}
72
+ if(tag==='script'){{Object.defineProperty(el,'src',{{set:function(v){{this._src=v}},get:function(){{return this._src||''}}}})}}
73
+ if(tag==='iframe'){{el.contentWindow=window;el.contentDocument=document}}
74
+ return el;
75
+ }},
76
+ getElementById:function(){{return null}},
77
+ getElementsByTagName:function(t){{
78
+ if(t==='head')return[{{appendChild:function(){{}}}}];
79
+ if(t==='body')return[document.body];return[];
80
+ }},
81
+ getElementsByClassName:function(){{return[]}},
82
+ querySelector:function(s){{if(s==='head'||s==='html > head')return{{appendChild:function(){{}}}};return null}},
83
+ querySelectorAll:function(){{return[]}},
84
+ cookie:'',referrer:{j(base_url)},title:'',readyState:'complete',
85
+ visibilityState:'visible',hidden:false,
86
+ documentElement:{{clientWidth:{w.inner_width},clientHeight:{w.inner_height},getAttribute:function(){{return null}}}},
87
+ body:{{clientWidth:{w.inner_width},clientHeight:{w.inner_height},appendChild:function(c){{return c}},removeChild:function(){{}},addEventListener:function(){{}},style:{{}}}},
88
+ head:{{appendChild:function(c){{return c}}}},
89
+ addEventListener:function(){{}},removeEventListener:function(){{}},
90
+ createEvent:function(){{return{{initEvent:function(){{}}}}}},
91
+ createTextNode:function(t){{return{{textContent:t}}}},
92
+ location:{{href:{j(base_url)},hostname:{j(hostname)},protocol:'https:',pathname:{j(path)},origin:{j(origin)},search:'',hash:''}},
93
+ }};
94
+ var navigator = {{
95
+ userAgent:{j("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/158.0.0.0 Safari/537.36")},
96
+ platform:{j(e.nav_platform)},language:{j(e.nav_language)},languages:{nav_langs},
97
+ hardwareConcurrency:{e.hardware_concurrency},deviceMemory:{e.device_memory or 8},
98
+ maxTouchPoints:{e.max_touch_points},cookieEnabled:true,webdriver:false,
99
+ vendor:{j(e.nav_vendor)},appCodeName:'Mozilla',appName:'Netscape',
100
+ appVersion:'5.0 (Windows NT 10.0; Win64; x64)',product:'Gecko',productSub:'20030107',
101
+ onLine:true,pdfViewerEnabled:true,
102
+ plugins:{{length:{plugins_len}}},mimeTypes:{{length:2}},
103
+ connection:{{downlink:10,effectiveType:'4g',rtt:50,saveData:false}},
104
+ getBattery:function(){{return Promise.resolve({{charging:true,chargingTime:Infinity,dischargingTime:Infinity,level:1.0}})}},
105
+ mediaDevices:{{enumerateDevices:function(){{return Promise.resolve([])}}}},
106
+ permissions:{{query:function(){{return Promise.resolve({{state:'prompt'}})}}}},
107
+ storage:{{estimate:function(){{return Promise.resolve({{quota:1073741824,usage:0}})}}}},
108
+ sendBeacon:function(){{return true}},locks:{{request:function(){{return Promise.resolve()}}}},
109
+ }};
110
+ var screen = {{width:{s.width},height:{s.height},availWidth:{s.avail_width},availHeight:{s.avail_height},colorDepth:{s.color_depth},pixelDepth:{s.pixel_depth},orientation:{{type:'landscape-primary',angle:0}}}};
111
+ var location = document.location;
112
+ var history = {{length:2,pushState:function(){{}},replaceState:function(){{}}}};
113
+ var localStorage = {{getItem:function(){{return null}},setItem:function(){{}},removeItem:function(){{}}}};
114
+ var sessionStorage = localStorage;
115
+ var performance = {{now:function(){{return Date.now()-{nav_ts}}},timing:{{navigationStart:{nav_ts},responseStart:{nav_ts+200},responseEnd:{nav_ts+400},domInteractive:{nav_ts+800},domContentLoadedEventEnd:{nav_ts+1000},loadEventEnd:{nav_ts+1500}}},getEntriesByType:function(){{return[]}},mark:function(){{}},measure:function(){{}},getEntriesByName:function(){{return[]}}}};
116
+ var crypto = {{getRandomValues:function(a){{for(var i=0;i<a.length;i++)a[i]=Math.floor(Math.random()*256);return a}},subtle:{{digest:function(){{return Promise.resolve(new ArrayBuffer(32))}}}}}};
117
+ var TextEncoder = function(){{this.encode=function(s){{var a=[];for(var i=0;i<s.length;i++)a.push(s.charCodeAt(i)&0xff);return a}}}};
118
+ var TextDecoder = function(){{this.decode=function(a){{if(!a)return'';var s='';for(var i=0;i<a.length;i++)s+=String.fromCharCode(a[i]);return s}}}};
119
+ var atob=function(s){{var c='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';var o='';s=s.replace(/=/g,'');for(var i=0,b=0,r=0;i<s.length;i++){{b=(b<<6)|c.indexOf(s[i]);r+=6;if(r>=8){{r-=8;o+=String.fromCharCode((b>>r)&0xff)}}}}return o}};
120
+ var btoa=function(s){{var c='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';var o='';for(var i=0;i<s.length;i+=3){{var a=s.charCodeAt(i),b=i+1<s.length?s.charCodeAt(i+1):0,d=i+2<s.length?s.charCodeAt(i+2):0;o+=c[(a>>2)&63]+c[((a&3)<<4)|(b>>4)]+(i+1<s.length?c[((b&15)<<2)|(d>>6)]:'=')+(i+2<s.length?c[d&63]:'=')}}return o}};
121
+ var Uint8Array=Array;var Int8Array=Array;var Uint16Array=Array;var Int16Array=Array;var Uint32Array=Array;var Int32Array=Array;var Float32Array=Array;var Float64Array=Array;
122
+ var ArrayBuffer=function(n){{this.byteLength=n}};var DataView=function(){{this.getUint8=function(){{return 0}}}};
123
+ var Blob=function(p,o){{this.size=0;this.type=(o||{{}}).type||''}};
124
+ var URL={{createObjectURL:function(){{return'blob:null'}},revokeObjectURL:function(){{}}}};
125
+ var Worker=function(){{this.postMessage=function(){{}};this.terminate=function(){{}}}};
126
+ var MutationObserver=function(){{this.observe=function(){{}};this.disconnect=function(){{}}}};
127
+ var IntersectionObserver=function(){{this.observe=function(){{}};this.disconnect=function(){{}}}};
128
+ var ResizeObserver=function(){{this.observe=function(){{}};this.disconnect=function(){{}}}};
129
+ var MessageChannel=function(){{this.port1={{postMessage:function(){{}}}};this.port2=this.port1}};
130
+ var Image=function(){{this.src='';this.width=0;this.height=0}};
131
+ var Event=function(t){{this.type=t;this.target=null}};var CustomEvent=Event;
132
+ var _tid=0;
133
+ function setTimeout(fn,ms){{var id=++_tid;if(typeof fn==='function')try{{fn()}}catch(e){{}};return id}}
134
+ function setInterval(fn,ms){{return setTimeout(fn,ms)}}
135
+ function clearTimeout(){{}}function clearInterval(){{}}
136
+ function requestAnimationFrame(fn){{if(fn)try{{fn(performance.now())}}catch(e){{}};return 1}}
137
+ function cancelAnimationFrame(){{}}
138
+ function queueMicrotask(fn){{if(fn)try{{fn()}}catch(e){{}}}}
139
+ """
140
+
141
+
142
+ def build_promise() -> str:
143
+ """Minimal Promise polyfill for QuickJS contexts that need it."""
144
+ return """
145
+ var Promise=(function(){function P(ex){var s=this;s._v=undefined;s._s='pending';s._h=[];
146
+ function res(v){s._v=v;s._s='fulfilled';s._h.forEach(function(h){if(h.f)h.f(v)})}
147
+ function rej(r){s._v=r;s._s='rejected';s._h.forEach(function(h){if(h.r)h.r(r)})}
148
+ try{ex(res,rej)}catch(e){rej(e)}}
149
+ P.prototype.then=function(f,r){var s=this;return new P(function(res,rej){
150
+ function go(){try{if(s._s==='fulfilled')res(f?f(s._v):s._v);
151
+ else if(s._s==='rejected'){if(r)res(r(s._v));else rej(s._v)}}catch(e){rej(e)}}
152
+ if(s._s!=='pending')go();else s._h.push({f:function(v){try{res(f?f(v):v)}catch(e){rej(e)}},
153
+ r:function(v){try{if(r)res(r(v));else rej(v)}catch(e){rej(e)}}})})};
154
+ P.prototype.catch=function(r){return this.then(null,r)};
155
+ P.prototype.finally=function(fn){return this.then(function(v){fn();return v},function(r){fn();throw r})};
156
+ P.resolve=function(v){return new P(function(r){r(v)})};
157
+ P.reject=function(r){return new P(function(_,j){j(r)})};
158
+ P.all=function(a){return new P(function(res){var r=[],c=a.length;if(!c)return res([]);
159
+ a.forEach(function(p,i){P.resolve(p).then(function(v){r[i]=v;if(!--c)res(r)})})})};
160
+ P.race=function(a){return new P(function(res,rej){a.forEach(function(p){P.resolve(p).then(res,rej)})})};
161
+ P.allSettled=function(a){return P.all(a.map(function(p){return P.resolve(p).then(
162
+ function(v){return{status:'fulfilled',value:v}},function(r){return{status:'rejected',reason:r}})}))};
163
+ return P})();
164
+ """