Created
April 28, 2020 15:36
-
-
Save ihewro/e764f5b1935a91c2cded5dac5abda090 to your computer and use it in GitHub Desktop.
迁移听歌排行音乐到apple music
This file contains 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
var content=document.getElementById("m-record"); | |
var items=content.getElementsByTagName("ul")[0].getElementsByTagName("li"); | |
var ret = ""; | |
for(var i=0;i<100;i++){ | |
if (i!=-1){ | |
var n = items[i].getElementsByClassName("song")[0].getElementsByClassName("txt")[0]; | |
var title = n.getElementsByTagName("b")[0].getAttribute("title") | |
// console.log(n.getElementsByTagName("font")[2]); | |
if (n.getElementsByClassName("ar s-fc8").length >1){ | |
var author = n.getElementsByClassName("ar s-fc8")[1].getElementsByTagName("span")[0].getAttribute("title") | |
}else{ | |
var author = n.getElementsByClassName("ar s-fc8")[0].getElementsByTagName("span")[0].getAttribute("title") | |
} | |
ret = ret + title + " - " + author+"\n"; | |
} | |
} | |
console.log(ret); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
这个是我的音乐列表转txt的js脚本