Skip to main content

CLI tool for downloading Spotify tracks, playlists, and albums with organized folders and progress tracking

Project description

๐ŸŽต GroveGrab CLI

A powerful command-line tool for downloading Spotify tracks, playlists, albums, and artists using your own Spotify API credentials.

Python License

โœจ Features

  • ๐ŸŽต Download Everything - Tracks, playlists, albums, and artists
  • ๐Ÿ” Your API Credentials - Use your own Spotify API to avoid rate limits
  • ๐ŸŽจ Beautiful CLI - Rich terminal UI with progress bars and colors
  • ๐Ÿ“‹ Individual Song Progress - See each song's download progress in playlists/albums
  • ๐ŸŽง High Quality - Download in MP3 (up to 320kbps), FLAC, OGG, OPUS, or M4A
  • โšก Fast & Efficient - Concurrent downloads with real-time progress
  • ๐Ÿ“Š Task Management - List, cancel, retry, and view logs for all downloads
  • ๐Ÿ”„ Batch Downloads - Download multiple URLs from a file
  • ๐Ÿ’พ Smart Caching - Skip already downloaded tracks
  • ๐Ÿ’ป Windows Compatible - Full support for Windows console (no Unicode issues)

๐Ÿ“ฆ Installation

Option 1: Install from PyPI (Recommended)

pip install GroveGrabCLI

Option 2: Install from Source

git clone https://github.com/yourusername/grovegrab-cli.git
cd grovegrab-cli
pip install -e .

Option 3: Install on Android (Termux)

  1. Install Termux from F-Droid (NOT Play Store - outdated version)

  2. Update packages and install dependencies:

    pkg update && pkg upgrade
    pkg install python ffmpeg
    
  3. Install GroveGrab:

    pip install GroveGrabCLI
    
  4. Set up storage access (IMPORTANT for Android):

    termux-setup-storage
    

    This allows access to your phone's internal storage and SD card.

  5. Configure download directory:

    grovegrab auth
    

    When prompted for download path, use:

    • Internal Storage: /storage/emulated/0/Music/GroveGrab
    • SD Card: /storage/XXXX-XXXX/Music/GroveGrab (replace XXXX with your SD card ID)

    To find your SD card path:

    ls /storage/
    

Prerequisites

  • Python 3.8+
  • FFmpeg - Required by SpotDL for audio conversion
    # Windows (Chocolatey)
    choco install ffmpeg
    
    # macOS
    brew install ffmpeg
    
    # Linux (Ubuntu/Debian)
    sudo apt install ffmpeg
    
    # Android (Termux)
    pkg install ffmpeg
    

๐Ÿš€ Quick Start

โš ๏ธ IMPORTANT: First Time Setup Required

Before downloading anything, you MUST configure Spotify API credentials:

grovegrab auth

This will guide you through getting free API credentials from Spotify.

How to get Spotify API credentials (FREE):

  1. Go to Spotify Developer Dashboard
  2. Log in with your Spotify account (free account works!)
  3. Click "Create an App"
  4. Enter App Details:
    • App name: My GroveGrab (or any name you like)
    • App description: Personal music downloader
    • Check the agreement boxes
    • Click "Create"
  5. Copy your credentials:
    • You'll see your Client ID on the app page - copy it
    • Click "Show Client Secret" - copy it too
    • โš ๏ธ Keep these private!
  6. Configure Redirect URIs (IMPORTANT):
    • Click "Edit Settings" button
    • Scroll to "Redirect URIs"
    • Enter: http://localhost:8888/callback
    • Click "Add"
    • Also add: http://127.0.0.1:8888/callback
    • Click "Add" again
    • Scroll down and click "Save"
  7. Configure GroveGrab:
    grovegrab auth
    
    Paste your Client ID and Client Secret when prompted

Download Your First Track

grovegrab dl "https://open.spotify.com/track/..."

That's it! ๐ŸŽ‰

๐Ÿ“– Usage

Basic Commands

# Download a track/playlist/album
grovegrab dl "spotify_url"

# Download with custom settings
grovegrab dl "url" --format flac --quality 320k --output ~/Music

# Watch progress in real-time
grovegrab dl "url" --watch

# Run in background
grovegrab dl "url" --detach

Configuration

# Run setup wizard
grovegrab auth

# Show current configuration
grovegrab config --show

# Reset configuration
grovegrab config --reset

Task Management

# List active downloads
grovegrab list

# List all downloads (including completed)
grovegrab list --all

# Cancel a download
grovegrab cancel <task-id>

# Retry a failed download
grovegrab retry <task-id>

# View logs
grovegrab logs <task-id>

# Follow logs in real-time
grovegrab logs <task-id> --follow

Batch Downloads

# Download from a file containing URLs
grovegrab batch urls.txt

# With custom worker count
grovegrab batch urls.txt --workers 5

Example urls.txt:

https://open.spotify.com/track/...
https://open.spotify.com/playlist/...
https://open.spotify.com/album/...

Other Commands

# Show version
grovegrab version

# Get help
grovegrab --help
grovegrab dl --help

๐ŸŽจ Screenshots

Single Track Download

Starting download: track
Downloading: Artist - Song Name โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ 60%

Playlist Download (Individual Songs)

Starting download: playlist
Overall: 15/31 tracks (2 failed) โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ 48%
Anirudh Ravichander - Pathala Pathala โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ 100%
The Weeknd - Blinding Lights โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ 100%
Drake - God's Plan โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ 75%
Ed Sheeran - Shape of You โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ 30%

Task List

