spotify_playlist_maker 0.2.2

A Rust package to automate Spotify playlist creation
Documentation

Rust Spotify Playlist Maker

Rust Program Documentation

This Rust program automates playlist creation on Spotify using the rspotify library. It authenticates users, searches for songs, and creates a playlist with predefined tracks. Version 2.0 has now a user interface.


desktop/src/          ← frontend (index.html, main.js, styles.css)
desktop/src-tauri/    ← Tauri backend
  src/lib.rs          ← has load_songs, save_songs, make_playlist ✅
  src/main.rs         ← calls desktop_lib::run() ✅
  Cargo.toml          ← depends on spotify_playlist_maker = { path = "../.." } ✅

src/lib.rs            ← root library (the Spotify logic lives here)
src/main.rs           ← CLI

Features

  • OAuth2 authentication with Spotify (no need to manually enter tokens)
  • Automated playlist creation
  • Song search and addition
  • Uses tiny_http to handle the authentication callback automatically

Crates.io Crates.io Crates.io

Prerequisites

Before running the program, make sure you have the following installed:

  1. Rust and Cargo (if not already installed)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  1. Spotify Developer Account
  • Go to Spotify Developer Dashboard
  • Create a new app
  • Add the following Redirect URIs:
    http://127.0.0.1:8888/callback
    http://localhost:8888/callback
    
  • Copy the Client ID and Client Secret.

Installation and Setup

Install via Cargo

https://crates.io/crates/spotify_playlist_maker

Create a .env file for your API credentials

nano .env

Paste the following into the file:

SPOTIFY_CLIENT_ID="your_client_id_here"
SPOTIFY_CLIENT_SECRET="your_client_secret_here"
SPOTIFY_REDIRECT_URI="http://127.0.0.1:8888/callback"
SPOTIFY_SCOPES="playlist-modify-public playlist-modify-private user-library-read"

Save the file (CTRL + X Enter).


Running the Program

  1. Build and run the program
cargo run
  1. Follow the authorization link in the terminal
  2. Approve the application on Spotify
  3. Once approved, the program will automatically create the playlist and add songs

Testing & CI/CD

This project includes:

  • Unit tests for core logic (cargo test)
  • Integration tests for API calls
  • GitHub Actions for automated testing on every push

Rust CI

Built With

  • Rust
  • rspotify (Spotify API client)
  • tiny_http (to handle OAuth2 callback)

License

This project is licensed under the MIT License.


Maintained by

SkyeVault