← back to Yolo Agent
tasks/deferred/40_refresh-thibaut-images-real.md
52 lines
# Refresh Thibaut Images — Real Re-Scrape
**Context:** 272 Thibaut products in `vendor_catalog` (not on Shopify) have stale `d2g31xe1lftxud.cloudfront.net` image URLs. An earlier session wrapped them in a `cdn.thibautdesign.com` Cloudflare Image Resizer proxy, which worked for ~150 recent products but ~250+ old products still 404 because the source images were actually removed from Thibaut's CDN.
**Goal:** Get fresh working image URLs for the ~250 still-broken Thibaut products by scraping `thibautdesign.com` directly.
## Approach
1. **Identify the target set:**
```sql
SELECT id, mfr_sku, pattern_name
FROM vendor_catalog
WHERE vendor_code='thibaut'
AND shopify_product_id IS NULL
AND (ai_colors IS NULL OR jsonb_array_length(ai_styles) = 0)
ORDER BY mfr_sku;
```
2. **Check existing scrapers first:**
```bash
ls /root/DW-Agents/vendor-scrapers/ | grep -i thibaut
```
Known files: `backfill-thibaut-images.js`, `refresh-thibaut-images.js`, `scrape-thibaut-full.js`, `thibaut-image-crawler.js`, `thibaut-full-monty.js`
3. **Try `thibaut-image-crawler.js` first** — it's designed to fetch current images. Run with a limit to test:
```bash
cd /root/DW-Agents/vendor-scrapers && timeout 1800 node thibaut-image-crawler.js --limit 50
```
4. **If that doesn't work,** check `scrape-thibaut-full.js` which may hit thibautdesign.com product pages directly.
5. **After scrape,** verify a sample of updated URLs actually resolve to HTTP 200, then run enrichment:
```bash
# Enrichment reads from thibaut_catalog by default - ensure data flows there
cd /root/DW-Agents/vendor-scrapers && timeout 1800 node enrich-ai-tags.js thibaut --limit 300
```
6. **Propagate refreshed URLs into `vendor_catalog`** (sync thibaut_catalog → vendor_catalog where mfr_sku matches).
## Report
- How many URLs refreshed
- How many products now pass FULLPRODUCT gate
- Any products that couldn't be recovered
- Gemini enrichment success count
## Safe to stop if
- Thibaut's site is down or blocking puppeteer
- No existing scraper produces working URLs
- Products are genuinely discontinued (no page on thibautdesign.com)