Separate lyric / .lrc files for the lyric plugin #6128
Replies: 1 comment
-
|
I was looking for the same thing. There's this old thread I came across which suggests scripting it, and it suggests a very small bash script. It's not fancy and it's very slow (maybe that's fine; I don't know how much resources the LRCLib API has) but it works. I tweaked it very slightly for my liking; this is exactly what I'm running right now: For my 10,000 song library it ran all night and half of today and is so far up to M. 😆 I realized half way through that that's saving both plain and synchronized lyrics. I'm only interested in synchronized, and it's saving as #!/usr/bin/env bash
set -euo pipefail
usage() {
echo "$(basename "$0") [-h|--help] [--] [BEET_ARG [...]]"
echo
echo " -h|--help: show this message"
echo " --: end of options"
echo " BEET_ARG: an argument to be passed to the \`beet ls\` command, such as a query"
}
ARGS=()
NO_MORE_OPTS=false
while [ $# -gt 0 ]; do
ARG="$1"
shift
if $NO_MORE_OPTS; then
ARGS+=("$ARG")
else
case "$ARG" in
-h|--help)
usage
exit
;;
--)
NO_MORE_OPTS=true
;;
-*)
echo "Unknown option \"$ARG\"" >&2
echo >&2
usage >&2
exit 1
;;
*)
ARGS+=("$ARG")
;;
esac
fi
done
beet ls -p "${ARGS[@]}" | while read f; do
echo "$f"
lrc="${f%.*}.lrc"
if [ -f "$lrc" ]; then
echo "$f already has .lrc file; skipping"
continue
fi
echo "Getting lyrics for $f"
lyrics="$(beet lyrics -p "path:$f")"
if echo "$lyrics" | grep -q "\[[[:digit:]]\{2\}:[[:digit:]]\{2\}\.[[:digit:]]\{2\}\]"; then
echo "-> $lrc"
echo "$lyrics" >"$lrc"
else
echo "Not synchronized; discarding"
fi
doneThis version:
But I agree that an option to do this would be very welcome. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Some programs don't recognize embedded lyric files (jellyfin, mpv) and I can't seem to find an option to export the lyrics as a .lrc file instead of embedding them into the file in the lyrics plugin configuration. An option to do this would be very useful. Thanks.
Beta Was this translation helpful? Give feedback.
All reactions