Spotify Downloader with very few customization.
Find a file
Paxsenix0 65eebb78d3 init
2026-01-16 23:41:55 +08:00
bin init 2026-01-16 23:41:55 +08:00
.gitignore init 2026-01-16 23:41:55 +08:00
index.js init 2026-01-16 23:41:55 +08:00
LICENSE init 2026-01-16 23:41:55 +08:00
NOTICE.md init 2026-01-16 23:41:55 +08:00
package.json init 2026-01-16 23:41:55 +08:00
README.md init 2026-01-16 23:41:55 +08:00

GreenLoader

Spotify downloader with small customization. Download tracks, albums, and playlists with rich metadata and high-quality artwork.

⚠️ Disclaimer

This tool is for educational purposes only. Users are responsible for complying with Spotify's Terms of Service and applicable copyright laws. The developers do not condone piracy or copyright infringement.

Features

  • Download tracks, albums, and playlists from Spotify
  • Apple Music metadata integration - More metadata including composer, genre, copyright
  • High-quality artwork - Up to 3000x3000 from Apple Music
  • Synced lyrics support - Embedded LRC format lyrics
  • Complete ID3 tagging - Including ISRC, track numbers, artwork
  • Customizable file organization - Template-based naming and folder structure
  • Skip existing files - Resume interrupted downloads
  • Decryption & Tagging - Core audio decryption and metadata tagging implemented in JavaScript
  • Premium quality - 256kbps AAC when available (128kbps AAC for free users)

Installation

npm install -g greenloader

On Termux (recommended):

yarn add greenloader > /dev/null 2>&1

Quick Start

  1. Generate configuration file:
greenloader --init

Or use with npx (especially Termux):

npx greenloader --init
  1. Edit config.json and add your Spotify cookie:

    • Open Spotify Web Player in your browser
    • Open Developer Tools (F12)
    • Go to Application/Storage → Cookies
    • Copy the value of sp_dc cookie
    • Paste it in config.json under spotify.cookie
  2. Download music:

# Single track
greenloader https://open.spotify.com/track/xxxxx

# Album
greenloader https://open.spotify.com/album/xxxxx

# Playlist
greenloader https://open.spotify.com/playlist/xxxxx

⚙️ Configuration

Edit config.json to customize behavior:

Spotify Settings

{
  "spotify": {
    "cookie": "YOUR_SP_DC_COOKIE",
    "clientId": "...", // Automatically, no need to change
    "accessToken": "...", // Automatically, no need to change
    "accessTokenExpiry": "..." // Automatically, no need to change
  }
}

Apple Music Integration

{
  "appleMusic": {
    "enabled": true,
    "bearer": "...", // Automatically, no need to change
    "musicUserToken": "YOUR_APPLE_MUSIC_USER_TOKEN"
  }
}

Download Settings

{
  "download": {
    "outputDir": "./downloads",
    "trackTemplate": "{artist} - {title}",
    "albumTemplate": "{albumArtist} - {album}",
    "playlistTemplate": "{playlistName}",
    "trackFilenameInAlbum": "{trackNumber} - {title}",
    "trackFilenameInPlaylist": "{index} - {artist} - {title}",
    "createArtistFolder": false,
    "createAlbumTypeFolder": false,
    "coverArtSize": 3000,
    "embedLyrics": true,
    "preferAppleMusicArtwork": true
  }
}

Template Variables

  • {artist} - Track artist
  • {albumArtist} - Album artist
  • {title} - Track title
  • {album} - Album name
  • {trackNumber} - Track number (zero-padded)
  • {discNumber} - Disc number
  • {year} - Release year
  • {playlistName} - Playlist name
  • {index} - Playlist index (zero-padded)

Metadata Settings

{
  "metadata": {
    "comment": "Downloaded with GreenLoader",
    "addDownloadDate": false,
    "customTags": {}
  }
}

Advanced Settings

{
  "advanced": {
    "concurrentDownloads": 1,
    "retryAttempts": 3,
    "retryDelay": 2000,
    "skipExisting": true,
    "verboseLogging": false
  }
}

CLI Options

greenloader <spotify-url> [options]

Options:
  --init              Generate default config.json file
  --version, -v       Show version number
  --no-apple          Disable Apple Music metadata
  --output DIR        Custom output directory
  --skip-existing     Skip already downloaded files

Examples

Basic Download

greenloader https://open.spotify.com/track/xxxxx

Custom Output Directory

greenloader https://open.spotify.com/album/xxxxx --output ./my-music

Without Apple Music Metadata

greenloader https://open.spotify.com/playlist/xxxxx --no-apple

Resume Interrupted Download

greenloader https://open.spotify.com/album/xxxxx --skip-existing

Project Structure

greenloader/
├── index.js          # Main application code
├── bin/
│   └── cli.js        # CLI entry point
├── config.json       # User configuration (generated)
├── downloads/        # Default download directory
├── package.json
├── README.md
└── LICENSE

Metadata Sources

  1. Spotify API - Track information
  2. Apple Music API - More metadata via ISRC lookup
    • Composer
    • Genre(s)
    • Copyright information
    • High-res artwork (up to 3000x3000)

ID3 Tags

  • Title, Artist, Album, Album Artist
  • Track Number, Disc Number
  • Release Year, Genre
  • Composer, Copyright
  • ISRC (International Standard Recording Code)
  • Embedded Artwork
  • Synced Lyrics (LRC format)

License

GPL-3.0 License - see LICENSE file for details

Acknowledgments

  • Portions of this project are adapted from work by PwLDev. Originally licensed under MIT.
  • Some internal code adapted from PwLDev/node-spdl
  • @spdl/widevine / node-widevine - Widevine DRM handling (GPL-3)
  • Apple Music Internal API
  • Spotify Internal API

This tool is provided for educational purposes only. Users must:

  • Have a valid Spotify subscription
  • Comply with Spotify's Terms of Service
  • Respect copyright laws in their jurisdiction

The developers are not responsible for any misuse of this tool.


Made with ❤️ by Paxsenix0