Created
October 8, 2023 00:39
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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