- Go 89.4%
- JavaScript 10.3%
- Dockerfile 0.3%
|
|
||
|---|---|---|
| .github/workflows | ||
| cmd/alacfix | ||
| utils | ||
| .dockerignore | ||
| .gitattributes | ||
| .gitignore | ||
| agent-arm64.js | ||
| agent.js | ||
| config.yaml.example | ||
| Dockerfile | ||
| go.mod | ||
| go.sum | ||
| main.go | ||
| README-CN.md | ||
| README.md | ||
Apple Music ALAC / Dolby Atmos Downloader
Original script by Sorrow. Modified with fixes and improvements.
⚠️ Prerequisites
Must be installed first:
- MP4Box - Ensure it's correctly added to your environment variables
- wrapper - Decryption program must be running before use
Optional (for MV download):
✨ Features
- Inline Covers & LRC Lyrics - Requires
media-user-token(see instructions below) - Word-by-word & Out-of-sync Lyrics support
- Artist Album Download - Automatically download all albums from an artist
go run main.go https://music.apple.com/us/artist/taylor-swift/159260351 --all-album - Stream Decryption - Uses Sendy McSenderson's code for download-and-decrypt streaming, solving memory issues with large files
- MV Download - Requires mp4decrypt installation
- Interactive Search - Arrow-key navigation for search results
go run main.go --search [song/album/artist] "search_term"
🎵 Supported Audio Formats
| Format | Description | Requires Subscription |
|---|---|---|
alac |
audio-alac-stereo | ✅ |
ec3 |
audio-atmos / audio-ec3 | ✅ |
aac |
audio-stereo | ✅ |
aac-lc |
audio-stereo | ✅ |
aac-binaural |
audio-stereo-binaural | ✅ |
aac-downmix |
audio-stereo-downmix | ✅ |
MV |
Music Video | ✅ |
Note: For
aac-lc,MV, andlyrics, you must provide a validmedia-user-tokenfrom an active subscription.
🚀 Usage
Running with Docker
-
Ensure the wrapper decryption program is running
-
Start the downloader:
# Show help
docker run --network host -v ./downloads:/downloads ghcr.io/zhaarey/apple-music-downloader --help
# Download albums
docker run --network host -v ./downloads:/downloads ghcr.io/zhaarey/apple-music-downloader https://music.apple.com/ru/album/children-of-forever/1443732441
# Download single song
docker run --network host -v ./downloads:/downloads ghcr.io/zhaarey/apple-music-downloader --song https://music.apple.com/ru/album/bass-folk-song/1443732441?i=1443732453
# Interactive selection
docker run -it --network host -v ./downloads:/downloads ghcr.io/zhaarey/apple-music-downloader --select https://music.apple.com/ru/album/children-of-forever/1443732441
# Download playlists
docker run --network host -v ./downloads:/downloads ghcr.io/zhaarey/apple-music-downloader https://music.apple.com/us/playlist/taylor-swift-essentials/pl.3950454ced8c45a3b0cc693c2a7db97b
# Dolby Atmos
docker run --network host -v ./downloads:/downloads ghcr.io/zhaarey/apple-music-downloader --atmos https://music.apple.com/us/album/1989-taylors-version-deluxe/1713845538
# AAC format
docker run --network host -v ./downloads:/downloads ghcr.io/zhaarey/apple-music-downloader --aac https://music.apple.com/us/album/1989-taylors-version-deluxe/1713845538
# Debug/View quality
docker run --network host -v ./downloads:/downloads ghcr.io/zhaarey/apple-music-downloader --debug https://music.apple.com/ru/album/miles-smiles/209407331
Custom Configuration:
Mount your own config.yaml:
docker run --network host -v ./downloads:/downloads -v ./config.yaml:/app/config.yaml ghcr.io/zhaarey/apple-music-downloader [args]
Note: Ensure
config.yamlexists in your current directory before running. If it doesn't exist, Docker will create an empty directory instead of a file, causing the container to fail.
Running Locally (Go)
-
Ensure the wrapper decryption program is running
-
Download albums:
go run main.go https://music.apple.com/us/album/whenever-you-need-somebody-2022-remaster/1624945511 -
Download single song:
go run main.go --song https://music.apple.com/us/album/never-gonna-give-you-up-2022-remaster/1624945511?i=1624945512 # or go run main.go https://music.apple.com/us/song/you-move-me-2022-remaster/1624945520 -
Interactive selection:
go run main.go --select https://music.apple.com/us/album/whenever-you-need-somebody-2022-remaster/1624945511Enter track numbers separated by spaces.
-
Download playlists:
go run main.go https://music.apple.com/us/playlist/taylor-swift-essentials/pl.3950454ced8c45a3b0cc693c2a7db97b # or go run main.go https://music.apple.com/us/playlist/hi-res-lossless-24-bit-192khz/pl.u-MDAWvpjt38370N -
Dolby Atmos:
go run main.go --atmos https://music.apple.com/us/album/1989-taylors-version-deluxe/1713845538 -
AAC format:
go run main.go --aac https://music.apple.com/us/album/1989-taylors-version-deluxe/1713845538 -
View quality info:
go run main.go --debug https://music.apple.com/us/album/1989-taylors-version-deluxe/1713845538
📝 Getting media-user-token (For Lyrics)
- Open Apple Music and log in
- Open Developer Tools (F12)
- Navigate to
Application → Storage → Cookies → https://music.apple.com - Find the cookie named
media-user-tokenand copy its value - Paste the value into
config.yamlunder themedia-user-tokensetting - Save the file and start the script
🌐 Getting Translation & Pronunciation Lyrics (Beta)
Note: These features are currently in beta.
- Open Apple Music Beta and log in
- Open Developer Tools (F12) and switch to the Network tab
- Search for a song that supports translation/pronunciation lyrics (K-Pop songs recommended)
- Press Ctrl+R to refresh and let DevTools capture network traffic
- Play the song and click the lyrics button - look for a request named
syllable-lyrics - Stop recording (click the red circle button), then select the Fetch/XHR tab
- Click on the
syllable-lyricsrequest to view details - Find the URL containing:
.../syllable-lyrics?l=<language_code>&extend=ttmlLocalizations - Copy the language value and paste it into
config.yaml - Optional: To disable pronunciation, remove the corresponding value in config.yaml:
...%5D=<remove_this_value>&extend... - Save and run the script as usual
👏 Special Thanks
- chocomint - Created
agent-arm64.js