Decrease click at Sakurafile

none

Verze ze dne 27. 03. 2017. Zobrazit nejnovější verzi.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name            Decrease click at Sakurafile
// @name:ja         Sakurafileで楽をするためのスクリプト
// @namespace       http://hogehoge/
// @version         1.0
// @description     none
// @description:ja  多分これが一番楽だと思います(使用は自己責任でお願いします)
// @author          H. Amami
// @match           *://sakurafile.com/*
// @run-at          document-end
// @grant           none
// ==/UserScript==

(function() {
    'use strict';
    if ($(".error_message").length !== 0 || $(".err").length !== 0) {
        console.error("Sakurafile error @ " + location.href);
    } else if (typeof $('#dlink').attr("href") !== "undefined") {
        console.info("Download started @ " + location.href);
        location.href = $('#dlink').attr("href");
    } else if ($('[name="op"]').val() === "download2") {
        var captcha_text = "";
        var $items = $('td>div>span:not(:first):not(:first)');
        $items.sort(function(a, b) {
            return parseInt($(a).css("padding-left")) > parseInt($(b).css("padding-left"));
        });
        $items.each(function() {
            captcha_text += $(this).text();
        });
        $(".captcha_code").val(captcha_text);
        console.info("Solved captcha (" + captcha_text + ") @ " + location.href);
        setInterval(function() {
            if ($('.seconds').text() <= 1) $('form').submit();
        }, 1000);
    } else if ($('[name="op"]').val() === "download1") {
        console.info("Free Download button was clicked @ " + location.href);
        $('[name=method_free]').click();
    }
})();