Skip to content

Instantly share code, notes, and snippets.

@TianyiShi2001
Created March 13, 2021 22:16
Show Gist options
  • Save TianyiShi2001/41c692021896b9a78db9a95457129d2b to your computer and use it in GitHub Desktop.
Save TianyiShi2001/41c692021896b9a78db9a95457129d2b to your computer and use it in GitHub Desktop.
Download .lrc lyrics from NetEase Music
USAGE="USAGE: ${0##*/} music_id [output_file] "
[[ $# -lt 1 || $1 == '-h' || $1 == '--help' ]] && echo $USAGE && exit 1
ID=$1
OUT=${2:-_lyric.lrc}
curl http://music.163.com/api/song/media?id=${ID} |
jq -r '.lyric' |
sed 's/\\n/\n/g' |
sed 's/\\"/"/g' >${OUT}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment