rsload auto link fix

auto changes media get links to direct

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==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);