Skip to content

Instantly share code, notes, and snippets.

@mattneub
Last active May 1, 2026 04:19
Show Gist options
  • Select an option

  • Save mattneub/cd1d7890a5cc26e7e8053f019cb9cd54 to your computer and use it in GitHub Desktop.

Select an option

Save mattneub/cd1d7890a5cc26e7e8053f019cb9cd54 to your computer and use it in GitHub Desktop.
Install and Run apmyx on Mac with Wrapper

Install and Run apmyx on Mac with Wrapper

apmyx-gui is a delightful GUI application that lets you easily download music.

Assumptions and Preparations

I will assume you are willing and able to work in the Terminal.

I will assume you have Homebrew (brew). If you don’t, install it. See https://brew.sh

I will assume you have Apple’s Xcode command-line tools. If you don’t, install them; but they should have been installed along with Homebrew. To check, say

xcode-select -p

I will assume you have Python installed. (If you are a Python expert, disregard what I’m about to say.) I’m going to suggest we install Python thru Homebrew. If you don’t have it, install it.

brew install python

Check the Python installation by saying

which python3

You should see

/opt/homebrew/bin/python3

If you see a blank, the problem is that /opt/homebrew/bin is not in your PATH. Edit your .zshrc file (invisible file in your home directory) to include this line:

export PATH="/opt/homebrew/bin:$PATH"

Now close all Terminal windows and open a new one. which python3 should work now.

Get apmyx and Build It

Now we are going to start obeying the instructions in the README. First, install some more tools we will need:

brew install go gpac git docker

Now download the apmyx source code and build it, as described in the README. I’m going to download it to the Desktop. This location is not sacred, but you are going to need to keep this source code from now on, so you will need a good place.

cd ~/Desktop
git clone https://github.com/rwnk-12/apmyx-gui.git
cd apmyx-gui
cd scripts
chmod +x build_go.sh
./build_go.sh
cd ..

Install a Virtual Python Environment

(Again, if you are a Python expert, you can ignore this section.)

OK, we are in the apmyx-gui folder, and we are almost ready to give the magic command which will launch apmyx. But there’s a problem. The README wants you to say

pip install -r requirements.txt

But you can’t. First of all, you don’t have pip, you have pip3. Second, if you do say pip3 install -r requirements.txt, you will be told that your Python is controlled (by Homebrew). What you need is a virtual Python environment to work in. We will use venv. Set it up like this:

mkdir ~/.venv
python3 -m venv ~/.venv

Now we can configure that virtual environment. First, turn on the environment:

source ~/.venv/bin/activate

Now say what we were told to say:

pip install -r requirements.txt

It works!

Run apmyx

Now that we have configured our virtual environment, and we are actually in that environment (you can tell because your Terminal prompt keeps saying .venv at you), we can continue to obey the README and launch apmyx! Here we go:

cd src
python main.py

Lo and behold, apmyx launches; its window appears on the screen.

At this point apmyx is completely usable, if all you want to be able to do is download AAC files (256kbps). These are perfectly good and there is no major reason not to be satisfied with them. You just need, in the apmyx window, to go to Settings > General and enter your storefront region code and your media user token, as explained in the README. I won’t repeat the info about how to get hold of the media user token; the README is very clear about that. (I used Firefox.)

To quit apmyx, just use the apmyx Python menu at the top of the screen and choose Quit Python.

To get out of the Python virtual environment in the Terminal, say

deactivate

To sum up the steps needed to get apmyx running in the future (assuming you leave the apmyx-gui folder on the Desktop):

source ~/.venv/bin/activate
cd ~/Desktop/apmyx-gui/src
python main.py

Do not attempt to shorten the sequence by combining the last two steps, like this:

python ~/Desktop/apmyx-gui/src/main.py

No. You must actually be in ~/Desktop/apmyx-gui/src at the time you launch apmyx, because that is where it will look for its settings (in config.yaml) which were configured the first time you ran it.

Run wrapper — Step 1: Preparations

If you want to download ALAC lossless files (or atmos and so forth), you need to be running wrapper at the time you launch apmyx.

We want to run wrapper as a server through docker. That’s because wrapper is written for Linux, so we need to host a virtual Linux environment, which is what docker lets us do. The question is how to run docker. There is an official GUI but in my experience it is more trouble than it’s worth. Instead, we’ll use colima:

