kavion commited on
Commit
b60f5ef
·
unverified ·
1 Parent(s): 1445d9d

fix: add stealth browser flags to bypass Cloudflare bot detection

Browse files
Files changed (1) hide show
  1. turnstile-solver.js +10 -3
turnstile-solver.js CHANGED
@@ -65,7 +65,7 @@ class TurnstileSolver {
65
  headless: false,
66
  turnstile: true,
67
  connectOption: {
68
- defaultViewport: { width: this.width, height: this.height },
69
  timeout: 120000,
70
  protocolTimeout: 300000,
71
  args: [
@@ -73,12 +73,19 @@ class TurnstileSolver {
73
  '--no-sandbox',
74
  '--disable-setuid-sandbox',
75
  '--disable-dev-shm-usage',
76
- '--disable-gpu',
77
  '--disable-web-security',
78
  '--disable-features=IsolateOrigins,site-per-process',
 
 
 
 
 
 
 
79
  ],
80
  },
81
- disableXvfb: true, // Xvfb sudah jalan dari Docker CMD
82
  });
83
 
84
  this.browser = browser;
 
65
  headless: false,
66
  turnstile: true,
67
  connectOption: {
68
+ defaultViewport: null, // pakai ukuran window asli, lebih natural
69
  timeout: 120000,
70
  protocolTimeout: 300000,
71
  args: [
 
73
  '--no-sandbox',
74
  '--disable-setuid-sandbox',
75
  '--disable-dev-shm-usage',
76
+ '--disable-blink-features=AutomationControlled',
77
  '--disable-web-security',
78
  '--disable-features=IsolateOrigins,site-per-process',
79
+ '--ignore-certificate-errors',
80
+ '--lang=en-US,en;q=0.9',
81
+ // Paksa software rendering agar GPU tidak terdeteksi kosong
82
+ '--use-gl=swiftshader',
83
+ '--use-angle=swiftshader',
84
+ // Profil user agent Windows agar terlihat seperti desktop biasa
85
+ '--user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36',
86
  ],
87
  },
88
+ disableXvfb: true,
89
  });
90
 
91
  this.browser = browser;