Seedr Copy Links.

Copy direct Links inside a Folder.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Seedr Copy Links.
// @namespace    https://github.com/Neokyuubi/seedr-copy-direct-links-at-once
// @supportURL   https://github.com/Neokyuubi/seedr-copy-direct-links-at-once/issues
// @require      https://unpkg.com/[email protected]/dist/sweetalert.min.js
// @version      1.3
// @description  Copy direct Links inside a Folder.
// @author       Neokyuubi
// @match        https://www.seedr.cc/*
// @grant        GM_setClipboard
// ==/UserScript==
/* globals jQuery, $, waitForKeyElements, swal */

(function() {
    'use strict';
    let elements = [];
    let links = "";
    let sleep = (delay) => new Promise((resolve)=>setTimeout(resolve, delay));

    async function seedr()
    {
        try
        {
            jQuery.unique($("span .fa.fa-copy")).each(function(index)
            {
                elements.push($(this));
            });
            // console.log(elements);
            for (let i = 0; i < elements.length; i++)
            {
                await sleep(200);
                elements[i].parent().parent().parent().parent().contextmenu();
                await sleep(300);
                let text = $("#clipboard-div").attr("data-clipboard");
                //  filter here if mp4 or mkv
                links += (i<elements.length -1) ? text + "\n" : text;
            }
            //console.log(links);
            GM_setClipboard(links);
            swal("Links are copied successfully!", elements.length + " links are copied", "success");
        }
        catch(err)
        {
            //console.log("errors : " + err);
            swal(err, "error");
        }

    }

    $(document).bind('keypress', function(event) {
        if( event.which === 81 && event.shiftKey)
        {
            event.preventDefault();
            setTimeout(function()
            {
               elements = [];
               links = "";
               seedr();
            }, 100);
        }
    });

})();