Skip to content

Instantly share code, notes, and snippets.

@Vexcited
Last active July 19, 2025 17:32
Show Gist options
  • Save Vexcited/ee0db9eec4533b37f67b32ffa577eae1 to your computer and use it in GitHub Desktop.
Save Vexcited/ee0db9eec4533b37f67b32ffa577eae1 to your computer and use it in GitHub Desktop.
Apple Music Downloader on macOS (arm64)

Wrapper

First, you'll need a wrapper that supports arm64 architecture. We'll use https://github.com/WorldObservationLog/wrapper/tree/arm64 for this tutorial.

Latest known release for arm64 on this repository is https://github.com/WorldObservationLog/wrapper/releases/tag/Wrapper.arm64.b375260, let's download and extract the prebuilt binary.

wget https://github.com/WorldObservationLog/wrapper/releases/download/Wrapper.arm64.b375260/Wrapper.arm64.b375260.zip
unzip Wrapper.arm64.d0588b0.zip -d apple-music-wrapper
rm Wrapper.arm64.d0588b0.zip
cd apple-music-wrapper

You'll need docker to build the image, since the binary will only run on Linux.

docker build --tag wrapper .

On the first ever run, you'll need to authenticate with the following command. Don't forget to replace username and password with credentials for your Apple account.

docker run --rm -v ./rootfs/data:/app/rootfs/data -p 10020:10020 -e args="-L username:password -F -H 0.0.0.0" wrapper

If you receive a 2FA code request, you'll see the following.

[!] Enter your 2FA code into rootfs/data/code.txt
[!] Example command: echo -n 114514 > rootfs/data/2fa.txt
[!] Waiting for input...

As written, run in a new terminal...

echo -n 123456 > ./rootfs/data/2fa.txt

and replace 123456 with the received OTP code.

Once the setup is done, you'll be able to run directly the following command.

docker run --rm -v ./rootfs/data:/app/rootfs/data -p 10020:10020 -e args="-H 0.0.0.0" wrapper

Downloader

Once the wrapper is up and running, we'll now need the downloader: https://github.com/zhaarey/apple-music-downloader.

You'll have to install the following .pkg: https://download.tsi.telecom-paristech.fr/gpac/new_builds/gpac_latest_head_macos.pkg.

Finally, the following tools should also be installed.

brew install bento4
brew install go

We can now clone the repository.

git clone https://github.com/zhaarey/apple-music-downloader

You can now do a bit of configuration in the config.yaml file, here's the properties I modified.

language: "fr"
lrc-type: "syllable-lyrics"
cover-format: original
embed-lrc: true
embed-cover: true
alac-save-folder: alac
atmos-save-folder: atmos

Concerning the media-user-token, you'll have to go to the Apple Music web app, authenticate to your account and open the DevTools. There you'll have to find your cookies and grab the value of the media-user-token cookie. Put the value in this property and it's done !

Finally, you can now run the downloader !

go run main.go https://music.apple.com/us/album/whenever-you-need-somebody-2022-remaster/1624945511
go run main.go --debug https://music.apple.com/us/album/1989-taylors-version-deluxe/1713845538

ALAC to FLAC

ffmpeg -i file.m4a -movflags use_metadata_tags -map_metadata 0 -c:a flac file.flac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment