This tool allows you to export your Spotify liked songs into YouTube links and download them in MP3 format.
It automates the entire process in three stages:
- Fetch liked tracks from Spotify
- Find corresponding YouTube links
- **Download MP3 files with **``
Note: Tested only on macOS 15.6.
Before running the app, you’ll need:
-
yt-dlp
Follow the instructions in the official GitHub repo to install. -
ffmpeg
Required for audio extraction and format conversion. You can install it on macOS using:brew install ffmpeg
-
Node.js 22.x
- Open the Spotify Developer Dashboard.
- Create a new app.
- In your new app:
- Enable Web API access.
- Copy your Client ID and Client Secret — you'll need these later.
- Visit webhook.site and copy the unique URL shown.
- In your Spotify Developer Dashboard app settings:
- Add the webhook.site URL to Redirect URIs.
-
Install dependencies:
npm install
-
Set environment variables:
- Copy
.env.exampleto.env. - Fill in the values:
CLIENT_ID=<your Spotify Client ID> CLIENT_SECRET=<your Spotify Client Secret> REDIRECT_URI=<your webhook.site URL>
This ensures your app can authenticate with Spotify.
- Copy
There are three main commands you can run:
npm run tracks:get-liked- Retrieves all your liked tracks from Spotify.
- The script will handle large libraries but this step is usually fast compared to downloading.
npm run tracks:get-urls- Runs Cypress in E2E mode to search for each Spotify track on YouTube.
- Stores the found YouTube links for later downloading.
npm run tracks:download- Uses
yt-dlpto download each collected YouTube link. - Timeouts between requests are added here to avoid hitting YouTube's
429 Too Many Requestsrate limit. - Saves MP3 files into the
downloaded/folder. - You can tweak
yt-dlpbehavior by editingrun-yt-dlp.bash.
- Avoid interruptions: Large Spotify libraries can take hours to process.
- Customize downloads:
Inrun-yt-dlp.bash, you can:- Change audio quality.
- Select output format (default is MP3).
- Add
--embed-metadatafor cleaner tagging.
- Stay within YouTube's fair use: Download music for personal use only.