From 4b907962d1aa604279826c6bd59f0a1267d3b385 Mon Sep 17 00:00:00 2001 From: Jaidyn Ann Date: Thu, 22 Oct 2020 16:23:49 -0500 Subject: [PATCH] Protect from re-downloading files --- divercities_dl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/divercities_dl b/divercities_dl index 7e87e7a..f1fb767 100644 --- a/divercities_dl +++ b/divercities_dl @@ -132,6 +132,10 @@ function dl_track_from_json { output="${dir}/${title}" fi + if test -e "${output}.mp3"; then + return + fi + if test ! -e "${dir}/cover.jpg"; then fetch_page "$(cat "$json" | jq -r '.cover.large_url' 2>/dev/null)" \ > "${dir}/cover.jpg"