CLI tool
SwapnilSoni1999/spotify-dl avatar
SwapnilSoni1999/spotify-dl

spotify-dl: Node.js Spotify audio downloader setup and constraints

Spotify Downloader and alternative of Spotdl(python) tool made in NodeJS based on youtube-dl

1,681 stars153 forksJavaScriptMIT

At a glance

What is it?
spotify-dl is a Node.js command-line tool that resolves Spotify items to YouTube results and downloads matching audio. Its usefulness depends on Spotify API access, YouTube search accuracy, FFmpeg, and credentials that the current README says users may need to supply themselves.
Who is it for?
Adopt spotify-dl only if you control the download workflow, have a compatible FFmpeg and Node.js environment, and accept that Spotify and YouTube access may block or misidentify results. Do not choose it for an official Spotify export or for offline access guaranteed by Spotify.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 3 days ago.
What is it written in?
Mainly JavaScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 20, 2026, and from our analysis. They are not legal advice.

Editorial analysis

Why spotify-dl exists and what it actually downloads

spotify-dl targets users who want command-line audio downloads from Spotify track, album, playlist, show, and episode links. It is not a direct Spotify audio extractor. Based on the package dependencies and README wording, the project interprets a Spotify URL, obtains metadata for the selected item, searches YouTube for a corresponding recording, selects a result, and downloads media through @distube/ytdl-core. FFmpeg participates in processing that media.

That distinction matters because Spotify is being used here as the catalog and metadata entry point while YouTube supplies the downloadable media. The README warns that a match depends on the item having a corresponding YouTube video and may still be incorrect. A successful command therefore proves only that the pipeline produced a file. It does not establish that the file is the same recording, that it has the requested quality, or that its rights permit the intended use.

The project is aimed at technical users comfortable with global npm packages, command-line options, browser authentication, and operating system host files. It also offers Docker and Termux installation paths. That makes the interface consistent across those environments, but it does not remove the service-level dependencies. Spotify Web API access and YouTube behavior remain external parts of the workflow.

spotify-dl request flow from Spotify URL to local audio

The executable entry is spotifydl, mapped by package.json to cli.js. The package is an ES module and depends on spotified for Spotify-related operations, yt-search for YouTube discovery, string-similarity for matching, and @distube/ytdl-core for media retrieval. fluent-ffmpeg handles FFmpeg-based media processing, while node-id3 and genius-lyrics support metadata and lyric-related features. The exact internal call sequence is not documented, but these dependencies and the README describe a clear external flow.

Searches can be shaped with --search-format. Its documented placeholders are albumName, artistName, and itemName. Users can append a literal fragment through --es, for example to distinguish versions when a broad query returns unrelated uploads. Matching is still based on discovered YouTube results, and the project explicitly warns that results can be wrong.

The --ef option applies comma-separated exclusion filters to descriptions and titles. Filename generation is controlled separately through --of, with placeholders for albumName, artistName, and itemName, and triple underscores represented as directory separators in the documented template. Reports for failed files can be produced with --dr. Lyrics are optional through --dl. These controls expose the pipeline's practical trade-off: it can refine search and organize results, but it cannot turn an uncertain YouTube match into authoritative proof.

Installing spotify-dl and checking the command

The README requires Node.js 24, FFmpeg, and Git on systems that need the manual installation path. Its primary global installation command installs directly from the GitHub repository:

sh
npm install -g https://github.com/swapnilsoni1999/spotify-dl

After installation, the help option is a suitable first command because it does not attempt a Spotify download:

sh
spotifydl --h

The help output should expose the command options documented by the README. A first track download uses the Spotify URL directly:

sh
spotifydl https://open.spotify.com/track/xyz

The xyz value in this README example is illustrative rather than a confirmed playable track. Replace it with a Spotify URL for content you are permitted to download. Output location defaults are not fully explained in the README, so use --help and --output when the destination matters. If installation encounters a Puppeteer Chromium download problem, the README gives this alternative:

sh
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true npm install -g https://github.com/swapnilsoni1999/spotify-dl

Skipping Chromium changes the installation path. It is a troubleshooting response to a documented Puppeteer issue, not evidence that every browser-dependent operation will work without a suitable Chromium installation.

Spotify Web API credentials and callback configuration

The largest deployment constraint appears at the start of the README. Spotify apps without the required Premium-backed access can receive a Web API block. The README says that, at the time of its documentation, free accounts were restricted and an app created by someone with a Premium subscription had to be shared with the user.

spotify-dl accepts application credentials through --ak in client-id:client-secret form. Interactive authentication uses --login, which opens an external window. For non-TTY environments such as Docker without an interactive terminal, the README points to --username and --password. It also states that headless login requires an earlier --login to grant access to playlists, saved songs, and related account data.

The documented redirect URI ends in /callback on port 7654 and uses a placeholder host. Headless login also requires mapping that placeholder host to 127.0.0.1 in the operating system's hosts file. This is an explicit network and account configuration requirement, not merely a command-line preference.

The README does not document a token storage format, refresh behavior, rate limits, or a migration path for Spotify API changes. It also does not promise that a previously created application will continue working. Engineers should therefore treat authentication as the first adoption gate rather than discovering it after installing Chromium and FFmpeg.

Docker and Termux deployment for spotify-dl

Docker provides a reproducible Node.js 24 environment. The published image command maps the current directory to /download and passes the URL as the container entrypoint's argument:

dockerfile
docker run -it --user=$(id -u):$(id -g) -v $(pwd):/download --rm ghcr.io/swapnilsoni1999/spotify-dl "https://open.spotify.com/...."

