- Add WorkerFingerprint interface with timezone, city, state, ip, locale - Store fingerprint in TaskWorker after preflight passes - Pass fingerprint through TaskContext to handlers - Apply timezone via CDP and locale via Accept-Language header - Ensures browser fingerprint matches proxy IP location This fixes anti-detect detection where timezone/locale mismatch with proxy IP was getting blocked by Cloudflare. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
/**
|
|
* Test script to capture and save full Jane payload
|
|
* Usage: npx ts-node scripts/test-jane-payload.ts
|
|
*/
|
|
|
|
import * as fs from 'fs';
|
|
import { fetchProductsFromUrl } from '../src/platforms/jane';
|
|
|
|
const TEST_URL = 'https://theflowershopusa.com/mesa/menu/';
|
|
const OUTPUT_FILE = '/tmp/jane-test-payload.json';
|
|
|
|
async function main() {
|
|
console.log('Fetching Jane payload...');
|
|
|
|
const result = await fetchProductsFromUrl(TEST_URL);
|
|
|
|
// Build payload structure matching what would be saved
|
|
const payload = {
|
|
hits: result.products.map(p => p.raw),
|
|
store: result.store?.raw || null,
|
|
capturedAt: new Date().toISOString(),
|
|
platform: 'jane',
|
|
storeId: result.store?.id,
|
|
productCount: result.products.length,
|
|
responseCount: result.responses.length,
|
|
};
|
|
|
|
// Save to file
|
|
fs.writeFileSync(OUTPUT_FILE, JSON.stringify(payload, null, 2));
|
|
console.log(`\nPayload saved to: ${OUTPUT_FILE}`);
|
|
console.log(`Products: ${result.products.length}`);
|
|
console.log(`Size: ${Math.round(fs.statSync(OUTPUT_FILE).size / 1024)}KB`);
|
|
}
|
|
|
|
main().catch(console.error);
|