import { attach, SAN } from '/tmp/cdp3.mjs'; import fs from 'fs'; const all=JSON.parse(fs.readFileSync('/tmp/all48.json','utf8')); const wm=JSON.parse(fs.readFileSync('/tmp/wm_verdicts.json','utf8')); const clean=JSON.parse(fs.readFileSync('/tmp/wm_clean.json','utf8')); const SHORT=['1027332215847','601964534137','750271307455']; const c=await attach('/web/smt/smtProductList/draft')||await attach('dianxiaomi.com'); await c.send('Runtime.enable'); for(const oid of SHORT){ const info=all[oid]; const raw=await c.evalJS(`(async()=>{ const rr=await fetch('/api/ozonProduct/add.json?id=${info.pid}&_t='+Date.now(),{headers:{'X-Requested-With':'XMLHttpRequest'}}); const tx=await rr.text(); if(!tx.startsWith('{'))return'{}'; const p=JSON.parse(tx).data.product; const s=new Set(); if(p.mainImage) s.add(p.mainImage); (p.extraImages||'').split(';').filter(Boolean).forEach(u=>s.add(u)); return JSON.stringify({name:(p.name||'').slice(0,40), main:p.mainImage, urls:[...s]}); })()`,true); const d=JSON.parse(String(raw)); console.log('\n ════ '+oid+' ════'); console.log(' '+d.name); console.log(' 干净图: '+(clean[oid]||[]).length+' 张'); console.log(' ── 全部候选图的判定 ──'); (d.urls||[]).slice(0,18).forEach((u,i)=>{ const v=wm[u]; const tag = !v ? '?' : (v.err? '✗'+v.err : (v.wm||v.contact? '⚠水印':'✅干净')); const txt = v && (v.text||v.reason) ? (' | '+String(v.text||v.reason).slice(0,50)) : ''; console.log(` [${i}] ${tag.padEnd(8)} ${u.split('/').pop().split('_')[0].slice(0,26)}${txt}`); }); } c.close();