Last active
April 12, 2024 17:32
-
-
Save 1kko/40ca6dfc853099e6055e92a90bed937e to your computer and use it in GitHub Desktop.
JQuery Bugs Music List to Json - 벅스 뮤직 플레이리스트 내보내기
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
// Chrome 웹브라우저에서 벅스 로그인 후 목록보이는 상태에서 F12키를 누른후 | |
// Console창에 아래 코드 복붙 후 엔터. | |
// 나오는 리스트는 http://www.playlist-converter.net/ 에 텍스트 붙여넣기 해서 원하는 음악사이트로 플레이리스트를 이동. | |
var output=[] | |
$('table.list.trackList > tbody > tr').each(function () { | |
title = $(this).find('th > p > a').attr('title'); | |
// sometimes title is disabled due to the copyright issues. This case just get the text. | |
if (title === undefined) { | |
title = $(this).find('th > p').text().trim(); | |
} | |
artist = $(this).find('p.artist > a').attr('title'); | |
album = $(this).find('a.album').attr('title'); | |
output.push({"title":title, "artist":artist, "album":album}); | |
// console.log(title, "-", artist) | |
}); | |
// for json format. | |
console.log(output); | |
// for just text. (can be used at http://www.playlist-converter.net/ ) | |
for (i=0;i<output.length;i++){ | |
console.log(output[i]['title'], "-", output[i]['artist']); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
너무 감사합니다