โ”Œโ”€ Download Tasks โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ ID       Status         Progress  Current Track    Stats    โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ a1b2c3d4 > running     67%       Drake - Hotline  3/5       โ”‚
โ”‚ e5f6g7h8 OK completed  100%      -                10/10     โ”‚
โ”‚ i9j0k1l2 ERR failed    45%       -                5/12 (2)  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

โš™๏ธ Configuration

Configuration is stored at:

  • Linux/Mac: ~/.config/grovegrab/config.json
  • Windows: %APPDATA%\grovegrab\config.json

Environment Variables

You can also set credentials via environment variables:

export SPOTIFY_CLIENT_ID="your_client_id"
export SPOTIFY_CLIENT_SECRET="your_client_secret"
export GROVEGRAB_OUTPUT="~/Music"

Configuration Options

Setting Default Options
audio_format mp3 mp3, flac, ogg, opus, m4a
audio_quality 320k 128k, 192k, 256k, 320k
default_download_path Platform-specific (see below) Any valid path

Default Download Paths:

  • Windows/Mac/Linux: ~/Music/GroveGrab
  • Android (Termux): /storage/emulated/0/Music/GroveGrab

Changing Download Directory

Option 1: During Setup

grovegrab auth
# Enter your desired path when prompted

Option 2: Edit Config File

# Windows
notepad %APPDATA%\grovegrab\config.json

# Mac/Linux
nano ~/.config/grovegrab/config.json

# Android (Termux)
nano ~/.config/grovegrab/config.json

Change the default_download_path value:

{
  "default_download_path": "/storage/emulated/0/Music/MyFolder"
}

Option 3: Per Download

grovegrab dl "url" --output /path/to/folder

๐Ÿ› ๏ธ Development

Setup Development Environment

# Clone the repository
git clone https://github.com/yourusername/grovegrab-cli.git
cd grovegrab-cli

# Install in editable mode with dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Format code
black grovegrab/

# Lint code
flake8 grovegrab/

Project Structure

grovegrab-cli/
โ”œโ”€โ”€ grovegrab/
โ”‚   โ”œโ”€โ”€ __init__.py      # Package info
โ”‚   โ”œโ”€โ”€ __main__.py      # Entry point
โ”‚   โ”œโ”€โ”€ cli.py           # CLI commands
โ”‚   โ”œโ”€โ”€ core.py          # Download manager
โ”‚   โ”œโ”€โ”€ config.py        # Configuration
โ”‚   โ””โ”€โ”€ ui.py            # Terminal UI
โ”œโ”€โ”€ tests/               # Unit tests
โ”œโ”€โ”€ docs/                # Documentation
โ”œโ”€โ”€ requirements.txt     # Dependencies
โ”œโ”€โ”€ setup.py             # Setup script
โ””โ”€โ”€ pyproject.toml       # Project metadata

๐Ÿ› Troubleshooting

โŒ "No client_id. Pass it or set a SPOTIPY_CLIENT_ID environment variable"

This is the most common issue! You need to configure Spotify API credentials first:

# Run this command to set up your credentials:
grovegrab auth

Get free credentials from Spotify Developer Dashboard (see Quick Start section above).

FFmpeg not found

# Install FFmpeg first
# Windows: choco install ffmpeg
# Mac: brew install ffmpeg
# Linux: sudo apt install ffmpeg

No internet connection

# Check your network connection
ping google.com

Download fails

# View detailed logs
grovegrab logs <task-id>

# Retry the download
grovegrab retry <task-id>

Invalid credentials

# Re-run setup
grovegrab auth

# Or check your credentials at
# https://developer.spotify.com/dashboard

Config location

Your configuration is stored at:

  • Windows: C:\Users\YourName\AppData\Local\grovegrab\grovegrab\config.json
  • Linux/Mac: ~/.config/grovegrab/config.json

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

โš ๏ธ Legal Notice

This tool is for personal use only. Please comply with:

  • Spotify's Terms of Service
  • YouTube's Terms of Service (SpotDL uses YouTube as audio source)
  • Copyright laws in your jurisdiction

Always support artists by using legitimate streaming services!

๐Ÿ™ Acknowledgments

  • SpotDL - The amazing tool that powers the downloads
  • Typer - Beautiful CLI framework
  • Rich - Gorgeous terminal formatting
  • GroveGrab Web - The original web version this CLI is based on

๐Ÿ“ž Support


Made with โค๏ธ for music lovers

If you enjoy this project, consider โญ starring the repository!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

grovegrabcli-1.0.5.tar.gz (20.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

grovegrabcli-1.0.5-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

Details for the file grovegrabcli-1.0.5.tar.gz.

File metadata

  • Download URL: grovegrabcli-1.0.5.tar.gz
  • Upload date:
  • Size: 20.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for grovegrabcli-1.0.5.tar.gz
Algorithm Hash digest
SHA256 2aa189af8b315bc64f29c75e8712ff9d81817e6c2ee23a9940c2abb6b5e35db0
MD5 3e170026ce906c8567509f1fcfdb69a4
BLAKE2b-256 9b2e1ebf4a82022cc27598b9d3aff68a83154db0d90ea3eddd460376e145f51b

See more details on using hashes here.

File details

Details for the file grovegrabcli-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: grovegrabcli-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 21.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for grovegrabcli-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 e90b2c80288672b5500e657ac9333f36a6629c9782340fe561f161894e0dfbb2
MD5 e54f5927fd6db6c4b748feee4475d2d0
BLAKE2b-256 8a6e0d1f3a66c6169dfab6b80ab4809369fc3174f46c81912854ffbd2e568f34

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page