美剧天堂 - 下载链接查看工具

直接查看下载列表中的链接

// ==UserScript==
// @name        美剧天堂 - 下载链接查看工具
// @namespace   Violentmonkey Scripts
// @grant       none
// @description 直接查看下载列表中的链接
// @version     1.0
// @author      SkayZhang
// @license     MIT
// @match       https://www.meijutt.tv/content/*.html
// @icon        https://www.meijutt.tv/favicon.ico
// @grant       none
// @require     https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js
// ==/UserScript==
(function () {
  
  setTimeout(()=>{
    $(".copy").remove();
    $(".downtools").append(`<a class="switch">显示选中项链接</a>`)
    
    $(".downtools .switch").on("click",function(){
      if($(this).text()==='显示选中项链接'){
        $("#download-textarea").remove();
        let box = $(this).parent().parent().find(".down_list")
        
        let link = "";
        box.find("li").each(function(){
          let checkbox = $(this).find("input")
          if(checkbox.is(':checked')) link += checkbox.val()+"\n\n"
        });
        
        box.css("position","relative")
        box.append(`<textarea id="download-textarea" style="position:absolute;border:none;height:100%;width:100%;left:0;top:0;">${link}</textarea>`)
        $(this).text("隐藏选中项链接")
      }else{
        $("#download-textarea").remove();
        $(this).text("显示选中项链接")
      }
    })
  },1500)
  
})();