972 B
972 B
FlareSolverr HTML Wrapper Pattern
When using FlareSolverr to bypass Cloudflare on Discourse forums (linux.do, etc.), the API response JSON is wrapped in HTML <pre> tags:
FlareSolverr response:
{
"status": "ok",
"solution": {
"response": "<html><head>...</head><body><pre>{...actual JSON...}</pre></body></html>"
}
}
Fix: Extract JSON from <pre> before parsing:
resp = data["solution"]["response"]
if "<pre>" in resp and "</pre>" in resp:
resp = resp.split("<pre>")[1].split("</pre>")[0]
data = json.loads(resp) # Now works
Working FlareSolverr endpoints (on DO server [REDACTED-IP]):
http://localhost:8191/v1— FlareSolverr API- POST with
{"cmd": "request.get", "url": "...", "maxTimeout": 30000}
Known targets:
| Site | CF? | FlareSolverr? |
|---|---|---|
| linux.do | Yes | ✅ Works |
| nodeloc.com | No | Not needed |
| Yes | ❌ Blocked | |
| dc.hhhl.cc | No | Not needed |