screenshot service upgraded to REAL PNGs: chromium 150 installed on CT768 (RAM 1G->2G), PNG path live-verified (example.com 26KB, self-shot 535KB), honest-fallback note updated

This commit is contained in:
2026-10-01 12:15:03 -07:00
parent a102f3b047
commit 098f161213

4
app.py
View File

@@ -933,7 +933,7 @@ GET /api/shot/status/42
-> {"ok":true,"status":"text_fallback","title":"...","text_preview":"...","headings":[...]}
auth: session cookie or Authorization: Bearer dk_...
25c/shot, free with PASS - rate limit 6/min
NOTE: no headless browser on this host yet - expect text_fallback</pre></div>""").replace("BASE", SITE)
PNG mode: status "done" + png_b64. If chromium vanishes, expect text_fallback.</pre></div>""").replace("BASE", SITE)
SHOT_EXPLAINER = """<div class=card><b>HOW CAPTURE WORKS</b><br><span style="color:var(--dim);font-size:.85rem">
&bull; With <span title="headless Chromium renders the page with JS + CSS and writes a real 1280x1600 PNG — nothing is faked">headless Chromium</span> installed, /shot returns a real browser render as base64 PNG.
@@ -944,7 +944,7 @@ SHOT_EXPLAINER = """<div class=card><b>HOW CAPTURE WORKS</b><br><span style="col
@app.route("/shot")
def shot_page():
body = f"""
<h1>SCREEN <span>SHOT</span></h1><p class=sub>Point at a URL, get a render. Real headless-Chromium PNG when the host has one — an honest rendered-text + intel fallback when it doesn't. Never a fake image.</p>
<h1>SCREEN <span>SHOT</span></h1><p class=sub>Point at a URL, get a real 1280×1600 headless-Chromium PNG render (base64 in the API). Honest text+intel fallback only if the renderer is down. Never a fake image.</p>
<div class=card><b>New capture</b>
<form method=post action=/api/shot/create onsubmit="doShot();return false">
<input id=shoturl name=url placeholder="https://target.example" style="width:min(560px,100%)" required>