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); |
这个是我的音乐列表转txt的js脚本
var content=document.getElementById("auto-id-Sv0VhguKOy0wJ6zy");
var items=content.getElementsByTagName("tr");
var ret = "";
for(var i=1;i<=1000;i++){
if (i!=-1){
var n = items[i].getElementsByTagName("td");
var title = n[1].getElementsByTagName("b")[0].getAttribute("title")
var author = n[3].getElementsByClassName("text")[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
https://music.163.com/#/user/songs/rank 在这个页面的控制台执行上面的脚本(执行之前 先点击页面中的「所有时间」)
然后复制输出的结果到https://www.tunemymusic.com/zh-cn/ 这个网站上就可以迁移啦~