Use HTTPS to fetch images

This commit is contained in:
Rohan Kumar 2020-02-28 18:13:20 -08:00
parent d0477c0fcb
commit b5c9811d3b
No known key found for this signature in database
GPG Key ID: 36B154A782AEA0AC
1 changed files with 3 additions and 3 deletions

6
kunst
View File

@ -102,10 +102,10 @@ get_cover_online() {
fi fi
# Try to get the album cover online from api.deezer.com # Try to get the album cover online from api.deezer.com
API_URL="http://api.deezer.com/search/autocomplete?q=$(mpc current)" && API_URL=${API_URL//' '/'%20'} API_URL="https://api.deezer.com/search/autocomplete?q=$(mpc current)" && API_URL=${API_URL//' '/'%20'}
# Extract the albumcover from the json returned # Extract the albumcover from the json returned
IMG_URL=$(curl -s "$API_URL" | jq -r '.playlists.data[0] | .picture_big') IMG_URL=$(curl -s --ssl "$API_URL" | jq -r '.playlists.data[0] | .picture_big')
if [ "$IMG_URL" = '' ] || [ "$IMG_URL" = 'null' ];then if [ "$IMG_URL" = '' ] || [ "$IMG_URL" = 'null' ];then
if [ ! $SILENT ];then if [ ! $SILENT ];then
@ -116,7 +116,7 @@ get_cover_online() {
if [ ! $SILENT ];then if [ ! $SILENT ];then
echo "kunst: cover found online" echo "kunst: cover found online"
fi fi
curl -o $COVER -s $IMG_URL curl -o $COVER -s --ssl $IMG_URL
ARTLESS=false ARTLESS=false
fi fi