add: MV dl(need mp4decrypt)
This commit is contained in:
parent
95ebc25c96
commit
61dfea68e1
55
README.md
55
README.md
@ -2,23 +2,15 @@
|
|||||||
|
|
||||||
### 添加功能
|
### 添加功能
|
||||||
|
|
||||||
1. 调用外部MP4Box添加tag
|
1. 支持内嵌封面和LRC歌词(需要`media-user-token`,获取方式看最后的说明)
|
||||||
2. 更改目录结构为 歌手名\专辑名 ;Atmos下载文件则另外移动到AM-DL-Atmos downloads,并更改目录结构为 歌手名\专辑名 [Atmos]
|
2. 支持获取逐词与未同步歌词
|
||||||
3. 运行结束后显示总体完成情况
|
3. 支持下载歌手 `go run main.go https://music.apple.com/us/artist/taylor-swift/159260351` `--all-album` 自动选择歌手的所有专辑
|
||||||
4. 自动内嵌封面和LRC歌词(需要media-user-token,获取方式看最后的说明)
|
4. 下载解密部分更换为Sendy McSenderson的代码,实现边下载边解密,解决大文件解密时内存不足
|
||||||
5. 自动构建 可以到 [Actions](https://github.com/zhaarey/apple-music-alac-atmos-downloader/actions) 页面下载最新自动构建版本 可以直接`main.exe url`
|
5. MV下载,需要安装[mp4decrypt](https://www.bento4.com/downloads/)
|
||||||
6. 支持逐词与未同步歌词
|
|
||||||
7. 新增get-m3u8-from-device 改为true 且设置端口`adb forward tcp:20020 tcp:20020`即从模拟器获取m3u8
|
|
||||||
8. 文件夹和文件支持模板
|
|
||||||
9. 支持下载歌手 `go run main.go https://music.apple.com/us/artist/taylor-swift/159260351` `--all-album` 自动选择歌手的所有专辑
|
|
||||||
10. 新增[wrapper](https://github.com/zhaarey/wrapper/releases)模式 目前只能linux运行,解密速度超快,基本秒解
|
|
||||||
11. `limit-max`支持限制长度 默认200
|
|
||||||
12. 现已支持arm64解密
|
|
||||||
13. 下载解密部分更换为Sendy McSenderson的代码,实现边下载边解密
|
|
||||||
|
|
||||||
### Special thanks to `chocomint` for creating `agent-arm64.js`
|
### Special thanks to `chocomint` for creating `agent-arm64.js`
|
||||||
|
|
||||||
本项目暂不支持MV下载,对于下载aac-lc则必须填入有订阅的media-user-token
|
对于获取`aac-lc` `MV` `歌词` 必须填入有订阅的`media-user-token`
|
||||||
|
|
||||||
- `alac (audio-alac-stereo)`
|
- `alac (audio-alac-stereo)`
|
||||||
- `ec3 (audio-atmos / audio-ec3)`
|
- `ec3 (audio-atmos / audio-ec3)`
|
||||||
@ -26,38 +18,21 @@
|
|||||||
- `aac-lc (audio-stereo)`
|
- `aac-lc (audio-stereo)`
|
||||||
- `aac-binaural (audio-stereo-binaural)`
|
- `aac-binaural (audio-stereo-binaural)`
|
||||||
- `aac-downmix (audio-stereo-downmix)`
|
- `aac-downmix (audio-stereo-downmix)`
|
||||||
|
- `MV`
|
||||||
|
|
||||||
# Apple Music ALAC / Dolby Atmos Downloader
|
# Apple Music ALAC / Dolby Atmos Downloader
|
||||||
|
|
||||||
Original script by Sorrow. Modified by me to include some fixes and improvements.
|
Original script by Sorrow. Modified by me to include some fixes and improvements.
|
||||||
|
|
||||||
## How to use
|
## How to use
|
||||||
|
1. Make sure the decryption program [wrapper](https://github.com/zhaarey/wrapper) is running
|
||||||
1. Create a virtual device on Android Studio with a image that doesn't have Google APIs.
|
2. Start downloading some albums: `go run main.go https://music.apple.com/us/album/whenever-you-need-somebody-2022-remaster/1624945511`.
|
||||||
2. Install Apple Music
|
3. Start downloading single song: `go run main.go --song https://music.apple.com/us/album/never-gonna-give-you-up-2022-remaster/1624945511?i=1624945512` or `go run main.go https://music.apple.com/us/song/you-move-me-2022-remaster/1624945520`.
|
||||||
|
4. Start downloading select: `go run main.go --select https://music.apple.com/us/album/whenever-you-need-somebody-2022-remaster/1624945511` input numbers separated by spaces.
|
||||||
for x86 install this version of [Apple Music 3.6.0 beta4](https://www.apkmirror.com/apk/apple/apple-music/apple-music-3-6-0-beta-release/apple-music-3-6-0-beta-4-android-apk-download/). You will also need [SAI](https://f-droid.org/pt_BR/packages/com.aefyr.sai.fdroid/) to install it.
|
5. Start downloading some playlists: `go run main.go https://music.apple.com/us/playlist/taylor-swift-essentials/pl.3950454ced8c45a3b0cc693c2a7db97b` or `go run main.go https://music.apple.com/us/playlist/hi-res-lossless-24-bit-192khz/pl.u-MDAWvpjt38370N`.
|
||||||
|
6. For dolby atmos: `go run main.go --atmos https://music.apple.com/us/album/1989-taylors-version-deluxe/1713845538`.
|
||||||
for arm64 install the last version of [Apple Music](https://www.apkmirror.com/apk/apple/apple-music/).
|
7. For aac: `go run main.go --aac https://music.apple.com/us/album/1989-taylors-version-deluxe/1713845538`.
|
||||||
|
8. For see quality: `go run main.go --debug https://music.apple.com/us/album/1989-taylors-version-deluxe/1713845538`.
|
||||||
3. Launch Apple Music and sign in to your account. Subscription required.
|
|
||||||
4. Port forward 10020 TCP: `adb forward tcp:10020 tcp:10020`.
|
|
||||||
5. Start frida server.
|
|
||||||
6. Start the frida agent:
|
|
||||||
|
|
||||||
for x86 `frida -U -l agent.js -f com.apple.android.music`
|
|
||||||
|
|
||||||
for arm64 `frida -U -l agent-arm64.js -f com.apple.android.music`
|
|
||||||
|
|
||||||
|
|
||||||
7. Start downloading some albums: `go run main.go https://music.apple.com/us/album/whenever-you-need-somebody-2022-remaster/1624945511`.
|
|
||||||
8. Start downloading single song: `go run main.go --song https://music.apple.com/us/album/never-gonna-give-you-up-2022-remaster/1624945511?i=1624945512` or `go run main.go https://music.apple.com/us/song/you-move-me-2022-remaster/1624945520`.
|
|
||||||
9. Start downloading select: `go run main.go --select https://music.apple.com/us/album/whenever-you-need-somebody-2022-remaster/1624945511` input numbers separated by spaces.
|
|
||||||
10. Start downloading some playlists: `go run main.go https://music.apple.com/us/playlist/taylor-swift-essentials/pl.3950454ced8c45a3b0cc693c2a7db97b` or `go run main.go https://music.apple.com/us/playlist/hi-res-lossless-24-bit-192khz/pl.u-MDAWvpjt38370N`.
|
|
||||||
11. For dolby atmos: `go run main.go --atmos https://music.apple.com/us/album/1989-taylors-version-deluxe/1713845538`.
|
|
||||||
12. For aac: `go run main.go --aac https://music.apple.com/us/album/1989-taylors-version-deluxe/1713845538`.
|
|
||||||
13. For see quality: `go run main.go --debug https://music.apple.com/us/album/1989-taylors-version-deluxe/1713845538`.
|
|
||||||
|
|
||||||
[中文教程-详见方法三](https://telegra.ph/Apple-Music-Alac高解析度无损音乐下载教程-04-02-2)
|
[中文教程-详见方法三](https://telegra.ph/Apple-Music-Alac高解析度无损音乐下载教程-04-02-2)
|
||||||
|
|
||||||
|
53
main.go
53
main.go
@ -464,6 +464,29 @@ func contains(slice []string, item string) bool {
|
|||||||
func downloadTrack(trackNum int, trackTotal int, meta *structs.AutoGenerated, track structs.TrackData, albumId, token, storefront, mediaUserToken, sanAlbumFolder, Codec string, counter *structs.Counter) {
|
func downloadTrack(trackNum int, trackTotal int, meta *structs.AutoGenerated, track structs.TrackData, albumId, token, storefront, mediaUserToken, sanAlbumFolder, Codec string, counter *structs.Counter) {
|
||||||
counter.Total++
|
counter.Total++
|
||||||
fmt.Printf("Track %d of %d:\n", trackNum, trackTotal)
|
fmt.Printf("Track %d of %d:\n", trackNum, trackTotal)
|
||||||
|
|
||||||
|
//mv dl dev
|
||||||
|
if track.Type == "music-videos" {
|
||||||
|
if mediaUserToken == "" || len(mediaUserToken) <= 10 {
|
||||||
|
fmt.Println("meida-user-token is not set, skip MV dl")
|
||||||
|
counter.Success++
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if _, err := exec.LookPath("mp4decrypt"); err != nil {
|
||||||
|
fmt.Println("mp4decrypt is not found, skip MV dl")
|
||||||
|
counter.Success++
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err := mvDownloader(track.ID, sanAlbumFolder, token, mediaUserToken)
|
||||||
|
if err !=nil {
|
||||||
|
fmt.Println("\u26A0 Failed to dl MV:", err)
|
||||||
|
counter.Error++
|
||||||
|
return
|
||||||
|
}
|
||||||
|
counter.Success++
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
manifest, err := getInfoFromAdam(track.ID, token, storefront)
|
manifest, err := getInfoFromAdam(track.ID, token, storefront)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("\u26A0 Failed to get manifest:", err)
|
fmt.Println("\u26A0 Failed to get manifest:", err)
|
||||||
@ -1103,11 +1126,6 @@ func main() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
os.Args = args
|
os.Args = args
|
||||||
//mv dl dev
|
|
||||||
if strings.Contains(os.Args[0], "/music-video/") {
|
|
||||||
_ = mvDownloader(checkUrlMv(os.Args[0]), Config.AlacSaveFolder, token, Config.MediaUserToken)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if strings.Contains(os.Args[0], "/artist/") {
|
if strings.Contains(os.Args[0], "/artist/") {
|
||||||
urlArtistName, err := getUrlArtistName(os.Args[0], token)
|
urlArtistName, err := getUrlArtistName(os.Args[0], token)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -1130,6 +1148,31 @@ func main() {
|
|||||||
for albumNum, urlRaw := range os.Args {
|
for albumNum, urlRaw := range os.Args {
|
||||||
fmt.Printf("Album %d of %d:\n", albumNum+1, albumTotal)
|
fmt.Printf("Album %d of %d:\n", albumNum+1, albumTotal)
|
||||||
var storefront, albumId string
|
var storefront, albumId string
|
||||||
|
//mv dl dev
|
||||||
|
if strings.Contains(urlRaw, "/music-video/") {
|
||||||
|
if debug_mode {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
counter.Total++
|
||||||
|
if Config.MediaUserToken == "" || len(Config.MediaUserToken) <= 10 {
|
||||||
|
fmt.Println("meida-user-token is not set, skip MV dl")
|
||||||
|
counter.Success++
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if _, err := exec.LookPath("mp4decrypt"); err != nil {
|
||||||
|
fmt.Println("mp4decrypt is not found, skip MV dl")
|
||||||
|
counter.Success++
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
err := mvDownloader(checkUrlMv(urlRaw), Config.AlacSaveFolder, token, Config.MediaUserToken)
|
||||||
|
if err !=nil {
|
||||||
|
fmt.Println("\u26A0 Failed to dl MV:", err)
|
||||||
|
counter.Error++
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
counter.Success++
|
||||||
|
continue
|
||||||
|
}
|
||||||
if strings.Contains(urlRaw, "/song/") {
|
if strings.Contains(urlRaw, "/song/") {
|
||||||
urlRaw, err = getUrlSong(urlRaw, token)
|
urlRaw, err = getUrlSong(urlRaw, token)
|
||||||
dl_song = true
|
dl_song = true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user