Skip to content

Instantly share code, notes, and snippets.

@Mrfiregem
Created October 8, 2023 00:39
Show Gist options
  • Save Mrfiregem/a61d2e6570325f08a3bda1cdfc8ce387 to your computer and use it in GitHub Desktop.
Save Mrfiregem/a61d2e6570325f08a3bda1cdfc8ce387 to your computer and use it in GitHub Desktop.
Wrapper around 0x7d4/syncedlyrics to more easily use in scripts. Searches "Artist Name - Song Title" and outputs file with same path as the song file.
#!/usr/bin/env bash
getTitle() {
ffprobe "$1" 2>&1 | sed -En 's/^ *title *: (.*)/\1/p'
}
getArtist() {
ffprobe "$1" 2>&1 | sed -En 's/^ *artist *: (.*)/\1/p'
}
if [[ -f $1 ]]; then
file=$(realpath "$1")
lrc=${file%.*}.lrc
syncedlyrics -o "$lrc" "$(getArtist "$file") - $(getTitle "$file")"
else
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment