commit 6f6f1dedd95d92baed9a64a04ec4fca07ef407fb Author: Luna Komorebi Date: Sat May 8 13:51:51 2021 +0200 init diff --git a/arknights-music.user.js b/arknights-music.user.js new file mode 100644 index 0000000..987b8e7 --- /dev/null +++ b/arknights-music.user.js @@ -0,0 +1,40 @@ +// ==UserScript== +// @name ArknightsMusicJson +// @namespace Return to Luna Scripts +// @match https://monster-siren.hypergryph.com/* +// @grant none +// @version 1.1.2 +// @grant GM.notification +// @author mlunax +// @description 4/29/2021, 11:07:11 PM +// @run-at document-end +// @license MIT +// ==/UserScript== +const triggerFunction = (async () => { +let cids = []; +if (GM && GM.notification){ + GM.notification({text:"Script is running"}); +} else { + alert("After closing this popout, script will be in the running") +} +for (const album of await fetch("/music").then(e => e.text().then(v => JSON.parse(v.match(/window\.g_initialProps = (\{.+\})/)[1].replace(/undefined/g,'""'))['music']['albumList']))){ + const req = await fetch(`/api/album/${album.cid}/detail`); + const json = await req.json(); + for (const s of json.data.songs){ + const songCid = s.cid; + const songReq = await fetch('/api/song/' + songCid); + const songJson = await songReq.json() + const songUrl = songJson.data.sourceUrl; + const songName = songJson.data.name; + cids.push({songCid: songCid, name: songName, url: songUrl}); + } +} +const ahref = document.createElement("a") +ahref.href = "data:application/json," + encodeURIComponent(JSON.stringify(cids)) +ahref.setAttribute("download", "arknights" + ".json") +ahref.click() +}); +const but = document.createElement("button"); +but.innerText = "Run Luna Script"; +but.onclick = triggerFunction; +document.querySelector("header").appendChild(but); diff --git a/radiogarden.user.js b/radiogarden.user.js new file mode 100644 index 0000000..2411368 --- /dev/null +++ b/radiogarden.user.js @@ -0,0 +1,28 @@ +// ==UserScript== +// @name LunarScrapping- radio.garden +// @namespace Return to Luna Scripts +// @match http://radio.garden +// @grant none +// @version 1.0.0 +// @author mlunax +// @description 4/29/2021, 11:07:11 PM +// @include http://radio.garden/* +// @license MIT +// ==/UserScript== + + +const originalFetch = fetch; +fetch = async function(data, options){ + let ret; + if (typeof data == "string" && data.startsWith("/api/ara/content/channel/")){ + let a; + ret = await originalFetch(data,options).then(async v => { + a = await v.clone().json(); + return v; + }); + const url = "http://radio.garden/api/ara/content/listen/" + a.data.id + "/channel.mp3"; + console.log(`%c${url}`, "color:red"); + return ret; + } + return originalFetch(data,options); +} diff --git a/wbijamcda.user.js b/wbijamcda.user.js new file mode 100644 index 0000000..9f79564 --- /dev/null +++ b/wbijamcda.user.js @@ -0,0 +1,40 @@ +// ==UserScript== +// @name CDA - wbijam.pl +// @namespace Return to Luna Scripts +// @match https://*.wbijam.pl/* +// @grant none +// @version 1.0 +// @author mlunax +// @description 5/5/2021, 6:58:17 PM +// @include https://*.wbijam.pl/* +// @run-at document-body +// ==/UserScript== + +const style = document.createElement("style"); +style.innerText = ` +.odtwarzacz_link + button { + display:none; +} + +.odtwarzacz_link:hover + button, .odtwarzacz_link + button:hover { + display:block; +} +`; +document.head.appendChild(style); +for (const el of document.querySelectorAll("span.odtwarzacz_link")) { + const but = document.createElement("button"); + but.innerText = "Gimme CDA link"; + but.onclick = () => { + const url = el.getAttribute("rel"); + fetch(`https://${document.location.host}/odtwarzacz-${url}.html`).then(e => { + e.text().then(t => { + const dom = new DOMParser().parseFromString(t, "text/html"); + const h = dom.querySelector('iframe[src*="cda.pl"]'); + if (h){ + alert(h.src); + } + }) + }) + }; + el.parentElement.appendChild(but); +}