酷我VIP音乐免费下载

【酷我音乐】免费歌曲下载2

目前為 2021-08-11 提交的版本,檢視 最新版本

// ==UserScript==
// @name         酷我VIP音乐免费下载
// @namespace    http://tampermonkey.net/
// @version      1.2
// @description  【酷我音乐】免费歌曲下载2
// @author       MrHao
// @match        http://www.kuwo.cn/*
// @match        https://www.kuwo.cn/*
// @grant        GM_xmlhttpRequest
// @grant        GM_download
// @connect      *
// ==/UserScript==
(function() {
    'use strict';
    console.log("==================================KUWO_List=Hack=By=MrHao==================================")
     setTimeout(function init() {
        let rows
        if(location.href.indexOf("search")>0){
            rows = document.getElementsByClassName("search_list")[0].childNodes;
        }else if(location.href.indexOf("rankList")>0){
            rows = document.getElementsByClassName("rank_list")[0].childNodes;
        }
        for (var i = 0; i <= rows.length; i++) {
            let dom = rows[i].childNodes[2];
            let href = rows[i].childNodes[2].childNodes[0].href;
            var button2 = document.createElement("button");
            button2.textContent = "下载";
            button2.style.border= "none";
            button2.style.background="#fff0";
            button2.style.marginLeft= "10px";
            button2.style.fontSize= "large";
            button2.onclick=function () {
                console.log(href);
                let timestamp = (new Date).getTime();
                let jsonTxt = href;
                let num = href.lastIndexOf("/");
                let json = jsonTxt.substr(num+1, jsonTxt.length).replace(");", "");
                let rid = json.replace("/", "")

                let url = "http://www.kuwo.cn/url" +
                    "?format=mp3" +
                    "&rid=" + rid +
                    "&response=url" +
                    "&type=convert_url3" +
                    "&br=320kmp3" +
                    "&from=web" +
                    "&t=" + timestamp +
                    "&httpsStatus=1" +
                    "&reqId=47a4d540-8bad-11eb-a042-85fdd60cefbd";
                let name = "http://m.kuwo.cn/newh5/singles/songinfoandlrc" +
                    "?musicId=" + rid +
                    "&httpsStatus=1" +
                    "&reqId=f8253ce0-8bba-11eb-8129-2d426b8a6ecc";
                GM_xmlhttpRequest({
                    method: "get",
                    url: name,
                    onload: function(r) {
                        let jsonTxt = r.response;
                        let json = JSON.parse(jsonTxt)
                        console.log(json)
                        let songName = json.data.lrclist[0].lineLyric;
                        down(url, songName)
                    }
                });
                return;
            };
            dom.appendChild(button2);
        }

    },1000);

    function down(url, name) {
        GM_xmlhttpRequest({
            method: "get",
            url: url,
            onload: function(r) {
                let jsonTxt = r.response;
                let json = JSON.parse(jsonTxt) ;
                GM_download(json.url, name + ".mp3")
            }
        });
    }


     function getURLParameter(url, name) {
        return (RegExp(name + '=' + '(.+?)(&|$)').exec(url)||[,null])[1];
    }


    var down_load=document.getElementsByClassName("btns")[0]
    var child = down_load.lastChild;
    console.log(child)

    var button = document.createElement("button");
    button.id = "down_load";
	button.textContent = "下载";
	button.style.width = "113px";
	button.style.height = "40px";
    button.style.color = "#000";
    button.style.background = "#f2f2f2";
    button.style.borderRadius = "22px";
    button.style.border = "none";
    button.style.fontSize = "16px";
    button.style.cursor = "pointer";
    button.style.color = "inherit";
    down_load.appendChild(button)

    button.onclick = function (){
    let timestamp = (new Date).getTime()
    let jsonTxt = location.href
    let num = location.href.lastIndexOf("/");
    let json = jsonTxt.substr(num,jsonTxt.length).replace(");","");
    let rid = json.replace("/","")

    let url="http://www.kuwo.cn/url"
         +"?format=mp3"
         +"&rid="+rid
         +"&response=url"
         +"&type=convert_url3"
         +"&br=320kmp3"
         +"&from=web"
         +"&t="+timestamp
         +"&httpsStatus=1"
         +"&reqId=47a4d540-8bad-11eb-a042-85fdd60cefbd"
    let name="http://m.kuwo.cn/newh5/singles/songinfoandlrc"
         +"?musicId="+rid
         +"&httpsStatus=1"
         +"&reqId=f8253ce0-8bba-11eb-8129-2d426b8a6ecc"
    GM_xmlhttpRequest({
        method: "get",
        url: name,
        onload: function(r) {
            let jsonTxt = r.response
            let json = JSON.parse(jsonTxt)
            //console.log(json.data.lrclist[0].lineLyric)
            let songName = json.data.lrclist[0].lineLyric
            down(url,songName)
        }
    });

		return;
	};
    // Your code here...
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址