diff options
Diffstat (limited to '')
-rwxr-xr-x | hm/soispha/pkgs/scripts/wrappers/spodi.sh | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/hm/soispha/pkgs/scripts/wrappers/spodi.sh b/hm/soispha/pkgs/scripts/wrappers/spodi.sh index f8bc5337..8b4188b0 100755 --- a/hm/soispha/pkgs/scripts/wrappers/spodi.sh +++ b/hm/soispha/pkgs/scripts/wrappers/spodi.sh @@ -4,17 +4,15 @@ SHELL_LIBRARY_VERSION="2.0.13" . %SHELL_LIBRARY_PATH # This path must not contain spaces -DOWN_DIR="/home/soispha/media/music/down/spotify"; - -download_url="$1"; - +DOWN_DIR="/home/soispha/media/music/down/spotify" +download_url="$1" already_downloaded_files="$(mktmp)" -fd . "$DOWN_DIR" --exclude spotdl.log --exclude spotdl-errors.log > "$already_downloaded_files"; +fd . "$DOWN_DIR" --exclude spotdl.log --exclude spotdl-errors.log >"$already_downloaded_files" config="$(mktmp)" -cat << EOF | clean > "$config" +cat <<EOF | clean >"$config" # Main options --audio slider-kz bandcamp youtube-music piped youtube soundcloud --lyrics genius musixmatch azlyrics synced @@ -41,7 +39,7 @@ cat << EOF | clean > "$config" --log-level INFO EOF -if [ -z "$NO_CHECK" ] && [ "$(wc -l < "$already_downloaded_files" )" -ne 0 ];then +if [ -z "$NO_CHECK" ] && [ "$(wc -l <"$already_downloaded_files")" -ne 0 ]; then die "something is already downloaded" fi @@ -49,7 +47,6 @@ rm "$DOWN_DIR/spotdl.log" cd "$DOWN_DIR" || die "BUG: no $DOWN_DIR" touch "$DOWN_DIR/spotdl-errors.log" - # The sub shell needs to be unquoted, as the arguments may not be treated as one. # shellcheck disable=2046 unbuffer spotdl $(cat "$config") download "$download_url" | tee "$DOWN_DIR/spotdl.log" |