Protect from re-downloading files

This commit is contained in:
Jaidyn Ann 2020-10-22 16:23:49 -05:00
parent 2d54442b8e
commit 4b907962d1

View File

@ -132,6 +132,10 @@ function dl_track_from_json {
output="${dir}/${title}" output="${dir}/${title}"
fi fi
if test -e "${output}.mp3"; then
return
fi
if test ! -e "${dir}/cover.jpg"; then if test ! -e "${dir}/cover.jpg"; then
fetch_page "$(cat "$json" | jq -r '.cover.large_url' 2>/dev/null)" \ fetch_page "$(cat "$json" | jq -r '.cover.large_url' 2>/dev/null)" \
> "${dir}/cover.jpg" > "${dir}/cover.jpg"