Greasy Fork 还支持 简体中文。

Anti-captcha JS

Just a script

目前為 2019-07-22 提交的版本,檢視 最新版本

此腳本不應該直接安裝,它是一個供其他腳本使用的函式庫。欲使用本函式庫,請在腳本 metadata 寫上: // @require https://update.cn-greasyfork.org/scripts/384000/719103/Anti-captcha%20JS.js

  1. //============================================================================
  2. // Anti-captcha System -submit
  3. //============================================================================
  4. function bitir(code)
  5. {
  6. var taskSolution=code;
  7. var injectedCode = "(" + function(taskSolution) {
  8. var recaptchaCallbackAlreadyFired = false;
  9. var recursiveCallbackSearch = function(object, solution, currentDepth, maxDepth) {
  10. if (recaptchaCallbackAlreadyFired) {
  11. return
  12. }
  13. var passedProperties = 0;
  14. for (var i in object) {
  15. passedProperties++;
  16. if (passedProperties > 15) {
  17. break
  18. }
  19. try {
  20. if (typeof object[i] == "object" && currentDepth <= maxDepth) {
  21. recursiveCallbackSearch(object[i], solution, currentDepth + 1, maxDepth)
  22. } else if (i == "callback") {
  23. if (typeof object[i] == "function") {
  24. recaptchaCallbackAlreadyFired = true;
  25. object[i](solution)
  26. } else if (typeof object[i] == "string" && typeof window[object[i]] == "function") {
  27. recaptchaCallbackAlreadyFired = true;
  28. window[object[i]](solution)
  29. }
  30. return
  31. }
  32. } catch (e) {}
  33. }
  34. };
  35. if (!recaptchaCallbackAlreadyFired) {
  36. if (typeof ___grecaptcha_cfg != "undefined" && typeof ___grecaptcha_cfg.clients != "undefined") {
  37. var oneVisibleRecaptchaClientKey = null;
  38. visible_recaptcha_element_search_loop: for (var i in ___grecaptcha_cfg.clients) {
  39. for (var j in ___grecaptcha_cfg.clients[i]) {
  40. if (___grecaptcha_cfg.clients[i][j] && typeof ___grecaptcha_cfg.clients[i][j].nodeName == "string" && typeof ___grecaptcha_cfg.clients[i][j].innerHTML == "string" && typeof ___grecaptcha_cfg.clients[i][j].innerHTML.indexOf("iframe") != -1) {
  41. if (___grecaptcha_cfg.clients[i][j].offsetHeight != 0 || ___grecaptcha_cfg.clients[i][j].childNodes.length && ___grecaptcha_cfg.clients[i][j].childNodes[0].offsetHeight != 0 || ___grecaptcha_cfg.clients[i][j].dataset.size == "invisible") {
  42. if (oneVisibleRecaptchaClientKey === null) {
  43. oneVisibleRecaptchaClientKey = i;
  44. break
  45. } else {
  46. oneVisibleRecaptchaClientKey = null;
  47. break visible_recaptcha_element_search_loop
  48. }
  49. }
  50. }
  51. }
  52. }
  53. if (oneVisibleRecaptchaClientKey !== null) {
  54. recursiveCallbackSearch(___grecaptcha_cfg.clients[oneVisibleRecaptchaClientKey], taskSolution, 1, 2)
  55. }
  56. }
  57. }
  58. } + ')("' + taskSolution + '");';
  59. var script = document.createElement("script");
  60. script.textContent = injectedCode;
  61. (document.head || document.documentElement).appendChild(script);
  62. script.remove();
  63. }
  64.  
  65. //============================================================================
  66. // Anti-captcha System -captcha
  67. //============================================================================
  68. (function(){
  69. // ...
  70. var d = document.getElementById("anticaptcha-imacros-account-key");
  71. if (!d) {
  72. d = document.createElement("div");
  73. d.innerHTML = "20add527ab0a8a870d327949a5f6555b";
  74. d.style.display = "none";
  75. d.id = "anticaptcha-imacros-account-key";
  76. document.body.appendChild(d);
  77. }
  78.  
  79. var s = document.createElement("script");
  80. s.src = "https://cdn.antcpt.com/imacros_inclusion/recaptcha.js?" + Math.random();
  81. document.body.appendChild(s);
  82. // ...
  83. })();
  84. //============================================================================
  85. // Anti-captcha System -error_control
  86. //============================================================================
  87. setInterval(function(){captFixError()},10000);
  88. function captFixError()
  89. {
  90. // If the captcha api get an error, we will try to solve it
  91. //document.getElementsByClassName('antigate_solver in_process');
  92. if(keyvalue){ var keyvalue = document.getElementById('g-recaptcha-response-3').value; }
  93. if( !keyvalue.length <= 1){
  94. bitir(keyvalue);
  95. }
  96. if (document.getElementsByClassName('error').length >= 1)
  97. {
  98. document.getElementsByClassName("disconnectbtn")[0].click();
  99. document.getElementsByClassName("disconnectbtn")[0].click();
  100. window.location.reload();
  101. }
  102. else {console.log('Captcha Status: Good');}
  103. }