fiptcha 0.1.3 → 0.1.4
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/package.json
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
const { captchaModelManager, checksumBuffer } = require('./captcha-model-manager');
|
|
2
|
-
const { clickVisibleTarget } = require('./captcha-pointer');
|
|
3
2
|
|
|
4
3
|
const PROVIDERS = Object.freeze({
|
|
5
4
|
recaptcha_v2: Object.freeze({
|
|
@@ -161,17 +160,16 @@ async function solveImageGrid(page, { captchaType, deadline, waitForToken, logs
|
|
|
161
160
|
const count = await cells.count();
|
|
162
161
|
if (![9, 16].includes(count)) throw new Error(`Unsupported ${captchaType} grid size (${count} cells)`);
|
|
163
162
|
const selected = await classifyGrid(frame, adapter, cells, prompt, seenTiles);
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
}
|
|
163
|
+
// Grid cells live inside a provider iframe. Let Playwright target the
|
|
164
|
+
// element in that frame instead of sending a page-level mouse click:
|
|
165
|
+
// the latter can miss the cell when iframe coordinates change.
|
|
166
|
+
for (const index of selected) await cells.nth(index).click({ timeout: 2000 });
|
|
168
167
|
totalSelections += selected.length;
|
|
169
168
|
if (!selected.length) break;
|
|
170
169
|
await page.waitForTimeout(600);
|
|
171
170
|
}
|
|
172
171
|
logs.push(`Local ${captchaType} grid round ${round + 1}: selected ${totalSelections} cells for "${prompt}"`);
|
|
173
|
-
|
|
174
|
-
if (!submitted) throw new Error(`${captchaType} verification button was outside the viewport`);
|
|
172
|
+
await frame.locator(totalSelections ? adapter.submit : adapter.noMatch).first().click({ timeout: 2000 });
|
|
175
173
|
const token = await waitForToken(page, captchaType, Math.min(2500, Math.max(0, deadline - Date.now())));
|
|
176
174
|
if (token) return token;
|
|
177
175
|
await page.waitForTimeout(350);
|