// ==UserScript== // @name 复制磁力链接 // @description 一键复制页面内所有磁力链接(自动过滤重复磁力链接) // @namespace maomao1996.copy-magnet-link // @version 1.0.1 // @author maomao1996 // @homepage https://github.com/maomao1996/tampermonkey-scripts // @supportURL https://github.com/maomao1996/tampermonkey-scripts/issues // @license MIT // @match *://*/* // @exclude *://localhost:*/* // @exclude *://127.0.0.1:*/* // @exclude *://0.0.0.0* // @exclude *://192.168.* // @grant GM_addStyle // @grant GM_setClipboard // @grant GM_notification // @downloadURL https://update.greasyfork.icu/scripts/491959/%E5%A4%8D%E5%88%B6%E7%A3%81%E5%8A%9B%E9%93%BE%E6%8E%A5.user.js // @updateURL https://update.greasyfork.icu/scripts/491959/%E5%A4%8D%E5%88%B6%E7%A3%81%E5%8A%9B%E9%93%BE%E6%8E%A5.meta.js // ==/UserScript== !function() { "use strict"; var css_248z = '.femm-copy-magnet-link{bottom:30vh;cursor:pointer;opacity:.5;position:fixed;right:18px;transform:translateX(40px);transition:transform .3s,opacity .2s;z-index:1996}.femm-copy-magnet-link:after{bottom:0;content:"";display:block;left:0;position:absolute;top:0;width:150%}.femm-copy-magnet-link:before{background-color:rgba(0,0,0,.85);border-radius:6px;bottom:120%;color:#e6f4ff;content:attr(tips);display:none;font-size:12px;padding:8px;position:absolute;right:0;text-align:center;transition:opacity .25s .1s;white-space:nowrap;z-index:1}.femm-copy-magnet-link:hover{opacity:1;transform:translateX(10px)}.femm-copy-magnet-link:hover:before{display:block}.femm-copy-magnet-link-btn{align-items:center;background-color:#fff;border-radius:50%;box-shadow:0 6px 16px 0 rgba(0,0,0,.08),0 3px 6px -4px rgba(0,0,0,.12),0 9px 28px 8px rgba(0,0,0,.05);display:flex;font-size:16px;height:40px;justify-content:center;overflow:hidden;transition:background-color .2s;width:40px}.femm-copy-magnet-link-btn:hover{background-color:rgba(0,0,0,.06)}'; !function(css, ref) { void 0 === ref && (ref = {}); var insertAt = ref.insertAt; if (css && "undefined" != typeof document) { var head = document.head || document.getElementsByTagName("head")[0], style = document.createElement("style"); style.type = "text/css", "top" === insertAt && head.firstChild ? head.insertBefore(style, head.firstChild) : head.appendChild(style), style.styleSheet ? style.styleSheet.cssText = css : style.appendChild(document.createTextNode(css)); } }(css_248z), function() { if (window.self === window.top) { GM_addStyle(css_248z); var message = function(text) { text && GM_notification({ timeout: 2e3, text: text }); }, getMagnetUrls = function(selectors) { return selectors ? (selectors.innerHTML.match(/[0-9a-fA-F]{40}/gm) || []).map((function(s) { return "magnet:?xt=urn:btih:" + s.replace(/&.+/gm, ""); })) : []; }; getMagnetUrls(document.querySelector("body")).length && (document.querySelector("#femm-copy-magnet-link") || document.querySelector("body").insertAdjacentHTML("beforeend", '