mirror of
https://github.com/FlareSolverr/FlareSolverr.git
synced 2025-12-05 17:18:19 +01:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3f279e9aa9 | ||
|
|
d962e1a14e |
@@ -8,11 +8,11 @@
|
||||
[](https://en.cryptobadges.io/donate/13Hcv77AdnFWEUZ9qUpoPBttQsUT7q9TTh)
|
||||
[](https://en.cryptobadges.io/donate/0x0D1549BbB00926BF3D92c1A8A58695e982f1BE2E)
|
||||
|
||||
FlareSolverr is a proxy server to bypass Cloudflare protection.
|
||||
FlareSolverr is a proxy server to bypass Cloudflare and DDoS-GUARD protection.
|
||||
|
||||
## How it works
|
||||
|
||||
FlareSolverr starts a proxy server and it waits for user requests in an idle state using few resources.
|
||||
FlareSolverr starts a proxy server, and it waits for user requests in an idle state using few resources.
|
||||
When some request arrives, it uses [puppeteer](https://github.com/puppeteer/puppeteer) with the
|
||||
[stealth plugin](https://github.com/berstend/puppeteer-extra/tree/master/packages/puppeteer-extra-plugin-stealth)
|
||||
to create a headless browser (Firefox). It opens the URL with user parameters and waits until the Cloudflare challenge
|
||||
|
||||
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "flaresolverr",
|
||||
"version": "2.2.3",
|
||||
"version": "2.2.4",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "flaresolverr",
|
||||
"version": "2.2.3",
|
||||
"version": "2.2.4",
|
||||
"description": "Proxy server to bypass Cloudflare protection.",
|
||||
"scripts": {
|
||||
"start": "tsc && node ./dist/server.js",
|
||||
|
||||
@@ -21,7 +21,8 @@ const CAPTCHA_SELECTORS: string[] = [
|
||||
export default async function resolveChallenge(url: string, page: Page, response: HTTPResponse): Promise<HTTPResponse> {
|
||||
|
||||
// look for challenge and return fast if not detected
|
||||
let cfDetected = response.headers().server && response.headers().server.startsWith('cloudflare');
|
||||
let cfDetected = response.headers().server &&
|
||||
(response.headers().server.startsWith('cloudflare') || response.headers().server.startsWith('ddos-guard'));
|
||||
if (cfDetected) {
|
||||
if (response.status() == 403 || response.status() == 503) {
|
||||
cfDetected = true; // Defected CloudFlare and DDoS-GUARD
|
||||
|
||||
@@ -15,7 +15,7 @@ const postUrl = "https://ptsv2.com/t/qv4j3-1634496523";
|
||||
const cfUrl = "https://pirateiro.com/torrents/?search=harry";
|
||||
const cfCaptchaUrl = "https://idope.se"
|
||||
const cfBlockedUrl = "https://www.torrentmafya.org/table.php"
|
||||
const ddgUrl = "https://www.erai-raws.info/feed/?type=magnet";
|
||||
const ddgUrl = "https://anidex.info/";
|
||||
const ccfUrl = "https://www.muziekfabriek.org";
|
||||
|
||||
beforeAll(async () => {
|
||||
@@ -189,12 +189,12 @@ describe("Test '/v1' path", () => {
|
||||
expect(solution.url).toContain(ddgUrl)
|
||||
expect(solution.status).toBe(200);
|
||||
expect(Object.keys(solution.headers).length).toBeGreaterThan(0)
|
||||
expect(solution.response).toContain("<rss version")
|
||||
expect(solution.response).toContain("<!DOCTYPE html>")
|
||||
expect(Object.keys(solution.cookies).length).toBeGreaterThan(0)
|
||||
expect(solution.userAgent).toContain("Firefox/")
|
||||
|
||||
const cfCookie: string = (solution.cookies as any[]).filter(function(cookie) {
|
||||
return cookie.name == "__ddg1";
|
||||
return cookie.name == "__ddg1_";
|
||||
})[0].value
|
||||
expect(cfCookie.length).toBeGreaterThan(10)
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user