brew install colima

And run it:

colima start

We are now able to give the docker commands listed in the README. There are two of them. The first command fetches the wrapper docker image (the first time only) and configures the data. The second command runs the wrapper, using the configured data.

These are big complicated commands, and there is no hope of your typing them correctly. So open some sort of text processor (BBEdit or TextEdit or similar) and copy the commands into it.

The first command is either (if you have an Intel machine):

docker run -v ./rootfs/data:/app/rootfs/data -e args="-L username:password -F" --rm ghcr.io/itouakirai/wrapper:x86

or (if you have an Apple Silicon machine):

docker run -v ./rootfs/data:/app/rootfs/data -e args="-L username:password -F" --rm ghcr.io/itouakirai/wrapper:arm

Copy the correct one, paste it into the text processor, and where you see username:password substitute your real Apple ID username and password (separated by that colon).

The second command is either (if you have an Intel machine):

docker run -v ./rootfs/data:/app/rootfs/data -p 10020:10020 -p 20020:20020 -e args="-M 20020 -H 0.0.0.0" --rm ghcr.io/itouakirai/wrapper:x86

or (if you have an Apple Silicon machine):

docker run -v ./rootfs/data:/app/rootfs/data -p 10020:10020 -p 20020:20020 -e args="-M 20020 -H 0.0.0.0" --rm ghcr.io/itouakirai/wrapper:arm

You are also going to be using another command, and it will be a good idea to put it into your text processor too:

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

Run wrapper — Step 2: The First Command

Okay, before we attempt to give the first docker run command, prepare the Terminal. Open two new Terminal windows and cd both of them to some single known location that you will always use. I use my home folder for this. The first docker run command is going to create a folder rootfs in your Terminal’s location; the echo command is going to write into a file in that rootfs folder; and the second docker run command is going to use that rootfs folder. Thus you can see why it’s important to be always in the same place while using all these commands.

You have two Terminal windows open, pointed to the same location. In the second Terminal window, paste the echo command, without any return character (we don’t want to perform the command yet, we just want to have it at the ready), arrow-left to the 000000 and delete those digits. This Terminal window is now poised, ready for you to enter the 2FA six-digit code that you will receive when you give the first docker run command. You will have limited time to do this; that is why we want to prepare this Terminal window beforehand.

Now switch to the first Terminal window and say colima start if you haven’t done so already. Now paste in the first docker run command and hit Return. When you receive the six digit 2FA code, type it in the correct place (where the 000000 was previously) in the second Terminal window and hit Return. Look at the first Terminal window. If all has gone well, you will see something like:

[!] Enter your 2FA code into rootfs/data/code.txt
[!] Example command: echo -n 114514 > rootfs/data/2fa.txt
[!] Waiting for input...
[!] Code file detected! Logging in...
[.] response type 6
[!] The feature of getting m3u8 is defaultly disabled because it's unstable now. To enable it, please manually specify m3u8-port param.
[!] listening 127.0.0.1:10020

Assuming that this worked, we are now done with this step. In that same Terminal window, hit Control-C to stop docker, and say colima stop to stop colima.

Run wrapper — Step 3: The Second Command

Now we are ready, in that same Terminal window, to give the second docker run command. You don’t need the echo Terminal window any longer; it has done its job. So, in that same first Terminal window, still in the same location, say colima start; when colima is done starting, paste in the second docker run command and hit Return.

When it says listening, open another Terminal window and launch apmyx in the way that we already know:

source ~/.venv/bin/activate
cd ~/Desktop/apmyx-gui/src
python main.py

You are now looking at the apmyx window, and you can switch to ALAC and download lossless files (or whatever).

When you are finished, quit the Python window. In the Terminal window where you launched apmyx, say deactivate to turn off the Python virtual environment. In the Terminal window where docker is running wrapper, hit Control-C to stop docker, and say colima stop to stop colima.

It would be very nice if you never had to give the first docker run command again, with its nerve-wracking demand that you work in two Terminal windows and be ready to enter your 2FA number; and you can certainly try just giving only the second docker run command from now on (from the same location as before, of course). But I can’t guarantee how long it will be before the information expires and you have to start over with the first docker run command.

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