diff --git a/app/beauty_main.py b/app/beauty_main.py index 1d82c1e..54d4aeb 100644 --- a/app/beauty_main.py +++ b/app/beauty_main.py @@ -188,6 +188,26 @@ async def validator_status(): # ── Pre-screen (shared) ─────────────────────────────────────────────────────── +@app.post("/api/validate/batch") +async def validate_batch(body: dict): + """HTTP-check only — no DeepSeek classification. Fast live/dead check for bulk selection.""" + domains_list = body.get("domains", []) + if not domains_list: + return JSONResponse({"error": "no domains provided"}, status_code=400) + if len(domains_list) > 500: + return JSONResponse({"error": "max 500 per batch"}, status_code=400) + from app.prescreener import prescreen_domains + results = await prescreen_domains(domains_list) + await save_prescreen_results(results) + counts: dict = {} + for r in results: + s = r.get("prescreen_status", "dead") + counts[s] = counts.get(s, 0) + 1 + return {"total": len(domains_list), "live": counts.get("live", 0), + "dead": counts.get("dead", 0), "parked": counts.get("parked", 0), + "redirect": counts.get("redirect", 0), "error": counts.get("error", 0)} + + @app.post("/api/prescreen/batch") async def prescreen_batch(body: dict): domains_list = body.get("domains", []) diff --git a/app/static/beauty/index.html b/app/static/beauty/index.html index 87eeb8c..3b88147 100644 --- a/app/static/beauty/index.html +++ b/app/static/beauty/index.html @@ -145,6 +145,12 @@ textarea{width:100%;resize:vertical;font-family:monospace;font-size:12px} + +