Announcements

Help Wizard

Step 1

NEXT STEP

FAQs

Please see below the most popular frequently asked questions.

Loading article...

Loading faqs...

VIEW ALL

Ongoing Issues

Please see below the current ongoing issues which are under investigation.

Loading issue...

Loading ongoing issues...

VIEW ALL

Is there any working example how to modify user playlists from command line?

Is there any working example how to modify user playlists from command line?

I'm trying to write a simple script that will make a playlist and add all tracks by specific artist (from all albums) to this playlist.

For my code I'm using ruby and rspotify library, and it should be generally something like:

 

 

playlist = RSpotify::User.find('depesz').playlists.select { |x| x.name == "F.O.O.L" }

albums = RSpotify::Artist.search('F.O.O.L').first.albums(limit: 33)

playlist.add_tracks!( albums.first.tracks )

 

 

 but I'm getting errors related to oAuth.

I tried to understand it, but I can't. Examples I found require setting webserver, and some app, which I don't need - I just want to be able to write a tool that does things to my playlists.

Does anyone in here have a working example of what I need to do to get my script to work?

I guess my problem is not understanding the oAuth and how to use it in non-web environment, but perhaps it is something that can be worked around, and I just can't figure out how?

Reply
0 Replies

Suggested posts

Staff
Let's introduce ourselves!

Hey there you,   Yeah, you! 😁   Welcome - we're glad you joined the Spotify Community!   While you here, let's have a fun game and get…

Staff
ModeratorStaff / Moderator/ 3 years ago  in Social & Random

Type a product name