Skip to content

Python script to collect and add a Spotify user's most listened to songs into a playlist

Notifications You must be signed in to change notification settings

rebridge/spotify_project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Spotify User's Most Listened To

Utilizes Spotipy and Spotify Web API to create playlists of a users's most listened to songs for a certain period of time.

Requirements

Instructions

  1. Install requirements

pip3 install -r requirements.txt

  1. Collect Spotify Credentials
  • Go to your Spotify Developer Dashboard https://developer.spotify.com/dashboard/
  • Register a new app
  • Collect Client ID and Client Secret (recommended to put into secrets.py file along with redirect uri)
  • Click the Edit Settings and add your desired Redirect URI (recommended is http://localhost:8888/callback/) to the Redirect URI section. This has to match the Redirect URI you have in your secret.py file in order to avoid an Invalid URI error
  • Add Client ID and Client Secrets to secrets.py (Best results are when using SPOTIPY_REDIRECT_URI='http://localhost:8888/callback/')
  • Run file from command line with the title of the playlist you want to create as an argument

python3 my_top_songs.py -p PLAYLIST_NAME -t TIME_RANGE

  • Input desired range of time as either short (4 weeks), medium (6 months), or long (All time)
  • if TIME_RANGE argument is not present the default time range is short

ToDo

  • Create GUI
  • Add additional functionality
  • Add option for text file

Troubleshooting

  • A user cannot have two playlists of the same name
  • INVALID_REDIRECT_URI - Make sure you have set the REDIRECT_URI in both secrets.py and in your Spotify Developer Application settings. Make sure they match
  • INVALID_CLIENT_ID - Make sure that you have added the correct CLIENT ID to secrets.py
  • INVALID_CLIENT_SECRET - Make sure that you have added the correct CLIENT SECRET to secrets.py

About

Python script to collect and add a Spotify user's most listened to songs into a playlist

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages