Skip to content

InvestigatorDoofy/grayjay-dl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

grayjay-dl

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.

Why grayjay-dl?

Most playlist downloaders require you to create a Spotify app. grayjay-dl takes a different approach:

  1. Import your Spotify playlist into Grayjay
  2. Export playlist from Grayjay using the "share import file" feature
  3. 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.

Prerequisites

Installation

  1. Install Deno:

    curl -fsSL https://deno.land/x/install/install.sh | sh
  2. Install yt-dlp:

    # macOS
    brew install yt-dlp
    
    # Debian/Ubuntu
    sudo apt install yt-dlp
    
    # Arch Linux
    yay -S yt-dlp

Usage

Step 1: Import playlist to Grayjay

  1. Open Grayjay app
  2. Import your Spotify playlist using Grayjay's import feature

Step 2: Export from Grayjay

  1. Select your imported playlist in Grayjay
  2. Click the "Share" button and choose "Share as import"
  3. Save the exported JSON file

Step 3: Download with grayjay-dl

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!

Configuration

Default settings (configurable in grayjay-dl.ts):

  • Audio format: MP3
  • Wait time: 30-60 seconds between downloads
  • Output directory: ./downloads

Troubleshooting

"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.

License

MIT License - feel free to modify and distribute.

About

πŸ’Ώ Download your favorite playlists as MP3s using Grayjay's parsed song data and YouTube.

Topics

Resources

License

Stars

Watchers

Forks

Contributors