Commit 6e75b91
committed
Fix 1.61 build: actually download the patched driver
The published 1.61.0 wheel shipped a VANILLA playwright-core driver: proven by
inspecting it (navigator.webdriver=true, Runtime.enable used 10x, no
--disable-blink-features in chromiumSwitches, 0 patchright strings, driver
version 1.61.1-beta). Patchright's core stealth lives in the DRIVER, so the
wheel was detectable (Akamai bot-blocked the ray-ban crawler despite a
residential proxy). This corrects the assumption that patchright-python's
stealth is 'Python-layer' with a vanilla driver — it is not.
Root cause: Playwright-Python 1.61 restructured setup.py — driver_version now
reads from a DRIVER_VERSION file, and the bundle is assembled from the vanilla
playwright-core npm package via ensure_driver_bundle() (no cdn.playwright.dev
url). The existing driver_version/url AST rewrites matched neither and silently
no-op'd, so the build fell back to the vanilla driver.
- patch_driver_version_file(): pin DRIVER_VERSION to the patched driver version.
- patch_ensure_driver_bundle(): rewrite the function to curl our patched driver
ZIP from bugbasesecurity/patchright releases (stealth + networkidle baked in).
- Workflow: optional patchright_driver_version input; refreshed defaults.
The post-build networkidle step (patch_wheels_networkidle.mjs) is now an
idempotent safety net — the downloaded driver already carries the exclusion, so
it detects it and skips.
Verified end-to-end: patcher runs clean on playwright-python v1.61.0; built
manylinux wheel bundles the patched driver (39 patchright strings,
--disable-blink-features=AutomationControlled in chromiumSwitches, networkidle
present); installed wheel -> navigator.webdriver is false on a plain
launch()+new_context() with no manual flag.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent f9ca181 commit 6e75b91
2 files changed
Lines changed: 55 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
14 | 18 | | |
15 | 19 | | |
16 | 20 | | |
| |||
22 | 26 | | |
23 | 27 | | |
24 | 28 | | |
| 29 | + | |
25 | 30 | | |
26 | 31 | | |
27 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
8 | 16 | | |
9 | 17 | | |
10 | 18 | | |
11 | 19 | | |
12 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
13 | 48 | | |
14 | 49 | | |
15 | 50 | | |
| |||
37 | 72 | | |
38 | 73 | | |
39 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
40 | 78 | | |
41 | 79 | | |
42 | 80 | | |
43 | 81 | | |
44 | 82 | | |
45 | 83 | | |
46 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
47 | 89 | | |
48 | 90 | | |
49 | | - | |
50 | | - | |
| 91 | + | |
51 | 92 | | |
52 | | - | |
| 93 | + | |
53 | 94 | | |
54 | 95 | | |
55 | 96 | | |
56 | 97 | | |
57 | | - | |
| 98 | + | |
58 | 99 | | |
59 | 100 | | |
60 | 101 | | |
| |||
0 commit comments