Rip Apple Music tracks in lossless ALAC — straight to your drive.
⚠️ Personal use only. This tool is for music you have the right to access. Downloading copyrighted content may violate Apple's ToS and local copyright laws.
AppleMusicDL downloads tracks from Apple Music in ALAC (Apple Lossless Audio Codec) format — the same lossless quality Apple streams — with complete iTunes metadata embedded. No lossy compression, no missing tags, no manual work.
Apple Music → Frida (FairPlay decrypt) → .m4a (ALAC + metadata)
What you get:
- Lossless ALAC audio, exactly as streamed
- Full metadata — title, artist, album, year, composer, ISRC, UPC
- Album artwork embedded + saved separately
- Automatically organized folder structure
| Step | What happens |
|---|---|
| 1 | Extracts bearer token from Apple Music web interface |
| 2 | Fetches album + track metadata via Apple Music API |
| 3 | Parses M3U8 playlists to locate ALAC streams |
| 4 | Downloads encrypted fragmented MP4 segments |
| 5 | Sends encrypted samples to Frida agent on Android emulator |
| 6 | Frida hooks FairPlay, decrypts and returns raw audio |
| 7 | Reconstructs complete .m4a with audio + metadata |
| Requirement | Details |
|---|---|
| Python | 3.8 or higher |
| Android Studio | With Android Emulator (no Google APIs image) |
| ADB | Android Debug Bridge |
| Frida | frida + frida-tools matching versions |
| Apple Music | Active subscription required |
| APK | Apple Music 3.6.0 Beta (APKMirror) |
git clone https://github.com/w3Abhishek/AppleMusicDL.git
cd AppleMusicDL
pip install -r requirements.txt- Open Android Studio → create a virtual device
- Use an image without Google APIs (required for Frida)
- Recommended: Android 10 (API 29) or Android 11 (API 30)
- Install SAI (Split APKs Installer) on the emulator
- Use SAI to install the Apple Music 3.6.0 Beta APK
- Sign in with your Apple ID (subscription required)
# Check your installed version
frida --version
# Download matching frida-server for x86_64 emulator
# Replace <version> with your frida version
wget https://github.com/frida/frida/releases/download/<version>/frida-server-<version>-android-x86_64.xz
unxz frida-server-<version>-android-x86_64.xz
# Push to emulator and start
adb root
adb push frida-server-<version>-android-x86_64 /data/local/tmp/frida-server
adb shell "chmod 755 /data/local/tmp/frida-server"
adb shell "/data/local/tmp/frida-server &"
# Confirm it's running
frida-ps -Uadb forward tcp:10020 tcp:10020Step 1 — Start the Frida agent and keep it running:
frida -U -l agent.js -f com.apple.android.musicStep 2 — Download an album:
python main.py https://music.apple.com/us/album/album-name/1624945511Multiple albums at once:
python main.py \
https://music.apple.com/us/album/album1/123456 \
https://music.apple.com/us/album/album2/789012Output:
AM-DL downloads/
└── Artist Name - Album Name/
├── cover.jpg
├── 01. Track Name.m4a
├── 02. Track Name.m4a
└── ...
AppleMusicDL/
├── apple_music_dl/
│ ├── api.py # Apple Music API client + auth
│ ├── m3u8_parser.py # Stream URL + encryption key extraction
│ ├── mp4_handler.py # Fragmented MP4 parsing + ALAC params
│ ├── decryptor.py # Frida socket communication
│ ├── metadata.py # iTunes metadata + M4A reconstruction
│ ├── models.py # Data models
│ └── utils.py # Helpers
├── agent.js # Frida agent (JavaScript, runs on emulator)
├── main.py # Entry point
└── requirements.txt
Failed to connect to Frida agent
adb shell ps | grep frida # verify server is running
adb forward tcp:10020 tcp:10020 # re-apply port forward
frida-ps -U # list processes, confirm ADB sees emulatorUnavailable in ALAC
Some tracks are not available in lossless in all regions. Try switching your Apple Music storefront or check if the album has a lossless badge in the app.
Failed to get token
Apple occasionally changes their web interface structure. Open an issue with your full error log and Python version.
Decryption size mismatch
The encryption key list doesn't match the sample count. Re-run the download. If it persists, check Frida agent output for errors.
- Fork the repo
- Create a feature branch (
git checkout -b feat/your-feature) - Write tests for your changes
- Open a pull request
Bug reports with full logs and Python version are always welcome.
Mozilla Public License 2.0 — open source, share-alike for modifications.