spotify-ripper: Fail to grab and embed a cover

Here is an output of freshly ripped file:

$ eyeD3 Hot\ Boys/Guerrilla\ Warfare/Hot\ Boys\ -\ You\ Dig.mp3
eyed3.core:WARNING: APIC frame does not contain image data/url
.../aria2/order1/Hot Boys/Guerrilla Warfare/Hot Boys - You Dig.mp3[ 7.70 MB ]
------------------------------------------------------------------------Time: 03:58     MPEG1, Layer III        [ ~271 kb/s @ 44100 Hz - Joint stereo ]
------------------------------------------------------------------------ID3 v2.4:
title: You Dig
artist: Hot Boys
album: Guerrilla Warfare
recording date: 1999
track: 11/17
disc: 1/1
FRONT_COVER Image: [Size: 0 bytes] [Type: image/jpeg]
Description: Front Cover

As can be seen, the inserted coverart is zero bytes long. I wonder why it fails to get and embed the cover. Did anyone got a similar issue?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 1
  • Comments: 25

Most upvoted comments

@reardenlife jfyi: https://github.com/wolfmanx/spotify-ripper/tree/pr-collect has a --large-album-cover option that works. You need to export the web api credentials at the top of the README though. So, basically applying this and the large album option fixes it…

@reardenlife I did some more research.

here is a stale PR that add ripper.web.get_large_coverart which seems to download the cover via http and not via the library. That might still work.

Another approach would be to add some code from https://github.com/ritiek/spotify-downloader - this basically rips songs from youtube, but the metadata is coming from spotify

@Pancho111 do you have a floppy drive? This should do: 💾

@freuz, Well, as you can see, the script’s input parameters are: token ans track id.

I have a different script to download all the covers for the playlist I ripped. Here:

[root@v48807 aria2]# cat spotify-get-covers.sh
#!/usr/bin/env bash

set -e
set -o errexit

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)"

CID=$(cat "${1}" | jq -r '.CID')
CS=$(cat "${1}" | jq -r '.CS')

auth=$(echo -n "$CID:$CS" | base64 -w 0)

t=$(curl -X "POST" -H "Authorization: Basic $auth" -d grant_type=client_credentials https://accounts.spotify.com/api/token)
token=$(echo "$t" | jq -r '.access_token')

playlisturl="${2}"
user=$(echo $playlisturl | cut -d "/" -f5)
uri=$(echo $playlisturl  | cut -d "/" -f7 | cut -d "?" -f1)

offset=0
tracks=""
while (( $offset < 42000 )); do
  t=$(curl "https://api.spotify.com/v1/users/$user/playlists/$uri/tracks?fields=items(track(uri))&offset=$offset" -H "Authorization: Bearer $token" )
  ctracks="$(echo "$t" | jq -r '.items[] | .track | .uri' )"
  tracks="$tracks$ctracks"
  if [ -z "$ctracks" ]; then
    break
  fi
  offset=$((offset+100))
done

cnt=$(echo "$tracks" | wc -l)
echo "Got $cnt tracks"
echo "$tracks" | xargs -L1 | cut -d ":" -f3 | xargs -L1 bash "$DIR"/spotify-hlp-get-covers.sh "$token"