Created
February 28, 2025 17:49
-
-
Save boydaihungst/b77ca48066c2e4af8c57fb62f04a0894 to your computer and use it in GitHub Desktop.
*.workers.dev link generate.user.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name *.workers.dev link generate | |
// @namespace http://tampermonkey.net/ | |
// @version 2024-01-01 | |
// @description try to take over the world! | |
// @author You | |
// @match https://*.workers.dev/0:/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=workers.dev | |
// @grant GM_addStyle | |
// @require http://code.jquery.com/jquery-3.6.0.min.js | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
function generateLinks() { | |
const path = decodeURI(window.location.pathname).substring(4); | |
const animeName = path.substring(0, path.indexOf('/')) | |
let result=`${animeName}\n`; | |
let linkDocuments = []; | |
linkDocuments = document.querySelectorAll("a[href*='download.aspx']"); | |
linkDocuments.forEach(function(linkDoc, index){ | |
const link = linkDoc.href; | |
result+=`${link}\n` | |
}) | |
return result; | |
}; | |
function copyToClipboard() { | |
const listlink = generateLinks() | |
navigator.clipboard.writeText(listlink); | |
}; | |
setTimeout(() => { | |
var zNode = document.createElement("div"); | |
zNode.setAttribute("id", "BtnContainer"); | |
zNode.innerHTML = | |
'<button id="downloadBtn" type="button" style=""> Generate links </button>'; | |
zNode.addEventListener("click", copyToClipboard); | |
document.body.appendChild(zNode); | |
},1000) | |
// Style newly added button | |
GM_addStyle(` | |
#downloadBtn { | |
position: fixed; | |
bottom: 6rem; | |
left: 1rem; | |
margin: 3px; | |
z-index: 9999; | |
opacity: 0.97; | |
} | |
`); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment