Real-debrid multi select link to download page [updated]

Click on check box and "Go to download page" and all links checked will be debrided

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Real-debrid multi select link to download page [updated]
// @namespace    http://tampermonkey.net/
// @version      0.5
// @description  Click on check box and "Go to download page" and all links checked will be debrided
// @author       gilbert1995
// @match        https://real-debrid.com/torrents
// @grant        GM_registerMenuCommand
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.min.js
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js
// ==/UserScript==

(function() {
    'use strict';

    // Your code here...
    $("form[action*='downloader']").each(function() {
        $(this).prepend('<input class="downloadSelectedCheckbox" type="checkbox" value="'+$(this).find('textarea').val()+'" />');
    });

    $("#wrapper_global > div > div > table").after('<button id="downloadSelected" style="cursor:pointer; display: block;width: 100%;margin-top: 20px;font-size: 22px;text-transform: uppercase;color: #ffffff;/* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#8ebad2+0,b8d995+100 */background: #8ebad2; /* Old browsers */background: -moz-linear-gradient(top,  #8ebad2 0%, #b8d995 100%); /* FF3.6-15 */background: -webkit-linear-gradient(top,  #8ebad2 0%,#b8d995 100%); /* Chrome10-25,Safari5.1-6 */background: linear-gradient(to bottom,  #8ebad2 0%,#b8d995 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=\'#8ebad2\', endColorstr=\'#b8d995\',GradientType=0 ); /* IE6-9 */font-weight: 700;text-shadow: 0 0 10px #000000;border: none;padding: 10px;">generate links</button>');
    $("#downloadSelected").click(function(){
        console.log('click');

        var textarea = $("#wrapper_global > div > div > table tr td[colspan='7']:first textarea");
        textarea.val($('.downloadSelectedCheckbox:checked').map(function() {return $(this).val();}).get().join('\n'));
        textarea.next('input').trigger('click');

    });
        $("#wrapper_global > div > div > table").before('<button id="selectAll" style="cursor:pointer; display: block;width: 100%;margin-top: 20px;font-size: 22px;text-transform: uppercase;color: #ffffff;/* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#8ebad2+0,b8d995+100 */background: #8ebad2; /* Old browsers */background: -moz-linear-gradient(top,  #8ebad2 0%, #b8d995 100%); /* FF3.6-15 */background: -webkit-linear-gradient(top,  #8ebad2 0%,#b8d995 100%); /* Chrome10-25,Safari5.1-6 */background: linear-gradient(to bottom,  #8ebad2 0%,#b8d995 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=\'#8ebad2\', endColorstr=\'#b8d995\',GradientType=0 ); /* IE6-9 */font-weight: 700;text-shadow: 0 0 10px #000000;border: none;padding: 10px;">Select / deselect All</button>');
    var isAllCheck = true;
    $("#selectAll").click(function(){
        document.querySelectorAll('input[type="checkbox"]').forEach(ele => ele.checked = isAllCheck);
        isAllCheck = !isAllCheck
    });
})();