diff --git a/animes-renamer.sh b/animes-renamer.sh index 2471813..709bcc9 100755 --- a/animes-renamer.sh +++ b/animes-renamer.sh @@ -48,16 +48,16 @@ if [ ! -f $POSTERS_FOLDER/$mal_id.jpg ] #check if exist then sleep 0.5 mal_poster_url=$(jq .data.images.jpg.large_image_url -r $SCRIPT_FOLDER/data/animes/$mal_id.json) - curl "$mal_poster_url" > $POSTERS_FOLDER/$mal_id.jpg + wget --no-use-server-timestamps -O $POSTERS_FOLDER/$mal_id.jpg "$mal_poster_url" sleep 1.5 else postersize=$(du -b $POSTERS_FOLDER/$mal_id.jpg | awk '{ print $1 }') - if [[ $postersize -lt 10000 ]] + if [[ $postersize -lt 2000 ]] then rm $POSTERS_FOLDER/$mal_id.jpg sleep 0.5 mal_poster_url=$(jq .data.images.jpg.large_image_url -r $SCRIPT_FOLDER/data/animes/$mal_id.json) - curl "$mal_poster_url" > $POSTERS_FOLDER/$mal_id.jpg + wget --no-use-server-timestamps -O $POSTERS_FOLDER/$mal_id.jpg "$mal_poster_url" sleep 1.5 fi fi diff --git a/movies-renamer.sh b/movies-renamer.sh index 53c1320..0c5de1f 100755 --- a/movies-renamer.sh +++ b/movies-renamer.sh @@ -47,7 +47,7 @@ if [ ! -f $POSTERS_FOLDER/$mal_id.jpg ] then sleep 0.5 mal_poster_url=$(jq .data.images.jpg.large_image_url -r $SCRIPT_FOLDER/data/movies/$mal_id.json) - curl "$mal_poster_url" > $POSTERS_FOLDER/$mal_id.jpg + wget --no-use-server-timestamps -O $POSTERS_FOLDER/$mal_id.jpg "$mal_poster_url" sleep 1.5 else postersize=$(du -b $POSTERS_FOLDER/$mal_id.jpg | awk '{ print $1 }') @@ -56,7 +56,7 @@ else rm $POSTERS_FOLDER/$mal_id.jpg sleep 0.5 mal_poster_url=$(jq .data.images.jpg.large_image_url -r $SCRIPT_FOLDER/data/movies/$mal_id.json) - curl "$mal_poster_url" > $POSTERS_FOLDER/$mal_id.jpg + wget --no-use-server-timestamps -O $POSTERS_FOLDER/$mal_id.jpg "$mal_poster_url" sleep 1.5 fi fi