I want to download all my favorite music to my local machine for completely offline listening. My goal is to have the same music library on both my iPhone (iOS) and MacBook (macOS).
This is for personal use only. I don't encourage illegal activities.
Be careful: If you use
--cookies-from-browser chrome to bypass the 403 error, you'll need to grant yt-dlp your OS user password. This gives the program access to your Chrome cookies and potentially stored passwords. Use at your own risk and make sure to download the official version from GitHub.Download all songs in
.mp3 format from a YouTube playlist using yt-dlpThis command downloads and converts all songs from a YouTube playlist to
.mp3 format. It saves the downloaded video IDs in downloaded.txt to prevent downloading the same song twice (using --no-overwrite). The command also captures all metadata (title, artist, album, cover) and removes [youtube_id] from the title.The
--cookies-from-browser option helps bypass the 403 (Forbidden) error.Other options are available in the
yt-dlp repository. Here are some useful ones:- Start downloading from a specific playlist index:
--playlist-start 4
- Download only up to a specific playlist index:
--playlist-end 10
If you only want to generate the
downloaded.txt file without downloading anything:To play a notification sound when your download completes:
You can create aliases (in zsh or bash) to efficiently download newly added songs from your playlists. For example, I have three playlistsβ"choices," "mood," and "rock"βwith corresponding folders of the same names in
~/Download/musics/Now, I can simply run
download_music_all to update all albums with the latest songs. Alternatively, I can use download_mp3 <url> to download either a single song or an entire playlist.For editing music metadata on macOS, I recommend MusicBrainz Picard. I use it to set the "album" attribute for all songs downloaded from the same playlist, making it easier to group them in the Apple Music app.
I use the built-in Apple Music app on both macOS and iOS for playing music.
To sync music between devices, I connect my iPhone to my MacBook with a cable and sync them through Finder β iPhone. macOS automatically identifies differences between the two devices and updates accordingly.
A key benefit of Apple Music is the ability to transfer music to Apple Watch for offline listening directly from the watch.
If Apple Music isn't your preference, consider Evermusic. It's affordable and feature-rich, though their customer service can be slow to respond. I personally stopped using it due to purchase-related issues.
Evermusic allows you to upload songs to cloud services like Google Drive, Mega, Dropbox, or iCloud, and stream directly from there.
The app offers offline downloading and device syncing over Wi-Fi.