rziz.net captcha

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

Verzia zo dňa 19.04.2015. Pozri najnovšiu verziu.

// ==UserScript==
// @name          rziz.net captcha
// @description   After you click "Slow download" button the script solves the numeric captcha, waits for the countdown to finish, clicks the download button
// @include       http://www.rziz.net/*/*.html
// @version       1.0
// @author        wOxxOm
// @namespace     wOxxOm.scripts
// @license       MIT License
// @grant         none
// @run-at        document-start
// ==/UserScript==

document.addEventListener('DOMContentLoaded', function() {
  var x = document.evaluate('//form//div/span[contains("0123456789",.)]', document,
                            null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
  var btn = document.getElementById('btn_download');
  if (x && btn) {
    var nodes = [];
	for (i = 0; i < x.snapshotLength; i++)
		nodes.push(x.snapshotItem(i));
    var nodes = nodes.sort(function(a,b){ return parseInt(a.style.paddingLeft) - parseInt(b.style.paddingLeft) });
    document.forms.F1.code.value = nodes.map(function(n){ return n.textContent }).join('');

    new MutationObserver(function(mutations) {
      if (!btn.disabled)
        document.forms.F1.submit();
    }).observe(btn, {attributes:true, attributesFilter:['disabled']});
  }
});