5 search
="http://api.leoslyrics.com/api_search.php?auth=ncmpc"
6 lyrics
="http://api.leoslyrics.com/api_lyrics.php?auth=ncmpc"
7 cache
="$HOME/.lyrics/$1 - $2.txt"
9 hid
=$
(wget
-q -O- "$search&artist=$1&songtitle=$2" |
10 sed -n 's/.*hid="\([^"]*\)".*exactMatch="true".*/\1/p' |
15 mkdir
-p "$(dirname "$cache")"
17 wget
-q -O- "$lyrics&hid=$hid" |
awk '
18 /<text>/ { go=1; sub(".*<text>", "") };
19 /<\/text>/ { go=0; sub("</text>.*", "") };
20 go { sub("
", ""); print };