Skip to content

Instantly share code, notes, and snippets.

Created June 1, 2016 17:07
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 anonymous/2996d0b7d52b824c2f36d9311258c363 to your computer and use it in GitHub Desktop.
Save anonymous/2996d0b7d52b824c2f36d9311258c363 to your computer and use it in GitHub Desktop.
KKBox Mp3tag web source
# Mp3tag parser for kkbox website
#
# Src created by otacorn(玉米)
#
# #################################
[Name]=KKbox
[BasedOn]=http://www.kkbox.com
[IndexUrl]=http://www.kkbox.com/tw/tc/search.php?search=album&word=%s
[AlbumUrl]=http://www.kkbox.com
[WordSeperator]=+
[IndexFormat]=%_url%|%album%|%artist%
[SearchBy]=%album%
[Encoding]=url-utf-8
[ParserScriptIndex]=...
# ###################################################################
# I N D E X
# ###################################################################
# debug "on" "d:\\debug_kkbox1.htm"
findline "class=\"albums five\">"
do
findline "li class=\"album\""
findline "class=\"cover\""
# Url
findinline "href=\""
sayuntil "\""
say "|"
# Album
findinline "title=\""
sayuntil "\""
say "|"
# Artist
findline "item-h album-name" 2
findline "<a href"
findinline "title=\""
sayuntil "\""
saynewline
findline "<li class=\""
findinline "class=\""
while "album"
[ParserScriptAlbum]=...
# ###################################################################
# A L B U M
# ###################################################################
#debug "on" "d:\\debug_kkbox2.htm"
# CoverURL
# outputto "Album"
findline "class=\"fa fa-angle-right\""
findline "span"
findinline "span>"
# sayuntil "</span>"
# CoverURL
outputto "coverurl"
findline "<img src=\""
findinline "src=\""
sayuntil "\""
# Mp3tag parser for kkbox website
#
# Src created by otacorn(玉米)
#
# #################################
[Name]=KKbox
[BasedOn]=http://www.kkbox.com
[IndexUrl]=http://www.kkbox.com/tw/tc/search.php?search=album&word=%s
[AlbumUrl]=http://www.kkbox.com
[WordSeperator]=+
[IndexFormat]=%_url%|%Album%|%Artist%
[SearchBy]=%album%
[Encoding]=url-utf-8
[ParserScriptIndex]=...
# ###################################################################
# I N D E X
# ###################################################################
debug "on" "c:\\debug_kkbox1.htm"
findline "class=\"albums five\">"
do
findline "li class=\"album\""
findline "class=\"cover\""
# Url
findinline "href=\""
sayuntil "\""
say "|"
# Album
findinline "title=\""
sayuntil "\""
say "|"
# Artist
findline "item-h album-name" 2
findline "<a href"
findinline "title=\""
sayuntil "\""
saynewline
findline "<li class=\""
findinline "class=\""
while "album"
[ParserScriptAlbum]=...
# ###################################################################
# A L B U M
# ###################################################################
debug "on" "c:\\debug_kkbox2.htm"
# CoverURL
outputto "coverurl"
findline "class=\"album-pic\""
findline "<img src=\""
findinline "src=\""
sayuntil "\""
# Album
outputto "Album"
# findline "class=\"fa fa-angle-right\""
# findline "span"
findline "<h1"
moveline 1
# sayregexp "[^\n]+"
sayuntil "</"
gotoline 1
findline "class=\"media-tag"
# Artist
outputto "artist"
findline "tit-16"
moveline 1
findline ">"
findinline ">"
sayuntil "<"
# rewind
gotoline 1
findline "class=\"media-tag"
findline "</div"
# Genre
outputto "Genre"
moveline -1
findinline ">"
sayuntil "</"
# Year
outputto "Year"
moveline -3
findinline ">"
saynextnumber
findline "song-list js-song-list"
do
# Track
outputto "track temp"
findline "data-song_idx"
findinline "data-song_idx=\""
saynextnumber
say "|"
# Title
outputto "title temp"
findline "class=\"song-data"
findline "<a href="
findinline ">"
sayuntil "</"
say "|"
# tracks ++
outputto "tracks"
say "|"
findline "</li"
# findinline "</li "
moveline 2
findinline "<"
if "li class=\"clearfix\""
# outputto "track temp"
# say "|"
# outputto "title temp"
# say "|"
# outputto "tracks"
# say "|"
endif
while "li class=\"clearfix\""
outputto "title"
sayoutput "title temp"
outputto "track"
sayoutput "track temp"
set "title temp"
set "track temp"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment