Skip to content

Instantly share code, notes, and snippets.

@greatghoul
Created August 23, 2022 01:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save greatghoul/0a64c0391d1a83aacfd7541839b782e7 to your computer and use it in GitHub Desktop.
Save greatghoul/0a64c0391d1a83aacfd7541839b782e7 to your computer and use it in GitHub Desktop.
下载九酷音乐 mp3
// ==UserScript==
// @name 九酷音乐网mp3下载
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://www.9ku.com/play/*
// @grant GM_addStyle
// ==/UserScript==
(function() {
'use strict';
let timer = null;
function checkAudio () {
window.clearTimeout(timer);
const audio = document.querySelector('audio');
if (audio && audio.src) {
console.log('url is', audio.src);
document.querySelector('a.down').setAttribute('href', audio.src);
} else {
timer = window.setTimeout(checkAudio, 200);
}
}
checkAudio();
GM_addStyle(`
iframe { display: none; }
.xxl { display: none; }
div[onclick*=none] { display: none; }
`)
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment