Skip to content

Commit

Permalink
Merge pull request #12 from Arial-Z/main
Browse files Browse the repository at this point in the history
Switch to wget to download img
  • Loading branch information
Arial-Z authored Jan 21, 2023
2 parents f82b642 + 223bdbe commit d92ca07
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions animes-renamer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions movies-renamer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 }')
Expand All @@ -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
Expand Down

0 comments on commit d92ca07

Please sign in to comment.