rsload auto link fix

auto changes media get links to direct

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name			rsload auto link fix
// @name:ru			rsload авто фикс ссылок
// @namespace		rsload.net
// @version			0.2
// @description		auto changes media get links to direct
// @description:ru	автоматически изменяет ссылки с media get на прямые
// @author			Madzal
// @run-at			document-start
// @match			https://rsload.net/*/*
// @match			http://rsload.net/*/*
// @homepage		http://rsload.net
// @grant			none
// ==/UserScript==

window.addEventListener("DOMContentLoaded", function myscript() {
	if (document.getElementById("link_flag")) {
        var link_temp = document.getElementById("link_temp").value;
        var link_number = document.getElementById("link_number").value;
        var links = link_temp.split(";");
        var numbers = link_number.split(";");
        var link_array = document.getElementsByTagName("a");
        for (var i = 0; i < link_array.length; i++) {
            for (var j = 0; j <= numbers.length; j++) {
                if (i == parseInt(numbers[j])) {
                    link_array[i].href = links[j];
                    link_array[i].rel = "";
                }
            }
        }

        document.getElementById("link_temp").value = link_temp;
        document.getElementById("link_number").value = link_number;

        document.getElementById("link_flag").checked = false;
        var node = document.querySelector('div[style="display:block;"]');
        node.parentNode.removeChild(node);
        var node2 = document.getElementsByTagName('center')[0];
        node2.parentNode.removeChild(node2);
    }
}, false);