"""W-E: S15sh1/S11sh4/S24sh2 스틸 단건 재생성 (force 완료 후 실행)."""
import sys, time
import requests

BASE = "http://localhost:8000"
PID = "b0ad5c18-5140-4022-a2b0-805de0e5a385"
TARGETS = [
    ("S11sh4", "c0734353-fa99-4486-83b3-900efa22d494"),
    ("S15sh1", "0334bd57-7134-4b66-91af-e7a37b7c470c"),
    ("S24sh2", "fd564bd6-5ddd-459c-a202-925cfd3e5599"),
]
s = requests.Session()
r = s.post(f"{BASE}/api/v1/auth/login", json={"username": "admin", "password": "admin123"}, timeout=30)
r.raise_for_status()
print("[login] ok", flush=True)
only = sys.argv[1] if len(sys.argv) > 1 else None
for tag, sid in TARGETS:
    if only and only != tag:
        continue
    t0 = time.time()
    r = s.post(f"{BASE}/api/v1/projects/{PID}/stills/{sid}/generate-image", json={}, timeout=900)
    print(f"[{tag}] {r.status_code} {time.time()-t0:.0f}s {r.text[:200]}", flush=True)
print("[done]", flush=True)
