Ronni Dyrholm Chidekel

djdojo

Turns a YouTube playlist into lossless audio files for DJ practice. It is for private practice with music you have the right to download. The whole playlist lands in one folder, ready for a USB stick and the deck, or for rekordbox, Engine DJ, Serato and Traktor. A command line tool for macOS, free and open source under the MIT license.

brew install ronnidc/tap/djdojo

Requires macOS and Homebrew. Nothing else needs to be installed. Update with brew upgrade: YouTube changes things often, so when a download suddenly fails, that is the first step.

A run

Here is a run with a playlist by NoCopyrightSounds, a label that releases its music for free use by creators:

djdojo PLRBp0Fe2GpgliIz-BjIwIBgysth8ZkE8c
djdojo: Downloading the playlist "NCS - Instrumental Future House" (20 tracks) as AIFF with the YouTube login from Firefox
djdojo: Audio: opus 263k, Premium quality
djdojo: The playlist goes into "~/Music/djdojo/NCS - Instrumental Future House"
...
djdojo: Done. 20 .aiff files downloaded. 0 failed.
djdojo: The playlist is in "~/Music/djdojo/NCS - Instrumental Future House"

Every file is decoded once from YouTube's best audio stream and stored lossless with title, artist, album, track number and cover. MP3 would add another lossy step, and VBR MP3 can give imprecise cue points on older CDJs. The audio cannot get better than YouTube's source.

djdojo is for practice at home with music you have the right to download: your own uploads, tracks released for free use such as the NoCopyrightSounds catalogue, or music you have bought. You are responsible for complying with YouTube's Terms of Service and with copyright law where you live. For a gig, a stream or any other public or professional use, buy the music. WAV, AIFF or FLAC from Beatport, Bandcamp and the like sound better, and the people who made it get paid.

Usage

djdojo PLxxxxxxxx           # playlist ID or full link
djdojo PLxxxxxxxx flac      # FLAC instead of the default, this once
djdojo PLxxxxxxxx safari    # login from a specific browser
djdojo LM                   # YouTube Music's "Liked Music"
djdojo PLxxxxxxxx nologin   # no login, and no Premium audio
djdojo --help

A playlist is given as its full link or just its ID, the part after list= in the link. A single video works the same way. Extra yt-dlp options can be passed along, for example --playlist-items 1-10 for the first ten tracks. The playlist can be run again later: files already in the folder are skipped, so only new tracks are downloaded.

Formats

The first run asks for your preferences and stores them in ~/.config/djdojo/config. The folder is ~/Music/djdojo by default.

FormatPlays onSize
AIFFEvery Pioneer CDJ/XDJ with USB (16 bit/44.1 kHz)about 10 MB per minute
FLACCDJ-2000NXS2, XDJ-1000MK2 and newer (48 kHz)about half

Denon DJ players and DJ software play both formats. AIFF is the default because it works everywhere. Choose FLAC if you know you only play on newer decks.

Login

Without a browser name, djdojo tries Firefox, Safari and Chrome in that order and uses the first one that is logged in to YouTube. Login gives access to private playlists, and with YouTube Premium a higher-quality stream, which djdojo picks by itself. Your login is used only towards YouTube, cookies are not sent anywhere else. macOS blocks other programs from reading browser data, so Terminal needs Full Disk Access in System Settings, otherwise djdojo reports that it cannot read cookies.