fix: Camoufox anti-detection upgrade + Docker scraping fix#1
Open
PHY041 wants to merge 4 commits into
Open
Conversation
…ligence Loads pre-analyzed dataset (4,119 products / 80,912 images) to provide category baselines. Scrape results are now compared against the full category — GPT generates data-backed recommendations like "87% of competitors missing size chart" and "A+ adoption 65.4%, avg score 7.0/9". - New benchmark_service.py: lazy-load + pre-aggregate by 19 categories - New /benchmarks API: categories, category detail, top-gaps, reverse-prompts - Pipeline injects benchmark into strategy_gen, story_arc, listing_service - HTML report: new Category Benchmark section with comparison charts - Frontend: new Benchmark tab with opportunity cards and delta bars - ZIP export: includes benchmark.json Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Browser upgrades:
- Add residential proxy support via PROXY_URL env var
- Add custom binary override via CAMOUFOX_PATH env var
- Use headless='virtual' on Linux for full WebGL/GLX (avoids Amazon detection)
- BrowserPool singleton pattern with atexit cleanup
Pipeline fixes:
- Fix photo_map not bound to config.color_variants (images never reached pipeline)
- Stream multipart uploads through Next.js proxy (preserve boundary)
- Add listing import endpoint (POST /listing/jobs/{job_id}/import)
- Pass PROXY_URL and CAMOUFOX_PATH through docker-compose
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use `python -m camoufox fetch` instead of importing the module, which doesn't trigger binary download. The 707MB Firefox binary is now baked into the image at build time. Tested: Amazon search returns 60 results in Docker container with headless='virtual' (proper Xvfb + GLX support). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Install `.[api]` extras (uvicorn, python-multipart, python-dotenv) - Add `camoufox[geoip]` for auto-geolocation via IP - Remove `xvfb-run` from CMD — headless='virtual' manages its own Xvfb internally, dual Xvfb causes display conflicts - Use JSON CMD form for proper signal handling Tested: Amazon.sg search returns 48 results, Amazon.com search returns 60 results (auto-redirected via geoip), API health OK. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
headless='virtual'for full WebGL/GLX support + properly pre-download binary withpython -m camoufox fetchPROXY_URLenv var (auto-detects geolocation)CAMOUFOX_PATHenv var (for future FF146 upgrade)config.color_variants(images never reached generation pipeline)POST /listing/jobs/{job_id}/import)Test plan
headless='virtual'launches Xvfb with GLX automaticallyPROXY_URL) for Amazon.com (vs Amazon.sg redirect)🤖 Generated with Claude Code