spotify-library-checker
v1.0.5
Published
A Node.js utility to help you clean up your local music library by checking which artists are available on Spotify
Maintainers
Readme
Spotify Music Library Checker
A Node.js utility to help you clean up your local music library by checking which artists are available on Spotify. The tool scans your local music directory, matches artist names with Spotify's database, and helps you identify which folders you can safely delete if you're transitioning to Spotify streaming.
Features
- Scans first-level directories in your music folder (assumed to be artist names)
- Uses Spotify's API to find matching artists
- Implements smart name matching with similarity scoring
- Generates reports of matches and non-matches
- Includes a safe deletion utility with confirmation prompts
Prerequisites
- Node.js (v16 or higher)
- A Spotify Developer account
Installation
You can install this tool globally using npm:
npm install -g spotify-library-checkerOr run it directly using npx:
npx spotify-library-checker-configure
npx spotify-library-checker "/path/to/your/music"Configuration
Before using the tool, you need to configure your Spotify API credentials:
Get your Spotify API credentials:
- Go to Spotify Developer Dashboard
- Create a new application
- Copy the Client ID and Client Secret
Run the configuration command:
spotify-library-checker-configureThis will prompt you for your Spotify credentials and save them securely in
~/.spotify-library-checker/config.json.
Usage
1. Check Artists Against Spotify
Run the command with your music directory path as an argument:
spotify-library-checker "/path/to/your/music/directory"This will:
- Scan all artist folders in the specified directory
- Check each artist name against Spotify's database
- Generate two files:
spotify_matches.txt: Lists folders with matching artists on Spotifyno_matches.txt: Lists folders with no matches on Spotify
2. Delete Matched Folders (Optional)
If you want to delete the folders that have matches on Spotify:
spotify-library-checker-deleteThis script will:
- Read the
spotify_matches.txtfile - Ask for confirmation before deleting each folder
- Show the match quality (similarity percentage) for each deletion
Output Format
spotify_matches.txt
/path/to/folder Spotify Artist Name Spotify URL Similarity%no_matches.txt
/path/to/folderSafety Features
- Similarity threshold of 80% to prevent false matches
- Confirmation prompt before each folder deletion
- Full paths in log files for transparency
- Error handling and logging
- Directory existence validation
- Directory path validation
- Secure credential storage in user's home directory
Contributing
Feel free to submit issues and pull requests.
License
ISC
