Windows
Android
使用
更新
方法1 - 使用MUMU模拟器 [来源]
1. 安装配置MUMU模拟器
- 下载 MUMU模拟器安装包
- 下载 MUMU模拟器备份还原包
- 安装MUMU模拟器并运行MUMU多开器12,新建 --> 导入并新建 --> 选择还原包
2. 正式使用
- 打开模拟器中 Apple Music 应用,登录有订阅的账号
- 保持 AppleMusic 在后台持续运行
- 运行 ZeroTermux 开始下载
使用下载命令
go run main.go [专辑/播放列表/艺人链接] [链接2] [链接3]...
[使用MUMU模拟器] ./dl [专辑/播放列表/艺人链接] [链接2] [链接3]...
---
go run main.go https://music.apple.com/cn/album/night-palace/1764954656
go run main.go https://music.apple.com/cn/artist/fishmans/304929223
go run main.go --select https://music.apple.com/cn/album/selected-ambient-works-85-92/1668862636
go run main.go --atmos https://music.apple.com/cn/album/electric-ladyland/359528125
- 指定专辑中几首歌: 使用时输入要下载的曲目数字,多个时用空格隔开
go run main.go --select [专辑链接]
- 下载杜比全景声
go run main.go --atmos [杜比专辑链接]
- 下载 aac-lc
go run main.go --aac [杜比专辑链接]
获取歌词及aac-lc
需要获取 media-user-token 并将其填入下载项目文件夹下 config.yaml 内对应的值- 打开桌面端网页浏览器使用有订阅的账号登录网页版 Apple Music ,在主页按
F12
打开开发者工具 - 依次点击 Application -> Storage -> Cookies -> https://music.apple.com
- 找到名称
media-user-token
对应的值,复制 -
在 ZeroTermux 中从右侧屏幕边缘向左滑动,打开文件管理器,依次点击
home -> amdl -> config.yaml
并打开编辑,替换第一个选项的值,保存,如下:media-user-token: "[粘贴到这里]" #If you need to obtain the lyrics, need to change it authorization-token: "your-authorization-token" #You don't need to change it; it can automatically obtain token language: ""
更新软件
更多 config.yaml 配置项
-
歌词
将歌词写入 m4a 的标签:
embed-lrc: true
保存歌词文件:
save-lrc-file: false
-
封面
嵌入封面:
embed-cover: true
封面最大尺寸:
cover-size: 5000x5000
动态封面
保存动态封面,需要环境变量里有 ffmpeg:
save-animated-artwork: false # If enabled, requires ffmpeg
-
文件命名规则
专辑
#{AlbumId} {AlbumName} {ArtistName} {ReleaseDate} {ReleaseYear} {UPC} {Copyright} {Quality} {Codec} {Tag} {RecordLabel} #example: {ReleaseYear} - {ArtistName} - {AlbumName}({AlbumId})({UPC})({Copyright}){Codec} album-folder-format: "{AlbumName} ({ReleaseYear}) [{Quality}]"
播放列表 / playlist
#{PlaylistId} {PlaylistName} {ArtistName} {Quality} {Codec} {Tag} playlist-folder-format: "{PlaylistName}"
歌曲
#{SongId} {SongNumer} {SongName} {DiscNumber} {TrackNumber} {Quality} {Codec} {Tag} #example: Disk {DiscNumber} - Track {TrackNumber} {SongName} [{Quality}]{{Tag}}" song-file-format: "{SongNumer}. {SongName}"
艺术家
#{ArtistId} {ArtistName}/{UrlArtistName} #if artist-folder-format set "",will not make artist folder artist-folder-format: "{ArtistName}"
-
最高采样率 (alac: kHz)
alac-max: 96000 #192000 96000 48000 44100 atmos-max: 2768 #2768 2448
方法2 - 使用 Android Studio
环境配置
百度网盘内有一些安装包
- 安装python (>=3.7),go
- 运行
pip install frida frida-tools
来安装 frida -
安装Android Studio,下载 adb[百度网盘] 并添加到环境变量
1. 复制解压 adb 的文件夹路径
2. Win+S 搜索 path ,点击 "编辑系统环境变量"
3. 环境变量 -> 新建 -> 粘贴
- 安装gpac
可能是用于爬 atmos 时将 .ec3 封装为 .m4a - 设置虚拟机可以选择最新系统,注意选择没有 Google APIs 的镜像
-
在虚拟机中安装 SAI githubf-droid (被墙)百度网盘
adb push com.aefyr.sai.fdroid_60.apk /system/temp/
(文件夹随便) -
在虚拟机中安装 Apple Music
x86 平台
1. 下载 Apple Music apk (最新版本可用性未知)
2.
adb push [.apkm地址] /system/temp/
(文件夹随便)3. 使用 SAI 找到 Apple Music 的 .apkm 文件并安装
4. 打开 Apple Music 并登录
-
安装 downloader
第一种方法 (需要git):用 cmd 随便打开一个目录(不用特意新建)
git clone https://github.com/zhaarey/apple-music-downloader.git
第二种方法,打开Github 链接点绿色的 Code 按钮,在弹出的窗口内点 Download ZIP,下载后解压至某个文件夹中
正式运行
- 打开虚拟机
-
转发端口并给 frida-server 超级用户权限
adb forward tcp:10020 tcp:10020 adb forward tcp:20020 tcp:20020 adb shell su 0 '/data/local/tmp/frida-server-16.2.1-android-x86_64'
-
启动 frida
x86 平台
frida -U -l agent.js -f com.apple.android.music
arm 平台
frida -U -l agent-arm64.js -f com.apple.android.music
- 使用下载命令
更新
- 打开或者 cd 到 main.go 所在的目录
git stash
(重要的一步,暂存对 config.yaml 的修改,此时 config.yaml 会暂时变为修改前的内容)git fetch git merge
git stash pop
(还原对 config.yaml 的修改)- 如果使用 Android Studio, 确保 frida 为最新版本:
pip install frida frida-tools --upgrade
- 附:清除 pip 缓存:
pip cache purge