Files
autoreg-skills-max/skills/account-validation/references/flaresolverr-discourse.md

34 lines
972 B
Markdown

# 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:
```python
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 |
| Reddit | Yes | ❌ Blocked |
| dc.hhhl.cc | No | Not needed |