puppeteer-dart icon indicating copy to clipboard operation
puppeteer-dart copied to clipboard

infinite 503 problem cloudflare page

Open linkkader opened this issue 2 years ago • 8 comments

hi i always stuck on this cloudflare page https://anime-flix.net/

import '../bin/utils/string.dart';
import 'package:puppeteer/plugins/stealth.dart';
import 'package:puppeteer/puppeteer.dart';

Future<void> main() async {
  puppeteer.plugins.add(StealthPlugin());
  var browser = await puppeteer.launch(headless: false, args: [

  ],noSandboxFlag: true, ignoreHttpsErrors: true,ignoreDefaultArgs: true
  );
  var page = ( await browser.pages).first;
  await page.setJavaScriptEnabled(true);
  await page.goto("https://anime-flix.net/");
}

Screen Shot 2022-06-08 at 03 30 55

linkkader avatar Jun 08 '22 02:06 linkkader

@linkkader have you found a solution? @xvrh any advice on how to solve this? I am stuck on a Cloudflare page as well.

My scenario is a bit different though, I need to solve a challenge like this: Unbenannt

but even if I solve it manually, I am stuck in an infinite redirection loop.

Cloudflare seems to detect the chromium instance because I am running puppeteer locally so the IP should be safe, right?

I have tried to launch puppeteer with the StealthPlugin and add a few extra steps, but no success:

    await page.setJavaScriptEnabled(true);
    await page.setUserAgent(
      'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36',
    );
    await page.setExtraHTTPHeaders({
      'Accept-Language': 'en-US,en;q=0.9',
    });

Wizzel1 avatar Dec 27 '22 12:12 Wizzel1

@Wizzel1 yes there is a ploblem with StealthPlugin() in my case i solve it by directly modify it i compare it with javascript StealthPlugin

linkkader avatar Dec 27 '22 12:12 linkkader

@linkkader thats great, would you mind sharing your modifications?

Wizzel1 avatar Dec 27 '22 12:12 Wizzel1

@Wizzel1 @linkkader any update ?

Zhairgling avatar Jan 30 '23 10:01 Zhairgling

@Zhairgling Unfortunately not

Wizzel1 avatar Jan 30 '23 10:01 Wizzel1

@Wizzel1 @Zhairgling you can check here the modification i add https://github.com/linkkader/puppeteer-dart let me know if it works

linkkader avatar Jan 30 '23 13:01 linkkader

@Wizzel1 @Zhairgling you can check here the modification i add https://github.com/linkkader/puppeteer-dart let me know if it works

working for me. Thanks

Zhairgling avatar Jan 30 '23 14:01 Zhairgling

@linkkader Sorry for my late answer. Your PR did not work for me, unfortunately.

I had to set the pages userAgent to make it work in my case.

  page = await browser.newPage();
  await page.setUserAgent(
    'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/110.0',
  );

Wizzel1 avatar Apr 20 '23 19:04 Wizzel1