Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: FlareSolverr integration #83

Open
actuallymentor opened this issue Aug 31, 2024 · 0 comments
Open

Feature request: FlareSolverr integration #83

actuallymentor opened this issue Aug 31, 2024 · 0 comments

Comments

@actuallymentor
Copy link

actuallymentor commented Aug 31, 2024

Thanks for the amazing work on this project!

A lot of websites are behind a cloudflare wall, which can in many cases be solved with FlareSolverr/FlareSolverr.

FlareSolverr is a cookie retreival tool. Usage is usually with a Docker container, which can then be called with:

curl -L -X POST 'http://CONTAINERNAME:8191/v1' \
-H 'Content-Type: application/json' \
--data-raw '{
  "cmd": "request.get",
  "url": "http://www.google.com/",
  "maxTimeout": 60000
}'

The container returns a cookie response, see this docs section, that looks like:

{
    "solution": {
        "url": "https://www.google.com/?gws_rd=ssl",
        "status": 200,
        "headers": {
            "status": "200",
            "date": "Thu, 16 Jul 2020 04:15:49 GMT",
            "expires": "-1",
            "cache-control": "private, max-age=0",
            "content-type": "text/html; charset=UTF-8",
            "strict-transport-security": "max-age=31536000",
            "p3p": "CP=\"This is not a P3P policy! See g.co/p3phelp for more info.\"",
            "content-encoding": "br",
            "server": "gws",
            "content-length": "61587",
            "x-xss-protection": "0",
            "x-frame-options": "SAMEORIGIN",
            "set-cookie": "1P_JAR=2020-07-16-04; expires=Sat..."
        },
        "response":"<!DOCTYPE html>...",
        "cookies": [
            {
                "name": "NID",
                "value": "204=QE3Ocq15XalczqjuDy52HeseG3zAZuJzID3R57...",
                "domain": ".google.com",
                "path": "/",
                "expires": 1610684149.307722,
                "size": 178,
                "httpOnly": true,
                "secure": true,
                "session": false,
                "sameSite": "None"
            },
            {
                "name": "1P_JAR",
                "value": "2020-07-16-04",
                "domain": ".google.com",
                "path": "/",
                "expires": 1597464949.307626,
                "size": 19,
                "httpOnly": false,
                "secure": true,
                "session": false,
                "sameSite": "None"
            }
        ],
        "userAgent": "Windows NT 10.0; Win64; x64) AppleWebKit/5..."
    },
    "status": "ok",
    "message": "",
    "startTimestamp": 1594872947467,
    "endTimestamp": 1594872949617,
    "version": "1.0.0"
}

Ladder can then use those cookies in a retry request that satisfies the Cloudflare requirements.

NOTES

  • as mentioned in Medium.com blocked by cloudflare #72, FlareSolverr runs headless chrome so is quite heavy. This shouldn't matter for Ladder as it is an external tool that is up to the user to maintain (probably in a docker composition)
  • the implementation will likely be a FLARESOLVERR_HOST environment variable that if set would be used on failed requests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant