Skip to content

A Rust written CLI tool to create custom Spotify playlists

Notifications You must be signed in to change notification settings

alevani/spotify-genre-extractor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Spotify Playlist's Genre Extractor

TODOs

  • Clap Args
  • Structure functions into files
  • More features..

Description: Playlist-Maker is a command-line tool written in Rust for creating custom Spotify playlists. The tool allows you to extract any genre from your liked playlist and create a new playlist based on that genre.

Usage:

  1. Set Up Spotify API:

  2. Syncing Data:

    • So far, the program calls the genre API for each artist, which, in my case, is awfully slow and may make you run into a 429 TOO MANY request error. I have added some very simple retry logic, for 80s as it's usually 80s..However, you should not have an issue running the program the first time, it only gets tricky if you have too many songs, or sync too many times without saving your metadatas.
    • To avoid issues, consider saving metadata. In main.rs, find the line:
      let artists = get_metadata(false, &spotify).await;
      • Set the boolean to true to load data from the cache, reducing load time. Run the program once with false, then switch to true for subsequent syncs.
  3. Selecting Playlist Genre:

    • Update the code in main.rs:
      let input = "danish pop".to_string();

Running the Program:

  • Once the environment is set up, run the command cargo run.

Note:

  • The Spotify API provides genres per artist, not per song, making sorting tricky due to artists having multiple genres.
  • Consider saving metadata to reduce load times and prevent API request errors.
  • Update the playlist genre by modifying the code in main.rs.

Example:

let input = "your-desired-genre".to_string();

Feel free to contribute and enhance the functionality of Playlist-Maker!

About

A Rust written CLI tool to create custom Spotify playlists

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages