[Premium] H-Captcha Solver by Andrewblood

Use the 2Captcha service to successfully complete the H-Captcha

目前為 2025-03-03 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name [Premium] H-Captcha Solver by Andrewblood
  3. // @namespace https://gf.qytechs.cn/users/1162863
  4. // @version 1.0.3
  5. // @description Use the 2Captcha service to successfully complete the H-Captcha
  6. // @author Andrewblood
  7. // @match *://*/*
  8. // @exclude *challenges.cloudflare.com/*
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=coinfinity.top
  10. // @noframes
  11. // @grant GM_xmlhttpRequest
  12. // @antifeature referral-link Referral-Link is in this Script integrated.
  13. // @license Copyright Andrewblood
  14. // ==/UserScript==
  15. /*
  16.  
  17. !!! You need balance on https://2captcha.com/?from=19960724 and the price is 2,99$ for 1000 h-captchas !!!
  18.  
  19. 1) Please open a new Account at https://2captcha.com/?from=19960724
  20. 2) Deposit your choosen amounnt of money. (I have 10$ every 3 months)
  21. 3) Insert your API key from the Dashboard at the beginning of this script source/code.
  22. 4) If one site I don't have added the sitekey you can write a comment or add it under "sitekeys" manualy
  23.  
  24. You can find the sitekey of your domain when you press F12 in chrome browser for console and then press CRTL+F for searching elements.
  25. Then you must only type/search for "site_key" or "sitekey" and look that it stand hcaptcha before the sitekey. (extract only the key)
  26.  
  27. */
  28. (function() {
  29. 'use strict';
  30.  
  31. // Number of questions to 2Captcha when the captcha is solved
  32. var maxAttempts = 60;
  33.  
  34. // Wait time in milliseconds between questions
  35. var delay = 2000;
  36.  
  37. // Your API Key from 2captcha.com (balance is needed)
  38. var apiKey = 'YOUR_API_KEY_HERE';
  39.  
  40. var sitekeys = {
  41. 'autofaucet.dutchycorp.space': '277d934d-3bdc-49bd-90bb-a73f9e0eef0d',
  42. "dutchycorp.space/shp2": "dcce507b-3d06-4cf7-a1b4-35d6b7fa4cd0",
  43. 'dutchycorp.ovh': 'dcce507b-3d06-4cf7-a1b4-35d6b7fa4cd0',
  44. 'playonpc.online': '215ae94b-b7f2-4cc6-9af0-ee259eca5ad1',
  45. "quins.us": "215ae94b-b7f2-4cc6-9af0-ee259eca5ad1",
  46. "gally.shop": "215ae94b-b7f2-4cc6-9af0-ee259eca5ad1",
  47. 'wordcounter.icu': 'fbd3c1c5-bfa3-4f8f-a70f-cb612e3bb044',
  48. 'adshnk.com': '7dee8357-7cd2-41d7-8b48-158f96365173',
  49. // "surflink.tech": "9ed65efe-ab27-4439-8d4a-edb52e6c796b",
  50. "shortit.pw": "da32ea56-c2ae-4b42-aa52-31fcfe240408",
  51. "dekhe.click": "2f9e938c-2526-45eb-8361-6b9a47caf978",
  52. };
  53.  
  54. var titles = [
  55. 'Just a moment', // Englisch
  56. '稍等片刻', // Chinesisch
  57. 'Een ogenblik', // Holländisch
  58. 'Un instant', // Französisch
  59. 'Nur einen Moment', // Deutsch
  60. 'Un momento', // Italienisch
  61. 'Um momento', // Portugiesisch
  62. 'Bir an', // Türkisch
  63. "Fly"
  64. ];
  65. if (titles.some(title => document.title.includes(title))) {
  66. console.log('Cloudflare Challenger page recognised. H-Captcha Solver Script is not executed.');
  67. } else if (apiKey == "YOUR_API_KEY_HERE") {
  68. console.log('Please enter a valid API key in the H-Captcha Solver Script.');
  69. } else {
  70.  
  71. createTextElement();
  72.  
  73. showMessage("H-Captcha Solver by Andrewblood is turned on and no captcha was found on this page.", "blue");
  74.  
  75. const interval001 = setInterval(() => {
  76. const captchaElement = document.querySelector('#captchaShortlink, .h-captcha, .g-recaptcha-antibot');
  77. const captchaResponse = document.querySelector('[name="h-captcha-response"]');
  78.  
  79. if (captchaElement) {
  80. clearInterval(interval001);
  81. showMessage('H-Captcha detected and look in script for a saved sitekey!', "green");
  82.  
  83. // Aktuelle URL abrufen
  84. const currentURL = window.location.href;
  85.  
  86. // Funktion, um den Sitekey basierend auf der URL zu finden
  87. const findSiteKey = () => {
  88. for (const urlPart in sitekeys) {
  89. if (currentURL.includes(urlPart)) {
  90. return sitekeys[urlPart];
  91. }
  92. }
  93. return null;
  94. };
  95.  
  96. const sitekey = findSiteKey();
  97.  
  98. if (sitekey) {
  99. showMessage('H-Captcha and Sitekey found: Starting the resolving process.', "green");
  100. getCaptchaResponse(sitekey)
  101. .then(response => {
  102. if (response && response.token) {
  103. const captchaResponse = document.querySelector('[name="h-captcha-response"]');
  104. if (captchaResponse) {
  105. captchaResponse.value = response.token;
  106. showMessage('Captcha successfully solved!', "green");
  107. const invisibleButton = document.querySelector("#invisibleCaptchaShortlink");
  108. if (invisibleButton) invisibleButton.removeAttribute("disabled");
  109. } else {
  110. showMessage('Captcha response element not found in the DOM.', "red");
  111. }
  112. } else {
  113. showMessage('Failed to solve captcha', "red");
  114. window.location.reload();
  115. }
  116. })
  117. .catch(err =>console.log('Error fetching captcha response:', err));
  118. } else {
  119. showMessage('Sitekey from this page is not saved in the script.', "red");
  120. }
  121. }
  122. }, 500);
  123.  
  124. var textElement;
  125. function createTextElement() {
  126. textElement = document.createElement("div");
  127. textElement.style.position = "fixed";
  128. textElement.style.bottom = "0";
  129. textElement.style.left = "50%";
  130. textElement.style.transform = "translateX(-50%)";
  131. textElement.style.color = "blue";
  132. textElement.style.fontSize = "12px";
  133. textElement.style.zIndex = "9999";
  134. textElement.style.fontFamily = "Arial, sans-serif";
  135. textElement.style.textAlign = "center";
  136. textElement.style.display = "none";
  137. textElement.style.cursor = "pointer";
  138.  
  139. textElement.addEventListener("click", function () {
  140. window.open("https://2captcha.com/?from=19960724", "_blank");
  141. });
  142.  
  143. document.body.appendChild(textElement);
  144. }
  145.  
  146. function showMessage(newText, color) {
  147. if (!textElement) {
  148. createTextElement();
  149. }
  150. textElement.innerText = newText;
  151. textElement.style.color = color;
  152. textElement.style.display = "block";
  153. };
  154.  
  155. async function getCaptchaResponse(sitekey) {
  156. const requestUrl = `https://2captcha.com/in.php?key=${apiKey}&method=hcaptcha&sitekey=${sitekey}&pageurl=${window.location.href}`;
  157.  
  158. return new Promise((resolve, reject) => {
  159. GM_xmlhttpRequest({
  160. method: 'GET',
  161. url: requestUrl,
  162. onload: function(response) {
  163. if (response.responseText.startsWith('OK|')) {
  164. const captchaId = response.responseText.split('|')[1];
  165. // print('Captcha ID:', captchaId);
  166. pollCaptchaSolution(apiKey, captchaId).then(resolve).catch(reject);
  167. } else {
  168. console.log('Error sending captcha request:', response.responseText);
  169. reject(response.responseText);
  170. }
  171. },
  172. onerror: function(err) {
  173. console.log('Error in GM_xmlhttpRequest:', err);
  174. reject(err);
  175. }
  176. });
  177. });
  178. }
  179.  
  180. async function pollCaptchaSolution(apiKey, captchaId) {
  181. const resultUrl = `https://2captcha.com/res.php?key=${apiKey}&action=get&id=${captchaId}`;
  182.  
  183. for (let attempt = 0; attempt < maxAttempts; attempt++) {
  184. await new Promise(resolve => setTimeout(resolve, delay));
  185.  
  186. // Verwende GM_xmlhttpRequest anstelle von fetch
  187. const response = await new Promise((resolve, reject) => {
  188. GM_xmlhttpRequest({
  189. method: 'GET',
  190. url: resultUrl,
  191. onload: function(response) {
  192. resolve(response.responseText);
  193. },
  194. onerror: function(err) {
  195. console.log('Error in GM_xmlhttpRequest:', err);
  196. reject(err);
  197. }
  198. });
  199. });
  200.  
  201. if (response === 'CAPCHA_NOT_READY') {
  202. showMessage('The captcha has been sent to 2Captcha and we are now waiting for the completed captcha as a response.', "green");
  203. continue;
  204. }
  205.  
  206. if (response.startsWith('OK|')) {
  207. return { token: response.split('|')[1] };
  208. }
  209.  
  210. console.log('Error fetching captcha solution:', response);
  211. return null;
  212. }
  213.  
  214. showMessage('Captcha solution timed out', "red");
  215. return null;
  216. }
  217. }
  218. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址