您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
adds a button which when pressed creates a textbox with all links for you to copy in jDownloader2
当前为
- // ==UserScript==
- // @name real-debrid torrents: textbox with all links
- // @namespace https://greasyfork.org/en/users/12725-alistair1231
- // @version 0.1
- // @description adds a button which when pressed creates a textbox with all links for you to copy in jDownloader2
- // @author Alistair1231
- // @match https://real-debrid.com/torrents
- // @icon https://icons.duckduckgo.com/ip2/real-debrid.com.ico
- // @grant none
- // @require https://code.jquery.com/jquery-3.6.0.min.js
- // @license GPL-3.0
- // ==/UserScript==
- (function () {
- var linkButton = document.createElement("input");
- linkButton.type = "button";
- linkButton.value = "Show Links";
- linkButton.onclick = function () {
- createTextArea();
- }
- // align right
- jQuery(linkButton).css("float", "inline-end");
- // make vertically centered
- jQuery(linkButton).css("margin-top", "10px");
- jQuery(".content_separator_mini")[1].append(linkButton);
- function createTextArea() {
- var textbox = document.createElement("textarea");
- jQuery(textbox).css({ "position": "fixed", "width": "50%", "height": "80%", "z-index": "999998", "background": "rgba(0,0,0,0.7)", "color": "#fff", "font-size": "16px", "font-family": "Consolas", "padding": "10px", "resize": "none", "outline": "none", "border": "none", "box-shadow": "0 0 10px #fff", "-webkit-box-shadow": "0 0 10px #fff", "-moz-box-shadow": "0 0 10px #fff", "-o-box-shadow": "0 0 10px #fff", "left": "25%", "top": "8%" });
- // get all the links
- var links = jQuery.makeArray(jQuery("tr form[action='./downloader'] textarea")).map(e => e.value);
- // add the links to the textbox
- textbox.value = links.join('\n');
- document.getElementsByTagName("body")[0].prepend(textbox);
- // highlight the text in the textbox
- textbox.select();
- //create close button in top right corner
- var close = document.createElement("div");
- jQuery(close).css({ "position": "fixed", "top": "10%", "right": "25%", "width": "30px", "height": "30px", "background": "#fff", "border-radius": "50%", "cursor": "pointer", "text-align": "center", "line-height": "30px", "font-size": "25px", "font-weight": "bold", "color": "#000", "z-index": "999999" });
- close.innerHTML = "X";
- //when button clicked remove elements
- jQuery(close).click(function () {
- jQuery(textbox).remove();
- jQuery(close).remove();
- });
- // remove elements when escape is pressed
- jQuery(document).keyup(function (e) {
- if (e.keyCode == 27) {
- jQuery(textbox).remove();
- jQuery(close).remove();
- }
- });
- //remove elements when clicked outside of them
- jQuery(document).click(function (e) {
- if (e.target != textbox && e.target != close && e.target != linkButton) {
- jQuery(textbox).remove();
- jQuery(close).remove();
- }
- });
- document.getElementsByTagName("body")[0].prepend(close);
- }
- })();