mirror of
https://github.com/levogevo/add-synced-lyrics.git
synced 2026-07-21 21:45:21 +00:00
init readme
This commit is contained in:
@@ -0,0 +1,35 @@
|
|||||||
|
# add-synced-lyrics
|
||||||
|
A script that automates adding lyrics to your songs.
|
||||||
|
```
|
||||||
|
add-synced-lyrics.sh [options]
|
||||||
|
|
||||||
|
OPTIONS:
|
||||||
|
-d, --dir process files in directory
|
||||||
|
-r, --recurse recursively process directory
|
||||||
|
-f, --file process one file
|
||||||
|
-e, --embed embed lyrics directly into the song file
|
||||||
|
-n, --dry-run do not add synced lyrics,
|
||||||
|
just show the files that would be processed
|
||||||
|
-i, --ignore ignore errors, and continue attempting to find lyrics
|
||||||
|
even in the case of errors
|
||||||
|
-h, --help show this output
|
||||||
|
--debug extra information useful for debugging
|
||||||
|
--eval output bash functions that can be directly processed
|
||||||
|
by eval for use with testing this script.
|
||||||
|
```
|
||||||
|
|
||||||
|
# Requirements
|
||||||
|
- CLI tools:
|
||||||
|
- coreutils: `mktemp cat sort base64 readlink`
|
||||||
|
- `ffmpeg ffprobe`
|
||||||
|
- `jq`
|
||||||
|
- `node` (any version)
|
||||||
|
- [`librelyrics`](https://github.com/libre-lyrics/librelyrics):
|
||||||
|
- uses the [deezer](https://github.com/libre-lyrics/librelyrics-deezer) and [spotify](https://github.com/libre-lyrics/librelyrics-spotify) plugins
|
||||||
|
- [`spotify`](https://github.com/ledesmablt/spotify-cli) most easily installed with `uv tool install --python 3.8 spotify-cli`
|
||||||
|
- Music that has the appropriate ISRC tag.
|
||||||
|
|
||||||
|
## Features
|
||||||
|
- Uses the ISRC tag to search for synced lyrics across the download providers: lrclib, spotify, and deezer (in that order).
|
||||||
|
- Caches all networked-calls to the download providers.
|
||||||
|
- Supports separate (dedicated .lrc file) or adding the lyrics directly to the song file with the LYRICS tag.
|
||||||
+19
-6
@@ -89,17 +89,29 @@ dry() {
|
|||||||
# check required utilities for this project
|
# check required utilities for this project
|
||||||
check_required_utils() {
|
check_required_utils() {
|
||||||
local utils=(
|
local utils=(
|
||||||
mktemp
|
# coreutils
|
||||||
|
bash
|
||||||
|
cat
|
||||||
sort
|
sort
|
||||||
base64
|
base64
|
||||||
cat
|
mktemp
|
||||||
ffprobe
|
readlink
|
||||||
|
|
||||||
jq
|
jq
|
||||||
librelyrics
|
|
||||||
spotify # uv tool install --python 3.8 spotify-cli
|
|
||||||
docker
|
|
||||||
node
|
node
|
||||||
|
docker
|
||||||
|
ffmpeg
|
||||||
|
ffprobe
|
||||||
|
|
||||||
|
librelyrics
|
||||||
|
spotify
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if [[ "${1:-}" == '--print-required' ]]; then
|
||||||
|
echo "utils='${utils[*]}'"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
local missing=false
|
local missing=false
|
||||||
for util in "${utils[@]}"; do
|
for util in "${utils[@]}"; do
|
||||||
if ! have_cmd "${util}"; then
|
if ! have_cmd "${util}"; then
|
||||||
@@ -252,6 +264,7 @@ output_eval_functions() {
|
|||||||
"${function}" == set_default_options ]] || continue
|
"${function}" == set_default_options ]] || continue
|
||||||
${line}
|
${line}
|
||||||
done <<<"$(declare -F)"
|
done <<<"$(declare -F)"
|
||||||
|
check_required_utils --print-required
|
||||||
}
|
}
|
||||||
|
|
||||||
get_file_isrc() {
|
get_file_isrc() {
|
||||||
|
|||||||
@@ -89,7 +89,6 @@ run_test_cmd() {
|
|||||||
else
|
else
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
test_help_option() {
|
test_help_option() {
|
||||||
@@ -163,21 +162,11 @@ test_determine_inputs_recurse() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
test_determine_inputs_bash() {
|
test_determine_inputs_bash() {
|
||||||
|
eval "$(add-synced-lyrics --eval)"
|
||||||
# TEST_ADD_BIN guaranteed to be single word
|
# TEST_ADD_BIN guaranteed to be single word
|
||||||
# shellcheck disable=SC2206
|
# shellcheck disable=SC2206
|
||||||
local utils=(
|
local utils=(
|
||||||
mktemp
|
${utils}
|
||||||
sort
|
|
||||||
base64
|
|
||||||
cat
|
|
||||||
ffprobe
|
|
||||||
jq
|
|
||||||
librelyrics
|
|
||||||
spotify
|
|
||||||
docker
|
|
||||||
node
|
|
||||||
readlink
|
|
||||||
bash
|
|
||||||
${TEST_ADD_BIN:-}
|
${TEST_ADD_BIN:-}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user