Skip to content

Instantly share code, notes, and snippets.

@Vexcited
Last active May 29, 2026 04:51
Show Gist options
  • Select an option

  • Save Vexcited/ee0db9eec4533b37f67b32ffa577eae1 to your computer and use it in GitHub Desktop.

Select an option

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.

You can grab the latest release for arm64 on https://github.com/WorldObservationLog/wrapper/releases/tag/Wrapper.arm64.latest.

Let's download and extract the prebuilt binary.

wget https://github.com/WorldObservationLog/wrapper/releases/download/Wrapper.arm64.latest/Wrapper.arm64.e338fa6.zip
unzip Wrapper.arm64.e338fa6.zip -d apple-music-wrapper
rm Wrapper.arm64.e338fa6.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
@jasontkenny
Copy link
Copy Markdown

jasontkenny commented Apr 17, 2026

I'm getting the following error while building the image with docker

=> ERROR [stage-1 5/6] COPY entrypoint.sh /app/entrypoint.sh 0.0s

[stage-1 5/6] COPY entrypoint.sh /app/entrypoint.sh:

Dockerfile:41

39 | COPY --from=build /app/wrapper /app/wrapper

40 | COPY --from=build /app/rootfs /app/rootfs
41 | >>> COPY entrypoint.sh /app/entrypoint.sh
42 | RUN chmod +x /app/entrypoint.sh
43 |
ERROR: failed to build: failed to solve: failed to compute cache key: failed to calculate checksum of ref z5ctm3evbi8z3i7rdjibwcl0k::rckdg6kokyowyg31p2u35mz9p: "/entrypoint.sh": not found

I'm getting that error too.

------
 > [stage-1 5/6] COPY entrypoint.sh /app/entrypoint.sh:
------
Dockerfile:41
--------------------
  39 |     COPY --from=build /app/wrapper /app/wrapper
  40 |     COPY --from=build /app/rootfs /app/rootfs
  41 | >>> COPY entrypoint.sh /app/entrypoint.sh
  42 |     RUN chmod +x /app/entrypoint.sh
  43 |     
--------------------
ERROR: failed to build: failed to solve: failed to compute cache key: failed to calculate checksum of ref ay725u2h5j1jdr8p6xvwe263m::8faanwu02nyf1am88qr5d3t5l: "/entrypoint.sh": not found

it's weird because i followed this exact tutorial and it worked the day of, just not anymore :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment