Skip to content

Commit

Permalink
소스코드 최초 업로드
Browse files Browse the repository at this point in the history
파일 최초 업로드
  • Loading branch information
dh-json authored May 15, 2022
0 parents commit 91233cd
Show file tree
Hide file tree
Showing 5 changed files with 864 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Melon#.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Mp3tag web source for Melon / Common script for parsing album page
# Path: %appdata%\Mp3tag\data\sources\
# Originated by Hyosang Park http://hyosang.kr

[Name]=Melon
[BasedOn]=https://www.melon.com
[WordSeparator]=+
[Encoding]=url-utf-8
235 changes: 235 additions & 0 deletions Melon#1. 앨범, 아티스트명으로 앨범 검색.src
Original file line number Diff line number Diff line change
@@ -0,0 +1,235 @@
# Mp3tag parsing for Melon.com
# Path: %appdata%\Mp3tag\data\sources\
# Originated by Hyosang Park http://hyosang.kr

[Include]=Melon#.inc
[IndexUrl]=https://www.melon.com/search/album/index.htm?q=
[AlbumUrl]=https://www.melon.com/album/detail.htm?albumId=
[IndexFormat]=%_url%|%_preview%|%Album%|%Artist%|%Title%|%Released%|%Tracks%
[SearchBy]=%album% %ALBUMARTIST%

[ParserScriptIndex]=...
# ###################################################################
# This script parses the webpage for all releases
# by this albumname.
#
# The output format is defined by IndexFormat above, which
# is used by the selection dialog
# ###################################################################
#debug "on" "debug_melon_parse.out"
#debugWriteInput "debug-input_melon_parse.out"

FindLine "<li class=\"album11_li\""

Do
# _url
FindLine "goAlbumDetail("
Unspace
FindInLine "goAlbumDetail('"
SayUntil "');"
Say "|"

# _preview
Say "https://www.melon.com/album/detail.htm?albumId="
FindLine "goAlbumDetail("
Unspace
FindInLine "goAlbumDetail('"
SayUntil "');"
Say "|"

# Album
FindLine "<strong class=\"none\">"
FindLine "melon.link.goAlbumDetail("
Unspace
RegexpReplace "<[^>]+>" ""
SayRest
Say "|"

# Artist
FindLine "<strong class=\"none\">"
FindLine "<div class=\"ellipsis\">"
Unspace
JoinUntil "</div>"
RegexpReplace ".*<span" "<span"
RegexpReplace "<[^>]+>" ""
SayRest
Say "|"

# Title
FindLine "<span class=\"songname12\">"
Unspace
RegexpReplace "<[^>]+>" ""
SayRest
Say "|"

# Released
FindLine "<span class=\"cnt_view\">"
Unspace
RegexpReplace "<[^>]+>" ""
RegexpReplace "[^0-9]" ""
SayRest
Say "|"

# Tracks
FindLine "<span class=\"tot_song\">"
Unspace
RegexpReplace "<[^>]+>" ""
SayRegexp "[0-9]+"
SayNewLine

FindLine "<li class=\"album11_li\">" 1 1
Unspace
While "<li class=\"album11_li\""

[ParserScriptAlbum]=...
# ###################################################################
# This script parses the albums page for all common information.
#
# The current output variable is set via the outputto command
# All these fields are used by the confirm online information dialog
# ###################################################################
#debug "on" "debug_melon_set.out"
#debugWriteInput "debug-input_melon_set.out"

# CoverArt
OutputTo "coverurl"
FindLine "<meta property=\"og:image\""
Unspace

# ChangeSize
RegexpReplace "(_)(\d+)(.jpg+)" "_1000.jpg"
RegexpReplace "(\w+\.\w+)\?.*" "$1"
FindInLine "content=\""
SayUntil "\""

# Album
OutputTo "Album"
FindLine "<strong class=\"none\">"
MoveLine 1
Unspace
SayRest

# AlbumArtist
OutputTo "AlbumArtist"
FindLine "<div class=\""
FindInLine "<div class=\""
MoveLine 2
Unspace
RegexpReplace "<[^>]+>" ""
SayRest

OutputTo "Year"
FindLine "<dt>발매일</dt>"
MoveLine 1
Unspace
# Year
RegexpReplace "<[^>]+>" ""
SayUntil "."
# Date
#RegexpReplace "[^0-9]" ""
#SayRest

# Genre
#OutputTo "Genre"
#FindLine "<dt>장르</dt>"
#MoveLine 1
#Unspace
#RegexpReplace "<[^>]+>" ""
#SayRest

# Publisher
OutputTo "Publisher"
FindLine "<dt>발매사</dt>"
MoveLine 1
Unspace
RegexpReplace "<[^>]+>" ""
SayRest

FindLine "<tbody>"
FindLine "<tr class="cd\"" 1 1
Unspace
if "<tr class=\"cd"
set "discFlag" "True"
else
GotoLine 1
FindLine "<tbody>"
endif

FindLine "<tr data-group-items=\""
Unspace
Do
# DiscNumber
ifoutput "discFlag"
FindInLine "<tr data-group-items=\"cd"
OutputTo "discTemp"
SayUntil "\""
Say "|"
endif

# Track
OutputTo "trackTemp"
FindLine "<span class=\"rank"
Unspace
RegexpReplace "<[^>]+>" ""
SayUntil "위"
Say "|"

# Title
OutputTo "titleTemp"
FindLine "<div class="wrap_song_info">"
FindLine "<div class="ellipsis">"
FindLine "</span></div><br>"
MoveLine -3
FindLine "<"
Unspace

# Unplayalbe song
if "<span class=\"disabled"
RegexpReplace "<[^>]+>" ""
SayRest
else
# Playable song
if "<a href=\"javascript:melon.play.playSong"
RegexpReplace "<[^>]+>" ""
SayRest
endif
endif
Say "|"

# Artist
OutputTo "artistTemp"
FindLine "div class=\"ellipsis rank02\""
FindLine "<span class=\"checkEllipsis\""
Unspace
KillTag "a" ""
KillTag "/a" ""
KillTag "span" "<"
KillTag "/span" ">"
Replace " , " ","
RegexpReplace "<[^>]+>" ""
SayRest
Say "|"

OutputTo "tracksTemp"
Say "|"
FindLine "<tr data-group-items=\"" 1 1
Unspace
While "<tr data-group-items=\""

OutputTo "Track"
SayOutput "trackTemp"
OutputTo "Title"
SayOutput "titleTemp"
OutputTo "Tracks"
SayOutput "tracksTemp"
OutputTo "DISCNUMBER"
SayOutput "discTemp"
OutputTo "Artist"
SayOutput "artistTemp"

Set "trackTemp"
Set "titleTemp"
Set "tracksTemp"
Set "discFlag"
Set "discTemp"
Set "artistTemp"
Loading

0 comments on commit 91233cd

Please sign in to comment.