Simple html numeric captcha solver

After you click "Slow download" button the script solves the numeric captcha, waits for the countdown to finish, clicks the download button

目前为 2017-12-12 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Simple html numeric captcha solver
  3. // @description After you click "Slow download" button the script solves the numeric captcha, waits for the countdown to finish, clicks the download button
  4. // @include http://www.rziz.net/*/*.html
  5. // @include http://file.up09.com/*
  6. // @include http://clicknupload.com/*
  7. // @include http://hulkload.com/*
  8. // @include http://up4.im/*
  9. // @include http://www.gboxes.com/*
  10. // @include http://mrfile.co/*.html
  11. // @include http://fileshd.net/*
  12. // @include http://nizfile.net/*.html
  13. // @include http://lynxshare.com/*
  14. // @include http://datasbit.com/*
  15. // @include http://idup.to/*
  16. // @include http://media4up.com/*
  17. // @include http://salefiles.com/*
  18. // @version 1.1.2
  19. // @author wOxxOm
  20. // @namespace wOxxOm.scripts
  21. // @license MIT License
  22. // @run-at document-end
  23. // ==/UserScript==
  24.  
  25. var x = document.evaluate(
  26. '//form//div/span[contains("0123456789",.) and contains(@style,"padding-left")]',
  27. document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
  28. var btn = document.evaluate(
  29. '//form//*[not(*) and not(self::script) and (contains(@id,"btn") or contains(@id,"download") or contains(.,"download") or contains(.,"Download"))]',
  30. document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
  31. if (x && btn) {
  32. var nodes = [];
  33. for (var i = 0; i < 4; i++)
  34. nodes.push(x.snapshotItem(i));
  35. var nodes = nodes.sort((a,b) => parseInt(a.style.paddingLeft) - parseInt(b.style.paddingLeft));
  36. document.forms.F1.code.value = nodes.map(n => n.textContent).join('');
  37.  
  38. switch (location.hostname) {
  39. case 'clicknupload.com':
  40. document.forms.F1.submit();
  41. break;
  42. case 'media4up.com':
  43. new MutationObserver(mutations => mutations[0].target.style.visibility == 'hidden' && document.forms.F1.submit())
  44. .observe(document.querySelector('#countdown'), {attributes:true, attributeFilter:['style']});
  45. break;
  46. default:
  47. new MutationObserver(mutations => !btn.disabled && document.forms.F1.submit())
  48. .observe(btn, {attributes:true, attributeFilter:['disabled']});
  49. }
  50. }