Original script by Sorrow. Credit to @zhaarey and modified by me to include some fixes and improvements.
Important
Install MP4Box before continuing. Ensure it's correctly added to the environment variables.
You can do this by entering apt install wget git golang gpac ffmpeg nano -y
in your terminal.
- MP4Box will be called automatically to package EC3 as M4A file.
- Changed the directory structure to
ArtistName\AlbumName
; For Atmos files, its directory structure has changed toArtistName\AlbumName [Atmos]
and files are moved intoAM-DL-Atmos downloads
. - Add support for overall completion status display upon finishing the run.
- Automatically embed cover art and LRC lyrics (requires
media-user-token
). - Supports
check
withmain
, which can take a text address or API database. - Add
get-m3u8-from-device
(set totrue
) and set portadb forward tcp:20020 tcp:20020
to get M3U8 from the emulator. - Add support templates for folders and files.
- Add support for downloading all albums from an artist:
go run main.go https://music.apple.com/us/artist/taylor-swift/159260351 --all-album
- Add wrapper integration with its insane decryption speed rate (Supports Linux OS currently)
- Add support for length limitation with
limit-max
(default value oflimit-max
is 200). - Add support for synchronized and unsynchronized lyrics.
- Add support for decoding files for arm64 platforms.
- ALAC
(audio-alac-stereo)
- EC3
(audio-atmos / audio-ec3)
For AAC downloads, it is recommended to use WorldObservationLog's AppleMusicDecrypt.
- ALAC
(audio-alac-stereo)
- EC3
(audio-atmos / audio-ec3)
- AC3
(audio-ac3)
- AAC
(audio-stereo)
- AAC-binaural
(audio-stereo-binaural)
- AAC-downmix
(audio-stereo-downmix)
1. Start up the decoding daemon:
- With frida server:
- Create a virtual device on Android Studio with an image that doesn't have Google APIs.
- Install this version of Apple Music: Apple Music 3.6.0 beta. You will also need SAI to install it: SAI on F-Droid.
- Launch Apple Music and sign in to your account (subscription required).
- Port forward 10020 TCP:
adb forward tcp:10020 tcp:10020
- Start the frida agent with the command bellow:
- For x86 platforms:
frida -U -l agent.js -f com.apple.android.music
- For arm64 platforms:
frida -U -l agent-arm64.js -f com.apple.android.music
- With wrapper:
- Run the following command to download wrapper:
wget "https://github.com/itouakirai/wrapper/releases/download/linux/wrapper.linux.x86_64.tar.gz" && mkdir wrapper && tar -xzf wrapper.linux.x86_64.tar.gz -C wrapper
- Start the wrapper daemon:
- With command:
cd
to wrapper directory
cd wrapper
2. Start the daemon with following command:./wrapper -D 10020 -M 20020 -L username:password
Replace bothusername
andpassword
with your Apple Music account credentials.
3. Once the service is running on background. move on to Step 2 by opening another terminal.
Warning
The following script is still in the testing stage; I do not guarantee the script will fully work.
- With python script (beta):
- Download the following file to your host and make it executable:
wget "https://raw.githubusercontent.com/ChocolaMilk92/apple-music-alac-atmos-downloader/main/wrapper.py" chmod +x wrapper.py
2. Run the code and enter your Apple Music credentials.
3. Once the service is moved to the background. move on to Step 2 in the same terminal.
2. Run the main.go
file with your preferred options:
- To download the whole album:
go run main.go https://music.apple.com/us/album/whenever-you-need-somebody-2022-remaster/1624945511
- To download some selected songs in the album:
go run main.go --select https://music.apple.com/us/album/whenever-you-need-somebody-2022-remaster/1624945511
Once prompted, enter your numbers separated by spaces.
- To download the entire playlist:
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
- To download all albums from an artist:
go run main.go https://music.apple.com/us/artist/taylor-swift/159260351 --all-album
- To download songs with Dolby Atmos® support:
go run main.go --atmos https://music.apple.com/us/album/1989-taylors-version-deluxe/1713845538
and replace the URL above with your vaild Apple Music URL
- Open Apple Music and log in.
- Open the Developer tools, Click
Application -> Storage -> Cookies -> https://music.apple.com
. - Find the cookie named
media-user-token
and copy its value. - Paste the cookie value obtained in step 3 into the
config.yaml
and save it. - Start the script as usual.
Note: For detailed instructions, please refer to step 3 in the original documentation (available in Simplified Chinese only).