@biggora/claude-plugins 1.1.1 → 1.2.2
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.
- package/.claude/settings.local.json +3 -1
- package/README.md +24 -17
- package/package.json +1 -1
- package/registry/registry.json +319 -244
- package/specs/coding.md +24 -0
- package/specs/pod.md +2 -0
- package/src/skills/captcha/README.md +221 -0
- package/src/skills/captcha/SKILL.md +355 -0
- package/src/skills/captcha/references/captcha-types.md +254 -0
- package/src/skills/captcha/references/services.md +172 -0
- package/src/skills/captcha/references/stealth.md +238 -0
- package/src/skills/captcha/scripts/solve_captcha.py +323 -0
- package/src/skills/captcha/scripts/solve_image_grid.py +350 -0
- package/src/skills/codex-cli/SKILL.md +21 -11
- package/src/skills/gemini-cli/SKILL.md +27 -13
- package/src/skills/gemini-cli/references/commands.md +21 -14
- package/src/skills/gemini-cli/references/configuration.md +23 -18
- package/src/skills/gemini-cli/references/headless-and-scripting.md +7 -17
- package/src/skills/gemini-cli/references/mcp-and-extensions.md +12 -6
- package/src/skills/google-merchant-api/SKILL.md +581 -0
- package/src/skills/google-merchant-api/references/accounts.md +247 -0
- package/src/skills/google-merchant-api/references/content-api-legacy.md +216 -0
- package/src/skills/google-merchant-api/references/datasources.md +233 -0
- package/src/skills/google-merchant-api/references/inventories.md +201 -0
- package/src/skills/google-merchant-api/references/migration.md +267 -0
- package/src/skills/google-merchant-api/references/products.md +316 -0
- package/src/skills/google-merchant-api/references/promotions.md +201 -0
- package/src/skills/google-merchant-api/references/reports.md +240 -0
- package/src/skills/lv-aggregators-api/SKILL.md +113 -0
- package/src/skills/lv-aggregators-api/references/integration-guide.md +368 -0
- package/src/skills/lv-aggregators-api/references/kurpirkt.md +103 -0
- package/src/skills/lv-aggregators-api/references/salidzini.md +122 -0
- package/src/skills/notebook-lm/SKILL.md +1 -1
- package/src/skills/screen-recording/SKILL.md +243 -213
- package/src/skills/screen-recording/references/design-patterns.md +4 -2
- package/src/skills/screen-recording/references/ffmpeg-recording.md +473 -0
- package/src/skills/screen-recording/references/{approach1-programmatic.md → programmatic-generation.md} +45 -22
- package/src/skills/screen-recording/references/python-fallback.md +222 -0
- package/src/skills/tailwindcss-best-practices/SKILL.md +180 -0
- package/src/skills/tailwindcss-best-practices/references/best-practices-utility-patterns.md +87 -0
- package/src/skills/tailwindcss-best-practices/references/core-installation.md +109 -0
- package/src/skills/tailwindcss-best-practices/references/core-preflight.md +200 -0
- package/src/skills/tailwindcss-best-practices/references/core-responsive.md +163 -0
- package/src/skills/tailwindcss-best-practices/references/core-source-detection.md +114 -0
- package/src/skills/tailwindcss-best-practices/references/core-theme.md +108 -0
- package/src/skills/tailwindcss-best-practices/references/core-utility-classes.md +59 -0
- package/src/skills/tailwindcss-best-practices/references/core-variants.md +204 -0
- package/src/skills/tailwindcss-best-practices/references/effects-form-controls.md +76 -0
- package/src/skills/tailwindcss-best-practices/references/effects-mask.md +91 -0
- package/src/skills/tailwindcss-best-practices/references/effects-scroll-snap.md +59 -0
- package/src/skills/tailwindcss-best-practices/references/effects-text-shadow.md +78 -0
- package/src/skills/tailwindcss-best-practices/references/effects-transition-animation.md +80 -0
- package/src/skills/tailwindcss-best-practices/references/effects-visibility-interactivity.md +82 -0
- package/src/skills/tailwindcss-best-practices/references/features-content-detection.md +175 -0
- package/src/skills/tailwindcss-best-practices/references/features-custom-styles.md +203 -0
- package/src/skills/tailwindcss-best-practices/references/features-dark-mode.md +137 -0
- package/src/skills/tailwindcss-best-practices/references/features-functions-directives.md +241 -0
- package/src/skills/tailwindcss-best-practices/references/features-upgrade.md +160 -0
- package/src/skills/tailwindcss-best-practices/references/layout-aspect-ratio.md +39 -0
- package/src/skills/tailwindcss-best-practices/references/layout-columns.md +80 -0
- package/src/skills/tailwindcss-best-practices/references/layout-display.md +110 -0
- package/src/skills/tailwindcss-best-practices/references/layout-flexbox.md +112 -0
- package/src/skills/tailwindcss-best-practices/references/layout-grid.md +87 -0
- package/src/skills/tailwindcss-best-practices/references/layout-height.md +97 -0
- package/src/skills/tailwindcss-best-practices/references/layout-inset.md +103 -0
- package/src/skills/tailwindcss-best-practices/references/layout-logical-properties.md +92 -0
- package/src/skills/tailwindcss-best-practices/references/layout-margin.md +126 -0
- package/src/skills/tailwindcss-best-practices/references/layout-min-max-sizing.md +63 -0
- package/src/skills/tailwindcss-best-practices/references/layout-object-fit-position.md +64 -0
- package/src/skills/tailwindcss-best-practices/references/layout-overflow.md +57 -0
- package/src/skills/tailwindcss-best-practices/references/layout-padding.md +77 -0
- package/src/skills/tailwindcss-best-practices/references/layout-position.md +85 -0
- package/src/skills/tailwindcss-best-practices/references/layout-tables.md +67 -0
- package/src/skills/tailwindcss-best-practices/references/layout-width.md +102 -0
- package/src/skills/tailwindcss-best-practices/references/transform-base.md +68 -0
- package/src/skills/tailwindcss-best-practices/references/transform-rotate.md +70 -0
- package/src/skills/tailwindcss-best-practices/references/transform-scale.md +83 -0
- package/src/skills/tailwindcss-best-practices/references/transform-skew.md +62 -0
- package/src/skills/tailwindcss-best-practices/references/transform-translate.md +77 -0
- package/src/skills/tailwindcss-best-practices/references/typography-font-text.md +142 -0
- package/src/skills/tailwindcss-best-practices/references/typography-list-style.md +65 -0
- package/src/skills/tailwindcss-best-practices/references/typography-text-align.md +60 -0
- package/src/skills/tailwindcss-best-practices/references/visual-background.md +76 -0
- package/src/skills/tailwindcss-best-practices/references/visual-border.md +108 -0
- package/src/skills/tailwindcss-best-practices/references/visual-effects.md +111 -0
- package/src/skills/tailwindcss-best-practices/references/visual-svg.md +82 -0
- package/src/skills/test-mobile-app/SKILL.md +11 -6
- package/src/skills/test-mobile-app/scripts/analyze_apk.py +15 -4
- package/src/skills/test-mobile-app/scripts/check_environment.py +5 -5
- package/src/skills/test-mobile-app/scripts/run_tests.py +1 -1
- package/src/skills/test-web-ui/SKILL.md +264 -84
- package/src/skills/test-web-ui/scripts/discover.py +25 -12
- package/src/skills/test-web-ui/scripts/run_tests.py +3 -2
- package/src/skills/tm-search/SKILL.md +242 -106
- package/src/skills/tm-search/references/scraping-fallback.md +60 -95
- package/src/skills/tm-search/scripts/tm_search.py +453 -375
- package/src/skills/vite-best-practices/SKILL.md +115 -0
- package/src/skills/vite-best-practices/references/build-and-ssr.md +255 -0
- package/src/skills/vite-best-practices/references/core-config.md +231 -0
- package/src/skills/vite-best-practices/references/core-features.md +222 -0
- package/src/skills/vite-best-practices/references/core-plugin-api.md +294 -0
- package/src/skills/vite-best-practices/references/environment-api.md +108 -0
- package/src/skills/vite-best-practices/references/rolldown-migration.md +242 -0
- package/src/skills/screen-recording/references/approach2-xvfb.md +0 -232
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
# captcha
|
|
2
|
+
|
|
3
|
+
Claude Code skill for solving CAPTCHAs in automated browser sessions.
|
|
4
|
+
|
|
5
|
+
Supports token-based solving (reCAPTCHA v2/v3, hCaptcha, Cloudflare Turnstile) via third-party services, and visual image grid solving via Claude / GPT-4V.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## What it does
|
|
10
|
+
|
|
11
|
+
| Scenario | How |
|
|
12
|
+
|----------|-----|
|
|
13
|
+
| reCAPTCHA v2 checkbox | `solve_captcha.py` → token → inject into page |
|
|
14
|
+
| reCAPTCHA v3 (invisible) | `solve_captcha.py --type recaptcha-v3` |
|
|
15
|
+
| hCaptcha | `solve_captcha.py --type hcaptcha` |
|
|
16
|
+
| Cloudflare Turnstile | `solve_captcha.py --type turnstile` |
|
|
17
|
+
| Image grid ("select all traffic lights") | `solve_image_grid.py` → Claude/GPT-4V → click cells |
|
|
18
|
+
| Classic distorted text image | `solve_captcha.py --type image` |
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# Install the skill via claude-plugins
|
|
26
|
+
claude-plugins install captcha
|
|
27
|
+
|
|
28
|
+
# Copy the solver scripts to your project
|
|
29
|
+
cp ~/.claude/plugins/captcha/scripts/solve_captcha.py ./
|
|
30
|
+
cp ~/.claude/plugins/captcha/scripts/solve_image_grid.py ./ # only if you need image grid
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Requirements
|
|
36
|
+
|
|
37
|
+
**Token-based solving** (`solve_captcha.py`) — no extra packages, uses Python stdlib only.
|
|
38
|
+
|
|
39
|
+
**Image grid solving** (`solve_image_grid.py`):
|
|
40
|
+
```bash
|
|
41
|
+
pip install anthropic playwright # Claude (recommended)
|
|
42
|
+
# or:
|
|
43
|
+
pip install openai playwright # GPT-4V fallback
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**Browser automation:**
|
|
47
|
+
```bash
|
|
48
|
+
pip install playwright
|
|
49
|
+
playwright install chromium
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Solving services
|
|
55
|
+
|
|
56
|
+
Token-based solving requires an API key from one of these services:
|
|
57
|
+
|
|
58
|
+
| Service | Flag | ~Speed | ~Cost/1K solves |
|
|
59
|
+
|---------|------|--------|-----------------|
|
|
60
|
+
| [2captcha](https://2captcha.com) | `--service 2captcha` | 20–40s | $1.00 |
|
|
61
|
+
| [CapMonster](https://capmonster.cloud) | `--service capmonster` | 10–30s | $0.60 |
|
|
62
|
+
| [Anti-Captcha](https://anti-captcha.com) | `--service anticaptcha` | 15–35s | $0.70 |
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
export CAPTCHA_API_KEY=your_key_here
|
|
66
|
+
export CAPTCHA_SERVICE=2captcha # or capmonster, anticaptcha
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Quick start
|
|
72
|
+
|
|
73
|
+
### Token-based (reCAPTCHA v2)
|
|
74
|
+
|
|
75
|
+
```python
|
|
76
|
+
import json, os, subprocess, sys
|
|
77
|
+
from playwright.sync_api import sync_playwright
|
|
78
|
+
|
|
79
|
+
def solve(captcha_type, sitekey, pageurl):
|
|
80
|
+
result = subprocess.run(
|
|
81
|
+
[sys.executable, "solve_captcha.py",
|
|
82
|
+
"--type", captcha_type, "--sitekey", sitekey, "--pageurl", pageurl],
|
|
83
|
+
capture_output=True, text=True, env=os.environ
|
|
84
|
+
)
|
|
85
|
+
data = json.loads(result.stdout)
|
|
86
|
+
if not data["success"]:
|
|
87
|
+
raise RuntimeError(data["error"])
|
|
88
|
+
return data["token"]
|
|
89
|
+
|
|
90
|
+
PAGE_URL = "https://www.google.com/recaptcha/api2/demo"
|
|
91
|
+
SITEKEY = "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-"
|
|
92
|
+
|
|
93
|
+
# Solve BEFORE opening the browser — 15-40s API wait becomes free parallelism
|
|
94
|
+
token = solve("recaptcha-v2", SITEKEY, PAGE_URL)
|
|
95
|
+
|
|
96
|
+
with sync_playwright() as p:
|
|
97
|
+
page = p.chromium.launch(headless=False).new_page()
|
|
98
|
+
page.goto(PAGE_URL)
|
|
99
|
+
|
|
100
|
+
token_js = json.dumps(token)
|
|
101
|
+
page.evaluate(f"""
|
|
102
|
+
const t = {token_js};
|
|
103
|
+
document.querySelector('[name="g-recaptcha-response"]').value = t;
|
|
104
|
+
if (window.___grecaptcha_cfg)
|
|
105
|
+
Object.values(window.___grecaptcha_cfg.clients || {{}}).forEach(c =>
|
|
106
|
+
Object.keys(c).forEach(k => {{ if (c[k]?.callback) c[k].callback(t) }})
|
|
107
|
+
);
|
|
108
|
+
""")
|
|
109
|
+
page.click('#recaptcha-demo-submit')
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Image grid ("select all X")
|
|
113
|
+
|
|
114
|
+
```python
|
|
115
|
+
from playwright.sync_api import sync_playwright
|
|
116
|
+
from solve_image_grid import solve_image_grid
|
|
117
|
+
|
|
118
|
+
with sync_playwright() as p:
|
|
119
|
+
page = p.chromium.launch(headless=False).new_page()
|
|
120
|
+
page.goto("https://www.google.com/recaptcha/api2/demo")
|
|
121
|
+
|
|
122
|
+
# Click the checkbox
|
|
123
|
+
page.frame_locator('iframe[title="reCAPTCHA"]') \
|
|
124
|
+
.locator('.recaptcha-checkbox-border').click()
|
|
125
|
+
|
|
126
|
+
# Handle the grid if it appears (no-op if checkbox passed directly)
|
|
127
|
+
solved = solve_image_grid(page)
|
|
128
|
+
|
|
129
|
+
if solved:
|
|
130
|
+
page.click('#recaptcha-demo-submit')
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### CLI usage
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
# Solve and print token JSON
|
|
137
|
+
python solve_captcha.py --type recaptcha-v2 \
|
|
138
|
+
--sitekey 6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ- \
|
|
139
|
+
--pageurl https://www.google.com/recaptcha/api2/demo
|
|
140
|
+
# → {"success": true, "token": "03AGdBq25...", "type": "recaptcha-v2"}
|
|
141
|
+
|
|
142
|
+
# Other types
|
|
143
|
+
python solve_captcha.py --type hcaptcha --sitekey KEY --pageurl URL
|
|
144
|
+
python solve_captcha.py --type turnstile --sitekey KEY --pageurl URL
|
|
145
|
+
python solve_captcha.py --type recaptcha-v3 --sitekey KEY --pageurl URL --action verify
|
|
146
|
+
python solve_captcha.py --type image --image captcha.png
|
|
147
|
+
|
|
148
|
+
# Switch service
|
|
149
|
+
python solve_captcha.py --type recaptcha-v2 --sitekey KEY --pageurl URL \
|
|
150
|
+
--service capmonster
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## How token-based solving works
|
|
156
|
+
|
|
157
|
+
```
|
|
158
|
+
Your script 2captcha / CapMonster
|
|
159
|
+
│ │
|
|
160
|
+
├─ send sitekey + page URL ──────► human or AI solves
|
|
161
|
+
│ │
|
|
162
|
+
│ wait 15–40s │
|
|
163
|
+
│ │
|
|
164
|
+
◄────────────────────────────────┤ returns token string
|
|
165
|
+
│
|
|
166
|
+
├─ inject token into [name="g-recaptcha-response"]
|
|
167
|
+
├─ trigger grecaptcha callback
|
|
168
|
+
└─ submit form
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Just writing the token into the form field isn't enough — you must also trigger the page's internal CAPTCHA callback, otherwise the form submits but the server rejects it as unsolved.
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## How image grid solving works
|
|
176
|
+
|
|
177
|
+
```
|
|
178
|
+
Checkbox click → grid appears
|
|
179
|
+
│
|
|
180
|
+
├─ screenshot grid table element
|
|
181
|
+
├─ send to Claude Opus / GPT-4V: "which cells match the task?"
|
|
182
|
+
├─ receive [2, 5, 8]
|
|
183
|
+
├─ click those cells (element-based, not pixel coordinates)
|
|
184
|
+
├─ click Verify
|
|
185
|
+
└─ new round? → repeat (up to 6 rounds)
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Uses element-based clicks (`frame_locator().locator('td').nth(i)`) rather than pixel coordinates — more reliable across different viewport sizes and DPI settings.
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## Avoiding bot detection
|
|
193
|
+
|
|
194
|
+
Passing the CAPTCHA is often not enough — sites like Cloudflare also check browser fingerprint, headers, and mouse movement. See [`references/stealth.md`](references/stealth.md) for the full checklist: playwright-stealth, realistic User-Agent, random delays, mouse movement, residential proxies.
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
## File reference
|
|
199
|
+
|
|
200
|
+
```
|
|
201
|
+
captcha/
|
|
202
|
+
├── SKILL.md ← skill instructions (read by Claude)
|
|
203
|
+
├── scripts/
|
|
204
|
+
│ ├── solve_captcha.py ← token solver CLI (stdlib only)
|
|
205
|
+
│ └── solve_image_grid.py ← image grid solver (requires anthropic or openai)
|
|
206
|
+
└── references/
|
|
207
|
+
├── captcha-types.md ← detection JS + injection patterns per type
|
|
208
|
+
├── services.md ← service comparison, pricing, error codes
|
|
209
|
+
└── stealth.md ← bot detection avoidance checklist
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
## Testing
|
|
215
|
+
|
|
216
|
+
Demo pages you can test against (no account needed):
|
|
217
|
+
|
|
218
|
+
- https://www.google.com/recaptcha/api2/demo — reCAPTCHA v2 checkbox
|
|
219
|
+
- https://2captcha.com/demo/recaptcha-v2 — reCAPTCHA v2 (2captcha demo)
|
|
220
|
+
- https://2captcha.com/demo/hcaptcha — hCaptcha
|
|
221
|
+
- https://2captcha.com/demo/cloudflare-turnstile — Turnstile
|
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: captcha
|
|
3
|
+
description: >
|
|
4
|
+
Solve CAPTCHAs in automated browser sessions using third-party solving services.
|
|
5
|
+
Use this skill whenever you need to: bypass a CAPTCHA while automating a website,
|
|
6
|
+
integrate CAPTCHA solving into a Playwright or Puppeteer script, solve reCAPTCHA v2
|
|
7
|
+
or v3, hCaptcha, Cloudflare Turnstile, or image-based CAPTCHAs, automate a login or
|
|
8
|
+
form submission that's blocked by a CAPTCHA, test a page that has CAPTCHA challenges,
|
|
9
|
+
or write a script that needs to pass a CAPTCHA programmatically.
|
|
10
|
+
Also triggers for: "recaptcha", "hcaptcha", "turnstile", "captcha solving",
|
|
11
|
+
"bypass captcha", "solve captcha", "pass captcha challenge", "automate past captcha",
|
|
12
|
+
"get past robot check", "bot verification". Always use this skill for any
|
|
13
|
+
CAPTCHA-related automation — even simple cases benefit from correct token injection patterns.
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# CAPTCHA Solver Skill
|
|
17
|
+
|
|
18
|
+
Solve CAPTCHAs programmatically in web automation workflows.
|
|
19
|
+
|
|
20
|
+
## How Token-Based CAPTCHA Solving Works
|
|
21
|
+
|
|
22
|
+
Modern CAPTCHAs (reCAPTCHA, hCaptcha, Turnstile) don't require reading distorted text —
|
|
23
|
+
they issue a **signed token** when solved. A third-party service solves the challenge on
|
|
24
|
+
your behalf and returns that token. You inject it into the page, and the page thinks the
|
|
25
|
+
user solved it.
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
Page with CAPTCHA
|
|
29
|
+
│
|
|
30
|
+
├─ 1. Extract sitekey + page URL
|
|
31
|
+
├─ 2. Submit to solving service (waits 15–45s)
|
|
32
|
+
├─ 3. Receive token string
|
|
33
|
+
├─ 4. Inject token into hidden field on page
|
|
34
|
+
├─ 5. Trigger the CAPTCHA callback
|
|
35
|
+
└─ 6. Submit form / continue automation
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Tokens expire in ~2 minutes — solve immediately before submitting.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Supported CAPTCHA Types
|
|
43
|
+
|
|
44
|
+
| Type | `--type` flag | How to detect on page |
|
|
45
|
+
|------|--------------|----------------------|
|
|
46
|
+
| reCAPTCHA v2 (checkbox) | `recaptcha-v2` | `.g-recaptcha` div, `[data-sitekey]` attribute |
|
|
47
|
+
| reCAPTCHA v2 invisible | `recaptcha-v2 --invisible` | No visible widget; `grecaptcha.execute()` call |
|
|
48
|
+
| reCAPTCHA v3 | `recaptcha-v3` | `grecaptcha.execute(sitekey, {action:...})` in JS |
|
|
49
|
+
| hCaptcha | `hcaptcha` | `.h-captcha` div or `[data-hcaptcha-sitekey]` |
|
|
50
|
+
| Cloudflare Turnstile | `turnstile` | `.cf-turnstile` div |
|
|
51
|
+
| Image/text CAPTCHA | `image` | `<img>` with "captcha" in src or alt |
|
|
52
|
+
|
|
53
|
+
Read `references/captcha-types.md` for per-type detection JS snippets and injection patterns.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Solving Services
|
|
58
|
+
|
|
59
|
+
You need an API key from a solving service. All three below use the same API format,
|
|
60
|
+
so the solver script works with any of them:
|
|
61
|
+
|
|
62
|
+
| Service | Flag | Speed | Cost/1K |
|
|
63
|
+
|---------|------|-------|---------|
|
|
64
|
+
| **2captcha** (recommended) | `--service 2captcha` | 20–40s | ~$1.00 |
|
|
65
|
+
| CapMonster Cloud | `--service capmonster` | 10–30s | ~$0.60 |
|
|
66
|
+
| Anti-Captcha | `--service anticaptcha` | 15–35s | ~$0.70 |
|
|
67
|
+
|
|
68
|
+
Set credentials via environment variables (preferred):
|
|
69
|
+
```bash
|
|
70
|
+
export CAPTCHA_API_KEY=your_key_here
|
|
71
|
+
export CAPTCHA_SERVICE=2captcha
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Read `references/services.md` for signup links, free trial details, and API compatibility.
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Setup
|
|
79
|
+
|
|
80
|
+
Copy the solver script to your project before using it:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# From your project directory — adjust path to match your skill install location
|
|
84
|
+
cp ~/.claude/plugins/captcha/scripts/solve_captcha.py ./solve_captcha.py
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
The script uses only Python stdlib — no `pip install` needed.
|
|
88
|
+
|
|
89
|
+
## Quick Start: reCAPTCHA v2
|
|
90
|
+
|
|
91
|
+
### Using the bundled script (recommended)
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
python solve_captcha.py \
|
|
95
|
+
--type recaptcha-v2 \
|
|
96
|
+
--sitekey 6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ- \
|
|
97
|
+
--pageurl https://www.google.com/recaptcha/api2/demo \
|
|
98
|
+
--api-key $CAPTCHA_API_KEY
|
|
99
|
+
# → {"success": true, "token": "03AGdBq25...", "type": "recaptcha-v2"}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Full Playwright workflow (Python)
|
|
103
|
+
|
|
104
|
+
**Key insight: start solving before you open the browser.** The service takes 15–40s to return a token. If you kick off the solve call first, that wait happens in the background while you launch the browser and navigate — free parallelism.
|
|
105
|
+
|
|
106
|
+
```python
|
|
107
|
+
import json, os, subprocess, sys
|
|
108
|
+
from playwright.sync_api import sync_playwright
|
|
109
|
+
|
|
110
|
+
SOLVER = "solve_captcha.py" # must be in same directory or on PATH
|
|
111
|
+
|
|
112
|
+
def solve(captcha_type, sitekey, pageurl, service=None):
|
|
113
|
+
cmd = [sys.executable, SOLVER,
|
|
114
|
+
"--type", captcha_type,
|
|
115
|
+
"--sitekey", sitekey,
|
|
116
|
+
"--pageurl", pageurl]
|
|
117
|
+
if service:
|
|
118
|
+
cmd += ["--service", service]
|
|
119
|
+
result = subprocess.run(cmd, capture_output=True, text=True, env=os.environ)
|
|
120
|
+
data = json.loads(result.stdout)
|
|
121
|
+
if not data["success"]:
|
|
122
|
+
raise RuntimeError(data["error"])
|
|
123
|
+
return data["token"]
|
|
124
|
+
|
|
125
|
+
PAGE_URL = "https://www.google.com/recaptcha/api2/demo"
|
|
126
|
+
SITEKEY = "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-"
|
|
127
|
+
|
|
128
|
+
# Step 1: start solving (this takes 15–40s) — do it BEFORE opening the browser
|
|
129
|
+
token = solve("recaptcha-v2", SITEKEY, PAGE_URL)
|
|
130
|
+
|
|
131
|
+
# Step 2: now launch and navigate — solve is already done or finishing
|
|
132
|
+
with sync_playwright() as p:
|
|
133
|
+
browser = p.chromium.launch(headless=False)
|
|
134
|
+
page = browser.new_page()
|
|
135
|
+
page.goto(PAGE_URL)
|
|
136
|
+
|
|
137
|
+
# Step 3: inject token — use json.dumps() for safe JS interpolation
|
|
138
|
+
import json as _json
|
|
139
|
+
token_js = _json.dumps(token)
|
|
140
|
+
page.evaluate(f"""
|
|
141
|
+
const token = {token_js};
|
|
142
|
+
const el = document.querySelector('[name="g-recaptcha-response"]');
|
|
143
|
+
if (el) {{ el.value = token; }}
|
|
144
|
+
if (window.___grecaptcha_cfg) {{
|
|
145
|
+
Object.values(window.___grecaptcha_cfg.clients || {{}}).forEach(c => {{
|
|
146
|
+
Object.keys(c).forEach(k => {{
|
|
147
|
+
if (c[k]?.callback) c[k].callback(token);
|
|
148
|
+
}});
|
|
149
|
+
}});
|
|
150
|
+
}}
|
|
151
|
+
""")
|
|
152
|
+
|
|
153
|
+
page.click('#recaptcha-demo-submit')
|
|
154
|
+
browser.close()
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
> **Important:** Always use `json.dumps(token)` when embedding a token in JS — never bare f-string interpolation like `'{token}'`. Token strings are base64url-safe today but the pattern is fragile.
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## Step-by-Step Workflow
|
|
162
|
+
|
|
163
|
+
### Step 1 — Detect CAPTCHA type and extract sitekey
|
|
164
|
+
|
|
165
|
+
Run this JS in the browser (via `page.evaluate` or `browser_evaluate`):
|
|
166
|
+
|
|
167
|
+
```javascript
|
|
168
|
+
(() => {
|
|
169
|
+
const q = s => document.querySelector(s);
|
|
170
|
+
if (q('.g-recaptcha, [data-sitekey]:not(.h-captcha):not(.cf-turnstile)'))
|
|
171
|
+
return { type: 'recaptcha-v2', sitekey: q('[data-sitekey]')?.dataset?.sitekey };
|
|
172
|
+
if (q('.h-captcha, [data-hcaptcha-sitekey]'))
|
|
173
|
+
return { type: 'hcaptcha', sitekey: q('[data-sitekey]')?.dataset?.sitekey };
|
|
174
|
+
if (q('.cf-turnstile'))
|
|
175
|
+
return { type: 'turnstile', sitekey: q('.cf-turnstile')?.dataset?.sitekey };
|
|
176
|
+
if (q('img[src*="captcha" i], img[alt*="captcha" i]'))
|
|
177
|
+
return { type: 'image' };
|
|
178
|
+
return { type: null };
|
|
179
|
+
})();
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
For reCAPTCHA v3 (no visible widget), look in the page source for:
|
|
183
|
+
```
|
|
184
|
+
grecaptcha.execute('SITEKEY', {action: 'ACTION_NAME'})
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### Step 2 — Run the solver script
|
|
188
|
+
|
|
189
|
+
Always use `solve_captcha.py` for the API call — don't write your own polling loop. The script handles initial wait, retries, error codes, and service switching.
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
# reCAPTCHA v2
|
|
193
|
+
python solve_captcha.py --type recaptcha-v2 --sitekey SITEKEY --pageurl URL
|
|
194
|
+
|
|
195
|
+
# reCAPTCHA v3
|
|
196
|
+
python solve_captcha.py --type recaptcha-v3 --sitekey SITEKEY --pageurl URL --action verify
|
|
197
|
+
|
|
198
|
+
# hCaptcha
|
|
199
|
+
python solve_captcha.py --type hcaptcha --sitekey SITEKEY --pageurl URL
|
|
200
|
+
|
|
201
|
+
# Cloudflare Turnstile
|
|
202
|
+
python solve_captcha.py --type turnstile --sitekey SITEKEY --pageurl URL
|
|
203
|
+
|
|
204
|
+
# Image CAPTCHA (send screenshot of the captcha image)
|
|
205
|
+
python solve_captcha.py --type image --image captcha_screenshot.png
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Step 3 — Inject the token
|
|
209
|
+
|
|
210
|
+
Each CAPTCHA type has a different injection pattern. Read `references/captcha-types.md`
|
|
211
|
+
for the exact JS for each type.
|
|
212
|
+
|
|
213
|
+
**reCAPTCHA v2 (most common):**
|
|
214
|
+
```javascript
|
|
215
|
+
// 1. Set the hidden response field
|
|
216
|
+
document.querySelector('[name="g-recaptcha-response"]').value = TOKEN;
|
|
217
|
+
|
|
218
|
+
// 2. Trigger the registered callback
|
|
219
|
+
if (window.___grecaptcha_cfg) {
|
|
220
|
+
Object.values(window.___grecaptcha_cfg.clients || {}).forEach(client => {
|
|
221
|
+
Object.keys(client).forEach(key => {
|
|
222
|
+
if (client[key]?.callback) client[key].callback(TOKEN);
|
|
223
|
+
});
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## Image Grid Challenge (Vision AI)
|
|
231
|
+
|
|
232
|
+
Sometimes after clicking the reCAPTCHA v2 checkbox a grid appears: *"Select all images with traffic lights"*. This is a separate visual challenge — token solving won't help here. The bundled `solve_image_grid.py` handles it by screenshotting the grid and asking a vision AI (Claude or GPT-4V) which cells to click.
|
|
233
|
+
|
|
234
|
+
```
|
|
235
|
+
Requirements: pip install anthropic (or openai as fallback)
|
|
236
|
+
Environment: ANTHROPIC_API_KEY or OPENAI_API_KEY
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### How it works
|
|
240
|
+
|
|
241
|
+
```
|
|
242
|
+
Checkbox clicked
|
|
243
|
+
│
|
|
244
|
+
├─ Grid appeared? → screenshot grid cells → ask vision AI → click matching cells
|
|
245
|
+
│ → click Verify
|
|
246
|
+
│ → new round? → repeat
|
|
247
|
+
└─ No grid (trusted IP) → returns True immediately
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
### Integration with your script
|
|
251
|
+
|
|
252
|
+
```python
|
|
253
|
+
from playwright.sync_api import sync_playwright
|
|
254
|
+
from solve_image_grid import solve_image_grid # copy from scripts/
|
|
255
|
+
|
|
256
|
+
with sync_playwright() as p:
|
|
257
|
+
page = p.chromium.launch(headless=False).new_page()
|
|
258
|
+
page.goto("https://www.google.com/recaptcha/api2/demo")
|
|
259
|
+
|
|
260
|
+
# Step 1: click the checkbox (inside its iframe)
|
|
261
|
+
page.frame_locator('iframe[title="reCAPTCHA"]') \
|
|
262
|
+
.locator('.recaptcha-checkbox-border').click()
|
|
263
|
+
|
|
264
|
+
# Step 2: handle grid if it appears (returns immediately if no grid)
|
|
265
|
+
solved = solve_image_grid(page)
|
|
266
|
+
|
|
267
|
+
if solved:
|
|
268
|
+
page.click('#recaptcha-demo-submit')
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
### Combined flow (grid + token fallback)
|
|
272
|
+
|
|
273
|
+
Some pages require the grid challenge AND a token. Handle both:
|
|
274
|
+
|
|
275
|
+
```python
|
|
276
|
+
import json, os, subprocess, sys
|
|
277
|
+
from solve_image_grid import solve_image_grid
|
|
278
|
+
|
|
279
|
+
SOLVER = "solve_captcha.py"
|
|
280
|
+
SITEKEY = "your-sitekey"
|
|
281
|
+
|
|
282
|
+
# 1. Click checkbox — may or may not trigger a grid
|
|
283
|
+
page.frame_locator('iframe[title="reCAPTCHA"]') \
|
|
284
|
+
.locator('.recaptcha-checkbox-border').click()
|
|
285
|
+
|
|
286
|
+
# 2. Solve grid if it appeared
|
|
287
|
+
grid_ok = solve_image_grid(page)
|
|
288
|
+
|
|
289
|
+
# 3. If the form still needs a token (check for g-recaptcha-response being empty)
|
|
290
|
+
token_empty = page.evaluate(
|
|
291
|
+
"document.querySelector('[name=\"g-recaptcha-response\"]')?.value === ''"
|
|
292
|
+
)
|
|
293
|
+
if grid_ok and token_empty:
|
|
294
|
+
result = subprocess.run(
|
|
295
|
+
[sys.executable, SOLVER, "--type", "recaptcha-v2",
|
|
296
|
+
"--sitekey", SITEKEY, "--pageurl", page.url],
|
|
297
|
+
capture_output=True, text=True, env=os.environ
|
|
298
|
+
)
|
|
299
|
+
token = json.loads(result.stdout)["token"]
|
|
300
|
+
token_js = json.dumps(token)
|
|
301
|
+
page.evaluate(f"""
|
|
302
|
+
const t = {token_js};
|
|
303
|
+
document.querySelector('[name="g-recaptcha-response"]').value = t;
|
|
304
|
+
if (window.___grecaptcha_cfg)
|
|
305
|
+
Object.values(window.___grecaptcha_cfg.clients||{{}}).forEach(c=>
|
|
306
|
+
Object.keys(c).forEach(k=>{{ if(c[k]?.callback) c[k].callback(t) }})
|
|
307
|
+
);
|
|
308
|
+
""")
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
### Notes
|
|
312
|
+
|
|
313
|
+
- **Element clicks vs pixel coordinates** — the script clicks grid cells via `frame_locator().locator('td').nth(i)`, not raw pixel coordinates. This is more reliable across different viewport sizes and DPI settings.
|
|
314
|
+
- **Multi-round challenges** — Google often shows 2–4 rounds. The script loops automatically up to `max_rounds=6`.
|
|
315
|
+
- **"None of the above" rounds** — if the AI returns `[]` (no matches), the script clicks Verify anyway. Google sometimes accepts this.
|
|
316
|
+
- **Accuracy** — Claude Opus performs well on clear images (~80–90% first-round accuracy). Blurry or ambiguous grids may need multiple rounds.
|
|
317
|
+
|
|
318
|
+
---
|
|
319
|
+
|
|
320
|
+
## Using Playwright MCP Tools
|
|
321
|
+
|
|
322
|
+
If Playwright MCP tools are available (`mcp__plugin_playwright_playwright__*`):
|
|
323
|
+
|
|
324
|
+
```
|
|
325
|
+
1. browser_navigate → go to the page
|
|
326
|
+
2. browser_evaluate → run detection JS to find CAPTCHA type and sitekey
|
|
327
|
+
3. Bash → python scripts/solve_captcha.py ... (takes 15-40s)
|
|
328
|
+
4. browser_evaluate → inject token + trigger callback
|
|
329
|
+
5. browser_click → submit button
|
|
330
|
+
6. browser_snapshot → verify success
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
---
|
|
334
|
+
|
|
335
|
+
## Troubleshooting
|
|
336
|
+
|
|
337
|
+
| Problem | Cause | Fix |
|
|
338
|
+
|---------|-------|-----|
|
|
339
|
+
| Token injection has no effect | Response field is hidden/disabled | Make it visible: `el.style.display='block'; el.removeAttribute('aria-hidden')` |
|
|
340
|
+
| CAPTCHA reappears after submit | Token expired (>2 min) | Solve and inject immediately before submitting |
|
|
341
|
+
| `ERROR_ZERO_BALANCE` | No credits on service | Top up account at service dashboard |
|
|
342
|
+
| `CAPCHA_NOT_READY` timeout | Solver backed up or reCAPTCHA v3 hard | Retry or switch service; for v3 try increasing `--min-score` |
|
|
343
|
+
| Callback not triggered | Site uses custom callback name | Search page source for `.ready(function` or `grecaptcha.render` to find callback |
|
|
344
|
+
| CAPTCHA passes but site still blocks | Browser fingerprint flagged as bot | Read `references/stealth.md` |
|
|
345
|
+
| 2captcha returns wrong text (image) | Low quality image | Crop to just the CAPTCHA, increase contrast before sending |
|
|
346
|
+
|
|
347
|
+
---
|
|
348
|
+
|
|
349
|
+
## Reference Files
|
|
350
|
+
|
|
351
|
+
- `scripts/solve_captcha.py` — CLI solver for token-based CAPTCHAs (stdlib only, no pip install)
|
|
352
|
+
- `scripts/solve_image_grid.py` — Vision AI solver for reCAPTCHA v2 image grid challenges
|
|
353
|
+
- `references/captcha-types.md` — Detection + injection JS for each CAPTCHA type
|
|
354
|
+
- `references/services.md` — Service comparison, signup, pricing, API keys
|
|
355
|
+
- `references/stealth.md` — Avoiding bot detection after bypassing CAPTCHA
|