Apple Music decryption tool, based on zhaarey/apple-music-alac-atmos-downloader
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
AppleMusicDecrypt/README.md

118 lines
4.0 KiB

# AppleMusicDecrypt
5 months ago
Apple Music decryption tool, based
on [zhaarey/apple-music-alac-atmos-downloader](https://github.com/zhaarey/apple-music-alac-atmos-downloader)
5 months ago
**WARNING: This project is currently in an extremely early stage, and there are still a large number of undiscovered
bugs and unfinished features. USE IT WITH CAUTION.**
# Usage
5 months ago
```shell
# Download song/album with default codec (alac)
download https://music.apple.com/jp/album/nameless-name-single/1688539265
# Download song/album with specified codec
download https://music.apple.com/jp/song/caribbean-blue/339592231 -c aac
# Download song from specified m3u8 with default codec (alac)
m3u8 https://aod.itunes.apple.com/itunes-assets/HLSMusic116/v4/cb/f0/91/cbf09175-ce98-d133-1936-2e46b6992aa5/P631756252_lossless.m3u8
# Start Mitm mode
mitm
```
# Support Codec
- `alac (audio-alac-stereo)`
- `ec3 (audio-atmos / audio-ec3)`
- `ac3 (audio-ac3)`
- `aac (audio-stereo)`
- `aac-binaural (audio-stereo-binaural)`
5 months ago
- `aac-downmix (audio-stereo-downmix)`
# Support Link
5 months ago
- Apple Music Song Share
Link (https://music.apple.com/jp/album/%E5%90%8D%E3%82%82%E3%81%AA%E3%81%8D%E4%BD%95%E3%82%82%E3%81%8B%E3%82%82/1688539265?i=1688539274)
- Apple Music Album Share Link (https://music.apple.com/jp/album/nameless-name-single/1688539265)
- Apple Music Song Link (https://music.apple.com/jp/song/caribbean-blue/339592231)
# Deploy
5 months ago
## Prepare Local Environment
5 months ago
1. Install [GPAC](https://gpac.io/downloads/gpac-nightly-builds/)
5 months ago
2. Download [Bento4 MP4Tools](https://www.bento4.com/downloads/) and add the executable files to the environment
variables
3. Run `gpac -version`, `mp4box -version`, `mp4extract`, `mp4edit` and make sure all the commands run fine
5 months ago
## Prepare Android Environment
5 months ago
### For WSA (Recommend):
5 months ago
1. Install Apple Music (3.6.0-beta) and login
2. Play a song in Apple Music
5 months ago
3. Install WSA from [LSPosed/MagiskOnWSALocal](https://github.com/LSPosed/MagiskOnWSALocal). Choose the version that
includes Magisk but not GApps
4. Install following Magisk
modules: [magisk-frida](https://github.com/ViRb3/magisk-frida), [sqlite3-magisk-module](https://github.com/rojenzaman/sqlite3-magisk-module)
5. Edit `config.toml`
5 months ago
```toml
[[devices]]
host = "127.0.0.1"
port = 58526 # Replace this value to your WSA ADB port!
agentPort = 10020
suMethod = "su -c"
```
5 months ago
### For Google Android Emulator
5 months ago
1. Install Apple Music (3.6.0-beta) and login
2. Play a song in Apple Music
3. Manually install Frida and start frida-server in background
4. Edit `config.toml`
5 months ago
```toml
[[devices]]
host = "127.0.0.1"
port = 5555
agentPort = 10020
suMethod = "su 0"
```
5 months ago
## Run Script
5 months ago
### Use pre-built script (For Windows)
5 months ago
Download latest build from [Actions](https://github.com/WorldObservationLog/AppleMusicDecrypt/actions) (need login your
GitHub account). Unzip it, and run `main.exe`
### Manually Run
5 months ago
```shell
git clone https://github.com/WorldObservationLog/AppleMusicDecrypt.git
cd AppleMusicDecrypt
poetry install
cp config.example.toml config.toml
poetry run python main.py
```
# Mitm Mode
## Prepare Environment
5 months ago
1. Install [Proxifier](https://www.proxifier.com/) and [Apple Music Windows](https://apps.microsoft.com/detail/9pfhdd62mxs1)
2. Sign in to Apple Music Windows with your Apple account
3. Run `poetry run mitmproxy` under the script directory and quit
4. Install the CA certificate according
to [Mitmproxy's instructions](https://docs.mitmproxy.org/stable/concepts-certificates/#quick-setup)
5 months ago
5. Create a new proxy server in Proxifier(`Profile -> Proxy Servers -> Add`). `Address` and `Port` are values
of `mitm.host` and `mitm.port` in `config.toml`, and `Protocol` is `SOCKS Version 5`
5 months ago
6. Create a new proxification rule in Proxifier(`Profile -> Proxy Servers -> Add`). Fill in `Applications` field
with `amplibraryagent.exe; applemusic.exe` and select the proxy server just created in `Action`
## Start Mitm
1. Run the script, type command `mitm`
2. Start Proxifier
3. Start Apple Music Windows and play a song or an album.
4. Now the script should catch the m3u8 link and start ripping