DeemixKit uses a unified credentials file to store API keys for services that require authentication. This keeps your sensitive data secure and centralized across all scripts.
Important: Deezer does NOT require any credentials - it uses a free public API!
Your credentials file should be located at:
~/.config/deemixkit/credentials.json
DeemixKit's Spotify features require a Client ID and Client Secret from Spotify's Developer Portal.
What you need:
client_id- Your Spotify application's Client IDclient_secret- Your Spotify application's Client Secret
How to get them:
- Go to Spotify Developer Dashboard
- Click "Create App" or "Log in" if you're not already logged in
- Fill in the form:
- App name: DeemixKit (or any name you prefer)
- App description: Music downloader automation
- Redirect URI: http://localhost:8888/callback (this field is required but not used by our scripts)
- API/SDK: Web API
- Click "Save"
- Copy your Client ID and Client Secret from the app settings page
Deezer provides a free, public API that doesn't require authentication. No setup needed!
Currently not used by DeemixKit but available for future features.
Currently not used by DeemixKit but available for future features.
Currently not used by DeemixKit but available for future features.
Some DeemixKit scripts use custom paths for your setup. These can be configured in the same credentials.json file.
| Setting | Description | Default |
|---|---|---|
paths.deemixkit |
Path to the DeemixKit installation | /Volumes/Eksternal/Music/Tools/DeemixKit |
paths.audio_library |
Path to your music collection | /Volumes/Eksternal/Audio |
You only need to set these if:
- You've installed DeemixKit in a different location
- Your music collection is stored elsewhere
- You're setting up DeemixKit on a new machine
Add the paths section to your credentials.json:
{
"spotify": {
"client_id": "YOUR_SPOTIFY_CLIENT_ID_HERE",
"client_secret": "YOUR_SPOTIFY_CLIENT_SECRET_HERE"
},
"paths": {
"deemixkit": "/your/custom/path/to/DeemixKit",
"audio_library": "/your/custom/path/to/Music"
}
}Note: The paths section is optional. If not specified, the scripts will use their default values.
mkdir -p ~/.config/deemixkitnano ~/.config/deemixkit/credentials.json
# or use your preferred editor: vim, code, etc.Paste the following into the file:
{
"spotify": {
"client_id": "YOUR_SPOTIFY_CLIENT_ID_HERE",
"client_secret": "YOUR_SPOTIFY_CLIENT_SECRET_HERE"
},
"paths": {
"deemixkit": "/path/to/DeemixKit",
"audio_library": "/path/to/Music"
}
}Replace the placeholder values with your actual Spotify credentials and custom paths (if needed).
- If using
nano: PressCtrl+O, thenCtrl+X - If using
vim: Press:wq - If using VS Code: Press
Cmd+S, thenCmd+Q
chmod 600 ~/.config/deemixkit/credentials.jsonThis makes the file readable and writable only by you.
Test if your Spotify credentials work:
# Navigate to DeemixKit directory
cd /path/to/DeemixKit
# Test Spotify resolver
python3 spotify-resolver.py --band "Metallica" --album "Master of Puppets"If successful, you should see:
✅ Copied to clipboard: Metallica - Master of Puppets
https://open.spotify.com/album/...
If you see "Spotify API credentials not configured", check:
- File location is correct:
~/.config/deemixkit/credentials.json - JSON is valid (no syntax errors)
- Client ID and Secret are correct
Here's a complete example of what your credentials.json might look like:
{
"spotify": {
"client_id": "abc123def456ghi789jkl012mno345pq",
"client_secret": "678rst901uvw234xyz567abc890def123ghi"
},
"paths": {
"deemixkit": "/Volumes/Eksternal/Music/Tools/DeemixKit",
"audio_library": "/Volumes/Eksternal/Audio"
},
"lastfm": {
"api_key": "your_lastfm_api_key",
"api_secret": "your_lastfm_api_secret"
},
"deezer": {
"api_key": "your_deezer_api_key",
"api_secret": "your_deezer_api_secret"
},
"youtube": {
"api_key": "your_youtube_api_key"
},
"discogs": {
"consumer_key": "your_discogs_consumer_key",
"consumer_secret": "your_discogs_consumer_secret",
"access_token": "your_discogs_access_token",
"access_secret": "your_discogs_access_secret"
}
}Note: Only include credentials for services you actually use. If you only use Spotify and Deezer, you only need those sections (and Deezer doesn't even require credentials). The paths section is optional and only needed if you want to customize default paths.
The .gitignore file in DeemixKit prevents accidental commits:
# Credentials and secrets
credentials.json
.env
*.pem
*.key
*_secret.json
*_credentials.json
Never commit your actual credentials.json file!
Only commit credentials.json.example with placeholder values:
{
"spotify": {
"client_id": "your_spotify_client_id_here",
"client_secret": "your_spotify_client_secret_here"
}
}Set restrictive permissions on your credentials file:
chmod 600 ~/.config/deemixkit/credentials.jsonThis makes the file readable and writable only by you.
Regularly rotate your API keys for better security:
- Generate new keys every 3-6 months
- Delete old unused keys from Spotify Developer Dashboard
- Update your
credentials.jsonfile
When creating your Spotify app:
- Only request necessary permissions
- DeemixKit only needs basic search and read access
- Don't request write or user data permissions
You can also use environment variables instead of a credentials file:
# Set environment variables
export SPOTIFY_CLIENT_ID="your_client_id"
export SPOTIFY_CLIENT_SECRET="your_client_secret"
# Scripts will automatically use these if credentials.json is not foundPros:
- Works well for temporary testing
- Useful in CI/CD environments
- No file to manage
Cons:
- Must be set in every terminal session
- Not persistent across reboots
- Less convenient for daily use
Recommendation: Use credentials.json for permanent setup, environment variables for temporary testing.
In addition to the unified credentials file, some scripts have their own config files for settings (not credentials):
| Script | Config Location | Purpose |
|---|---|---|
spotify-resolver.py |
~/.config/spotify-resolver/config.json |
API credentials, timeout, retries |
deezer-resolver.py |
~/.config/deezer-resolver/config.json |
Timeout, retries, cache settings |
discography-resolver.py |
~/.config/discography-resolver/config.json |
Timeout, retries, user agent |
Note: These config files are optional. If they don't exist, scripts use sensible defaults.
Cause: Credentials file not found or invalid JSON
Solutions:
- Check file exists:
ls ~/.config/deemixkit/credentials.json - Verify JSON is valid:
python3 -m json.tool ~/.config/deemixkit/credentials.json - Check file path:
cat ~/.config/deemixkit/credentials.json - Ensure you're using the home directory shortcut
~, not/Users/yourname
Cause: JSON syntax error in credentials file
Solution: Validate JSON:
python3 -m json.tool ~/.config/deemixkit/credentials.jsonThis will show you where the syntax error is.
Cause: Scripts might be looking in different config directories
Solution: Ensure the unified credentials file exists at ~/.config/deemixkit/credentials.json (not in script-specific directories).
- Spotify Developer Dashboard
- Spotify Web API Documentation
- Deezer Developer Portal (Deezer doesn't require credentials, but documentation is useful)
- JSON Validator - Validate your JSON online
Create an alias for quick editing:
# Add to ~/.zshrc or ~/.bash_profile
alias edit-deemix-creds='nano ~/.config/deemixkit/credentials.json'
# Use it anytime
edit-deemix-credsKeep a secure backup of your credentials file:
# Create backup
cp ~/.config/deemixkit/credentials.json ~/.config/deemixkit/credentials.json.backup
# Or use a password manager to store them securelyYou can create multiple Spotify apps for different purposes:
- One for personal use (DeemixKit)
- One for development/testing
- Each app gets its own Client ID and Secret
- Check the logs: Python scripts log to
~/.local/log/<script-name>/ - Run with verbose flag: Add
--verboseto see detailed error messages - Test credentials manually: Use curl to test Spotify API directly
- Review this guide: Make sure you followed all steps correctly
- Check GitHub issues: Someone may have solved the same problem
Need help? Open an issue on GitHub with details about what's not working.