The Dockerfile is based on node:24, installs Chromium and ffmpeg, installs spotify-dl globally, and sets /download as its working directory. The user and group mapping are intended to avoid making downloaded files owned by an arbitrary container identity.

A local image can be built from the repository:

bash
git clone https://github.com/SwapnilSoni1999/spotify-dl
cd spotify-dl
docker build -t spotify-dl .

Termux has a separate installation script:

sh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/SwapnilSoni1999/spotify-dl/master/tools/termux.sh)"

The README says storage permission may require termux-setup-storage first. Docker improves environment consistency, but it does not remove Spotify credentials, the redirect host configuration, YouTube matching risk, or FFmpeg processing. Interactive login is also relevant because the README explicitly says Docker without -it is non-TTY and should use --u and --p.

Matching failures, blocked services, and operational limits

The clearest failure mode is a missing or incorrect YouTube match. A Spotify track may have no matching upload, while similarly named recordings, covers, live performances, remixes, or long videos can produce misleading search candidates. string-similarity can rank textual similarity, but the documentation does not claim that it verifies recording identity. Inspecting the generated file remains necessary.

YouTube itself can also break the flow. The README states that YouTube has locked down access and that the project was still looking for a compatible download flow when that warning was written. The dependency on @distube/ytdl-core does not guarantee future compatibility with YouTube changes. Authentication from Spotify does not solve a YouTube-side failure.

There is an additional scope limitation in saved content. The CLI documents options for saved tracks, shows, playlists, and albums, while some items may require a Premium account and valid credentials. The README gives no formal error catalog beyond an example Web API communication error containing “non existing.” It also does not document retry policy, concurrency limits, rate limits, or recovery after partial batch failure. --download-report is the only documented batch diagnostic aid.

For official offline listening or account-bound formats, spotify-dl is the wrong tool because its documented architecture relies on external YouTube search and download behavior. It is also unsuitable when users cannot supply and protect Spotify credentials.

Maintenance signals, dependency changes, and license discrepancy

The repository is not archived and has a recent push. Those are the available maintenance signals. The listed recent releases end with version 1.0.8 on 2022-05-05, while package.json currently declares version 1.4.1 and pins several direct dependencies, including axios 1.9.0, puppeteer 24.8.2, and @distube/ytdl-core 4.16.12. This indicates that repository code has changed after the listed releases, but the README does not provide a complete changelog or upgrade policy for 1.4.1.

Upgrade cost is tied to Node.js and browser tooling. Node.js 24 is required, Puppeteer brings Chromium concerns, and YouTube compatibility may require dependency or logic changes outside normal user configuration. The package also uses both spotified for Spotify data and ytdl-core for YouTube retrieval, so there are two external service surfaces to reassess.

The licensing record is inconsistent. Repository metadata reports MIT, while package.json declares "license": "ISC". The repository includes an MIT LICENSE file, but the npm package metadata says ISC. This is not legal advice, and the materials do not explain the discrepancy. Anyone incorporating the code or redistributing a modified package should resolve which license text applies before shipping it.

spotify-dl compared with direct Spotify API access

The real alternative is to use Spotify's official client or supported Web API workflows for catalog metadata and account features without constructing a YouTube-backed download pipeline. The difference is architectural. spotify-dl accepts a Spotify link, searches YouTube, attempts to match a recording, downloads from YouTube, and then applies local media processing. Official access does not expose the same YouTube matching or downloadable YouTube media stage.

That alternative is safer for ordinary subscription playback, account library management, and compliance with service terms, but it does not provide the same command-line goal. Users who need files outside Spotify should first establish permission for both the source recording and the download destination. spotify-dl cannot provide that permission.

A second alternative is to use an official download or offline feature offered for the specific content. The documentation supplied here does not describe Spotify's current offline entitlements, so no exact feature is asserted. The practical comparison is still clear: choose spotify-dl when its metadata-to-YouTube workflow is required, and choose official Spotify access when account-bound playback or supported API behavior is enough.

Editorial conclusion

Adopt spotify-dl only if you control the download workflow, have a compatible FFmpeg and Node.js environment, and accept that Spotify and YouTube access may block or misidentify results. Do not choose it for an official Spotify export or for offline access guaranteed by Spotify. Before adoption, verify that your Spotify application credentials work, that your content resolves to the intended YouTube recording, and whether the MIT repository license or the ISC package metadata governs your intended distribution.

Frequently asked questions

How do I install spotify-dl with Node.js?

The README requires Node.js 24, FFmpeg, and Git. Its primary installation command is `npm install -g https://github.com/swapnilsoni1999/spotify-dl`.

Does spotify-dl need Spotify Premium credentials?

The README warns that Spotify Web API access may be blocked without the required Premium-backed app setup. It documents --app-key, --login, --username, and --password, but its warning describes restrictions that may change with Spotify's policy.

Why can a spotify-dl download select the wrong audio?

The project resolves Spotify metadata through a YouTube search rather than extracting audio directly from Spotify. The README explicitly warns that a candidate may be missing or incorrectly matched.

Can spotify-dl download Spotify playlists, albums, shows, and episodes?

The README says the CLI supports tracks, shows, episodes, playlists, and albums. Availability can still depend on Spotify access, credentials, Premium-only items, and a corresponding YouTube result.

Official sources

  1. Issues
  2. License: MIT
  3. README
  4. Releases
  5. SwapnilSoni1999/spotify-dl on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/swapnilsoni1999-spotify-dl.svg)](https://hysenlabs.com/projects/swapnilsoni1999-spotify-dl)

Was this useful?