A simple CLI tool for downloading songs from YouTube using Grayjay export files. Converts your Spotify playlists to local MP3 files via Grayjay's import functionality.
Most playlist downloaders require you to create a Spotify app. grayjay-dl takes a different approach:
- Import your Spotify playlist into Grayjay
- Export playlist from Grayjay using the "share import file" feature
- Download with grayjay-dl
This workflow leverages Grayjay's already parsed song data to avoid the extra Spotify API step while still allowing you to download your favorite songs from YouTube.
Note: While Grayjay has a built-in download feature, it appears to have been broken for quite a long time now, making this external tool a reliable alternative for downloading your music.
-
Install Deno:
curl -fsSL https://deno.land/x/install/install.sh | sh -
Install yt-dlp:
# macOS brew install yt-dlp # Debian/Ubuntu sudo apt install yt-dlp # Arch Linux yay -S yt-dlp
- Open Grayjay app
- Import your Spotify playlist using Grayjay's import feature
- Select your imported playlist in Grayjay
- Click the "Share" button and choose "Share as import"
- Save the exported JSON file
git clone git@github.com:InvestigatorDoofy/grayjay-dl.git
cd grayjay-dl
deno run --allow-all grayjay-dl.ts <grayjay-export.json> [output-directory]π YouTube Song Downloader Starting...
π Input: ./my-playlist.json
π Output: ./downloads
π Found 25 videos in import file
[1/25] Processing: Mr. Brightside
π Searching: Mr. Brightside by The Killers
β¬οΈ Downloading: Mr. Brightside by The Killers
β
Downloaded: Mr. Brightside.mp3
β³ Waiting 45s before next download...
[2/25] Processing: Stairway to Heaven
π Searching: Stairway to Heaven by Led Zeppelin
β οΈ Using closest match: Stairway To Heaven - Remaster by Led Zeppelin
β¬οΈ Downloading: Stairway To Heaven - Remaster by Led Zeppelin
β
Downloaded: Stairway To Heaven - Remaster.mp3
...
π Summary: 23 successful, 2 failed
π Download process completed!
Default settings (configurable in grayjay-dl.ts):
- Audio format: MP3
- Wait time: 30-60 seconds between downloads
- Output directory:
./downloads
"yt-dlp not found"
Install yt-dlp using the instructions above and ensure it's in your PATH.
Downloads failing
Some songs may not be available on YouTube or may have different titles. Check the console output for specific errors.
Rate limiting issues
The tool includes built-in delays, but if you encounter issues, try increasing the wait times in the config.
MIT License - feel free to modify and distribute.