Fixed the Endpoint

This commit is contained in:
Akuma 2021-08-17 13:51:10 +00:00
parent f1fbfbb709
commit 9d4ad785b2
1 changed files with 3 additions and 3 deletions

6
kunst
View File

@ -7,7 +7,7 @@
# Dependencies: sxiv, imagemagick, bash, ffmpeg, mpc, jq, mpd # Dependencies: sxiv, imagemagick, bash, ffmpeg, mpc, jq, mpd
VERSION=1.3.2 VERSION=1.3.4
COVER=/tmp/kunst.jpg COVER=/tmp/kunst.jpg
MUSIC_DIR=~/Music MUSIC_DIR=~/Music
SIZE=250x250 SIZE=250x250
@ -112,9 +112,9 @@ get_cover_online() {
# Try to get the album cover online from api.deezer.com # Try to get the album cover online from api.deezer.com
API_URL="https://api.deezer.com/search/autocomplete?q=$QUERY" && API_URL=${API_URL//' '/'%20'} API_URL="https://api.deezer.com/search/autocomplete?q=$QUERY" && API_URL=${API_URL//' '/'%20'}
echo $API_URL
# Extract the albumcover from the json returned # Extract the albumcover from the json returned
IMG_URL=$(curl -s "$API_URL" | jq -r '.tracks.data[0].album.cover_big') IMG_URL=$(curl -s "$API_URL" | jq -r '.playlists.data[0].picture_big')
if [ "$IMG_URL" = '' ] || [ "$IMG_URL" = 'null' ];then if [ "$IMG_URL" = '' ] || [ "$IMG_URL" = 'null' ];then
[ ! "$SILENT" ] && echo "error: cover not found online" [ ! "$SILENT" ] && echo "error: cover not found online"