hbashton / spotify-ripper

https://github.com/jrnewell/spotify-ripper has been revived
MIT License
493 stars 98 forks source link

-g && --genre option help #22

Closed joowdx closed 5 years ago

joowdx commented 7 years ago
bash@Shadows:~$ sudo spotify-ripper spotify:track:1dNIEtp7AY3oDAKCGg2XkH -g artist
Spotify Ripper - v2.9.1
  Encoding output:      MP3, CBR 320 kbps
  Spotify bitrate:      320 kbps
  Unicode support:      ASCII only
  Output directory:     /mnt/c/Users/xxxxx/Music
  Settings directory:   /home/xxxxx/.spotify-ripper
  Format String:        {album}/{track_num}. {track_name}.{ext}
  Overwrite files:      No
Logging in...
Logged in as xxxxx
Loading track...
Ripping spotify:track:1dNIEtp7AY3oDAKCGg2XkH
/mnt/c/Users/xxxxx/Music/Something Just Like This/1. Something Just Like This.mp3
Track Download Size: 9.46 MB
Progress: [========================================] 04:08 / 04:08        (~00m 00s remaining)
Rip complete
WARNING: libsndfile may ignore -r and perform fseek's on the input.
Compile without libsndfile if this is a problem.
1. Something Just Like This.mp3 [ 9.47 MB ]
Attempting to retrieve genres from Spotify's Web API
https://api.spotify.com/v1/artists/69GGBxA162lTqCwzJG5jLp
URL returned non-200 HTTP code: 401
-------------------------------------------------------------------------------
Setting artist: The Chainsmokers
Setting album: Something Just Like This
Setting title: Something Just Like This
Setting track info: (1, 0)
Setting disc info: (1, 1)
Setting release year: 2017
Adding cover image
Time: 04:08     MPEG1, Layer III        [ 320 kb/s @ 44100 Hz - Joint Stereo ]
-------------------------------------------------------------------------------
ID3 v2.3: 7 frames
Writing ID3 version v2.3
-------------------------------------------------------------------------------
Logging out...

Why does it returns this error code? URL returned non-200 HTTP code: 401 I don't know how this API works but does this need some token to work?

{
  "error" : {
    "status" : 401,
    "message" : "No token provided"
  }
}

Edit: Perhaps it really does [?] (I don't know) Error Code 401

Unauthorized - The request requires user authentication or, if the request included authorization credentials, authorization has been refused for those credentials.

Minty123 commented 7 years ago

Hi there! You are right. This feature now requires authorization. For that, you need a client id and a client secret that you can get from Spotify's developer portal. Maybe other forks of the spotify-ripper already implemented it. If not, I could try to take a look at it myself even though it looks like this repo is not really supported anymore...