Merge pull request #59 from Aeres-u99/api_endpoint_update

Fixed the Endpoint
This commit is contained in:
Siddharth Dushantha 2021-08-17 11:29:47 +02:00 committed by GitHub
commit c5d51654c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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"