Cloudflare Turnstile Bypass with 2Captcha

Solves Cloudflare Turnstile using 2Captcha

  1. // ==UserScript==
  2. // @name Cloudflare Turnstile Bypass with 2Captcha
  3. // @namespace http://yourdomain.com/
  4. // @version 1.1
  5. // @description Solves Cloudflare Turnstile using 2Captcha
  6. // @match *://*/*
  7. // @grant none
  8. // ==/UserScript==
  9.  
  10. const axios = require('axios');
  11.  
  12. // API Key from 2Captcha (আপনারটা এখানে বসান)
  13. const API_KEY = '4429633d0beca8b7e7142514e2965e57';
  14.  
  15. // CAPTCHA site key ও target URL (এগুলো আপনার পেজ অনুযায়ী বসাতে হবে)
  16. const SITE_KEY = 'YOUR_SITE_KEY_HERE';
  17. const PAGE_URL = 'https://example.com'; // যেই পেজে CAPTCHA আছে
  18.  
  19. // Step 1: CAPTCHA Solve Request পাঠানো
  20. async function requestCaptchaSolution() {
  21. try {
  22. const res = await axios.post('http://2captcha.com/in.php', null, {
  23. params: {
  24. key: API_KEY,
  25. method: 'turnstile', // যদি Turnstile হয়, নাহলে 'userrecaptcha'
  26. sitekey: SITE_KEY,
  27. pageurl: PAGE_URL,
  28. json: 1
  29. }
  30. });
  31.  
  32. if (res.data.status === 1) {
  33. console.log('Captcha ID:', res.data.request);
  34. return res.data.request;
  35. } else {
  36. throw new Error('CAPTCHA request failed: ' + res.data.request);
  37. }
  38. } catch (err) {
  39. console.error('Error requesting CAPTCHA:', err.message);
  40. }
  41. }
  42.  
  43. // Step 2: সলিউশন পাওয়ার জন্য Wait ও Poll করা
  44. async function getCaptchaResult(captchaId) {
  45. try {
  46. while (true) {
  47. const res = await axios.get('http://2captcha.com/res.php', {
  48. params: {
  49. key: API_KEY,
  50. action: 'get',
  51. id: captchaId,
  52. json: 1
  53. }
  54. });
  55.  
  56. if (res.data.status === 1) {
  57. console.log('CAPTCHA Solved:', res.data.request);
  58. return res.data.request;
  59. } else if (res.data.request === 'CAPCHA_NOT_READY') {
  60. console.log('Waiting for solution...');
  61. await new Promise(r => setTimeout(r, 5000));
  62. } else {
  63. throw new Error('Error getting CAPTCHA result: ' + res.data.request);
  64. }
  65. }
  66. } catch (err) {
  67. console.error('Error getting solution:', err.message);
  68. }
  69. }
  70.  
  71. // Full Flow
  72. (async () => {
  73. const captchaId = await requestCaptchaSolution();
  74. if (captchaId) {
  75. const solution = await getCaptchaResult(captchaId);
  76. console.log('\nUse this token in your request:', solution);
  77.  
  78. // এখানে আপনি এই টোকেন দিয়ে যেই রিকুয়েস্ট করবেন সেটি তৈরি করতে পারেন।
  79. }
  80. })();