AUTO-OPEN hCaptcha + reCaptcha


SUBMITTED BY: ccont2246

DATE: Dec. 22, 2022, 12:45 p.m.

FORMAT: Text only

SIZE: 4.0 kB

HITS: 49265

  1. // ==UserScript==
  2. // @name AUTO-OPEN hCaptcha + reCaptcha
  3. // @author WXC
  4. // @version 1.0
  5. // @description Auto clicks the recaptcha and hcaptcha - NOT SOLVING
  6. // @match https://*/recaptcha/*
  7. // @match https://*.hcaptcha.com/*hcaptcha-challenge*
  8. // @match https://*.hcaptcha.com/*checkbox*
  9. // @match https://*.hcaptcha.com/*captcha*
  10. // @grant none
  11. // @license MIT
  12. // @namespace https://greasyfork.org/users/713625
  13. // ==/UserScript==
  14. // you can configure auto-open interval in HC_PAUSE or RC_PAUSE
  15. function qSelector(selector) {
  16. return document.querySelector(selector);
  17. }
  18. function isHidden(el) {
  19. return (el.offsetParent === null)
  20. }
  21. (function() {
  22. 'use strict';
  23. var domain = (window.location != window.parent.location) ? document.referrer.toString() : document.location.toString();
  24. // excluding domains
  25. if(
  26. domain.indexOf('example.com') == -1
  27. &&
  28. domain.indexOf('PartOfUrlName') == -1
  29. &&
  30. domain.indexOf('paypal.com') == -1
  31. ) {
  32. // HCAPTCHA SECTION
  33. const HC_PAUSE = "3000"; // ms to open ( 3000ms = 5sec )
  34. const HC_CHECK_BOX = "#checkbox";
  35. const HC_ARIA_CHECKED = "aria-checked";
  36. if (window.location.href.includes("checkbox")) {
  37. var hc_checkboxInterval = setInterval(function() {
  38. if (!qSelector(HC_CHECK_BOX)) {
  39. } else if (qSelector(HC_CHECK_BOX).getAttribute(HC_ARIA_CHECKED) == "true") {
  40. clearInterval(hc_checkboxInterval);
  41. console.log("HC SOLVED");
  42. } else if (!isHidden(qSelector(HC_CHECK_BOX)) && qSelector(HC_CHECK_BOX).getAttribute(HC_ARIA_CHECKED) == "false") {
  43. qSelector(HC_CHECK_BOX).click();
  44. clearInterval(hc_checkboxInterval);
  45. console.log("HC OPEN BOX");
  46. } else {
  47. return;
  48. }
  49. }, HC_PAUSE );
  50. }
  51. // RECAPTCHA SECTION
  52. const RC_PAUSE = "3000"; // ms to open ( 3000ms = 5sec )
  53. const CHECK_BOX = ".recaptcha-checkbox-border";
  54. const RECAPTCHA_STATUS = "#recaptcha-accessible-status";
  55. const DOSCAPTCHA = ".rc-doscaptcha-body";
  56. var rc_checkboxInterval = setTimeout(function() {
  57. var solved = false;
  58. var checkBoxClicked = false;
  59. var requestCount = 0;
  60. var recaptchaInitialStatus = qSelector(RECAPTCHA_STATUS) ? qSelector(RECAPTCHA_STATUS).innerText : ""
  61. function isHidden(el) {
  62. return(el.offsetParent === null)
  63. }
  64. try {
  65. if(!checkBoxClicked && qSelector(CHECK_BOX) && !isHidden(qSelector(CHECK_BOX))) {
  66. qSelector(CHECK_BOX).click();
  67. checkBoxClicked = true;
  68. console.log("RC OPEN BOX");
  69. }
  70. //Check if the captcha is solved
  71. if(qSelector(RECAPTCHA_STATUS) && (qSelector(RECAPTCHA_STATUS).innerText != recaptchaInitialStatus)) {
  72. solved = true;
  73. console.log("RC SOLVED");
  74. }
  75. if(requestCount > 1) {
  76. console.log("Attempted Max Retries. Stopping the solver");
  77. solved = true;
  78. }
  79. //Stop solving when Automated queries message is shown
  80. if(qSelector(DOSCAPTCHA) && qSelector(DOSCAPTCHA).innerText.length > 0) {
  81. console.log("Automated Queries Detected");
  82. }
  83. } catch(err) {
  84. console.log(err.message);
  85. console.log("An error occurred while solving. Stopping the solver.");
  86. }
  87. }, RC_PAUSE );
  88. }
  89. else {
  90. console.log( domain +" EXCLUDED!" );
  91. }
  92. })();

comments powered by Disqus