From 765983c9592c9dbf99fd68686090c6dbacabba6e Mon Sep 17 00:00:00 2001 From: itouakirai <85016486+itouakirai@users.noreply.github.com> Date: Sat, 18 Oct 2025 17:36:18 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix:=20mv=E4=B8=8B=E8=BD=BD=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E6=97=B6=E6=9C=AA=E5=8F=8A=E6=97=B6=E5=88=A0=E9=99=A4?= =?UTF-8?q?tmp=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index 6e6b161..7eb41d9 100644 --- a/main.go +++ b/main.go @@ -2003,9 +2003,11 @@ func mvDownloader(adamID string, saveDir string, token string, storefront string videom3u8url, _ := extractVideo(mvm3u8url) videokeyAndUrls, _ := runv3.Run(adamID, videom3u8url, token, mediaUserToken, true, "") _ = runv3.ExtMvData(videokeyAndUrls, vidPath) + defer os.Remove(vidPath) audiom3u8url, _ := extractMvAudio(mvm3u8url) audiokeyAndUrls, _ := runv3.Run(adamID, audiom3u8url, token, mediaUserToken, true, "") _ = runv3.ExtMvData(audiokeyAndUrls, audPath) + defer os.Remove(vudPath) tags := []string{ "tool=", @@ -2070,6 +2072,7 @@ func mvDownloader(adamID string, saveDir string, token string, storefront string tags = append(tags, fmt.Sprintf("cover=%s", covPath)) } } + defer os.Remove(covPath) tagsString := strings.Join(tags, ":") muxCmd := exec.Command("MP4Box", "-itags", tagsString, "-quiet", "-add", vidPath, "-add", audPath, "-keep-utc", "-new", mvOutPath) @@ -2079,10 +2082,6 @@ func mvDownloader(adamID string, saveDir string, token string, storefront string return err } fmt.Printf("\rMV Remuxed. \n") - defer os.Remove(vidPath) - defer os.Remove(audPath) - defer os.Remove(covPath) - return nil } From d6a616fef6bff768de4d33efa012c76c8ac850d2 Mon Sep 17 00:00:00 2001 From: itouakirai <85016486+itouakirai@users.noreply.github.com> Date: Sat, 18 Oct 2025 17:44:13 +0800 Subject: [PATCH 2/4] =?UTF-8?q?fix:=20mv=E4=B8=8B=E8=BD=BD=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E6=97=B6=E6=9C=AA=E8=83=BD=E5=88=A0=E9=99=A4tmp?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 7eb41d9..6e897c5 100644 --- a/main.go +++ b/main.go @@ -2007,7 +2007,7 @@ func mvDownloader(adamID string, saveDir string, token string, storefront string audiom3u8url, _ := extractMvAudio(mvm3u8url) audiokeyAndUrls, _ := runv3.Run(adamID, audiom3u8url, token, mediaUserToken, true, "") _ = runv3.ExtMvData(audiokeyAndUrls, audPath) - defer os.Remove(vudPath) + defer os.Remove(audPath) tags := []string{ "tool=", From e065ab219ccf0352b67dcc35054f9cb7e219f5b9 Mon Sep 17 00:00:00 2001 From: itouakirai Date: Wed, 22 Oct 2025 00:59:58 +0800 Subject: [PATCH 3/4] fix: artistcover panic --- main.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 6e897c5..b1dcc38 100644 --- a/main.go +++ b/main.go @@ -872,7 +872,6 @@ func ripTrack(track *task.Track, token string, mediaUserToken string) { convertedPath = strings.TrimSuffix(trackPath, filepath.Ext(trackPath)) + "." + strings.ToLower(Config.ConvertFormat) considerConverted = true } - //get lrc var lrc string = "" if Config.EmbedLrc || Config.SaveLrcFile { @@ -1336,8 +1335,8 @@ func ripAlbum(albumId string, token string, storefront string, mediaUserToken st os.MkdirAll(albumFolderPath, os.ModePerm) album.SaveName = albumFolderName fmt.Println(albumFolderName) - if Config.SaveArtistCover { - if len(meta.Data[0].Relationships.Artists.Data) > 0 { + if Config.SaveArtistCover && len(meta.Data[0].Relationships.Artists.Data) > 0{ + if meta.Data[0].Relationships.Artists.Data[0].Attributes.Artwork.Url != "" { _, err = writeCover(singerFolder, "folder", meta.Data[0].Relationships.Artists.Data[0].Attributes.Artwork.Url) if err != nil { fmt.Println("Failed to write artist cover.") From b48121296a5d84d545ba569152c752ec5e6a5301 Mon Sep 17 00:00:00 2001 From: itouakirai Date: Wed, 22 Oct 2025 08:20:38 +0800 Subject: [PATCH 4/4] =?UTF-8?q?fix:=20=E4=B8=8D=E5=B5=8C=E5=85=A5cover?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E9=83=A8=E5=88=86=E6=92=AD=E6=94=BE=E5=99=A8?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E6=92=AD=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go.mod | 2 +- go.sum | 6 ++---- main.go | 3 ++- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 91c31bb..93b65e2 100644 --- a/go.mod +++ b/go.mod @@ -40,6 +40,6 @@ require ( github.com/go-resty/resty/v2 v2.16.5 github.com/itouakirai/mp4ff v0.0.0-20250930132656-98812935a1c7 github.com/olekukonko/tablewriter v0.0.5 - github.com/zhaarey/go-mp4tag v0.0.0-20250210094042-22578afc09bf + github.com/zhaarey/go-mp4tag v0.0.0-20251021234435-2c70f6b1bf76 gopkg.in/yaml.v2 v2.2.8 ) diff --git a/go.sum b/go.sum index a322af2..de7608a 100644 --- a/go.sum +++ b/go.sum @@ -27,8 +27,6 @@ github.com/grafov/m3u8 v0.11.1 h1:igZ7EBIB2IAsPPazKwRKdbhxcoBKO3lO1UY57PZDeNA= github.com/grafov/m3u8 v0.11.1/go.mod h1:nqzOkfBiZJENr52zTVd/Dcl03yzphIMbJqkXGu+u080= github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec h1:qv2VnGeEQHchGaZ/u7lxST/RaJw+cv273q79D81Xbog= github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec/go.mod h1:Q48J4R4DvxnHolD5P8pOtXigYlRuPLGl6moFx3ulM68= -github.com/itouakirai/mp4ff v0.0.0-20250929054714-77e796d393ee h1:IIMI9QdTGdveHtSy/d1NWLVd42bw4OXBINlwtdgIS9s= -github.com/itouakirai/mp4ff v0.0.0-20250929054714-77e796d393ee/go.mod h1:epcaTcHNf0fgnK8d2MP/gPQNji50kvZa9ZxzX06UOoA= github.com/itouakirai/mp4ff v0.0.0-20250930132656-98812935a1c7 h1:KhMNPs/FW9fsiei6qD8h07ArJqYjvpIjk1zqeyv06Xw= github.com/itouakirai/mp4ff v0.0.0-20250930132656-98812935a1c7/go.mod h1:epcaTcHNf0fgnK8d2MP/gPQNji50kvZa9ZxzX06UOoA= github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213/go.mod h1:vNUNkEQ1e29fT/6vq2aBdFsgNPmy8qMdSay1npru+Sw= @@ -71,8 +69,8 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/zhaarey/go-mp4tag v0.0.0-20250210094042-22578afc09bf h1:WzZoh9wvukQu2We8dw/bFmLfb5XsC5bGGU/Izhd/UOo= -github.com/zhaarey/go-mp4tag v0.0.0-20250210094042-22578afc09bf/go.mod h1:cqL6le//aG0AE1/VE1um2m+8dKa8te/WhHWqzrHMDys= +github.com/zhaarey/go-mp4tag v0.0.0-20251021234435-2c70f6b1bf76 h1:ON+3W/tNJ6Hujez1ITh9cy3RpFUfLg3NKuKb2PJBg8Q= +github.com/zhaarey/go-mp4tag v0.0.0-20251021234435-2c70f6b1bf76/go.mod h1:cqL6le//aG0AE1/VE1um2m+8dKa8te/WhHWqzrHMDys= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= diff --git a/main.go b/main.go index b1dcc38..1f36f5c 100644 --- a/main.go +++ b/main.go @@ -943,9 +943,10 @@ func ripTrack(track *task.Track, token string, mediaUserToken string) { return } } + //这里利用MP4box将fmp4转化为mp4,并添加ilst box与cover,方便后面的mp4tag添加更多自定义标签 tags := []string{ "tool=", - fmt.Sprintf("artist=%s", track.Resp.Attributes.ArtistName), + "artist=AppleMusic", } if Config.EmbedCover { if (strings.Contains(track.PreID, "pl.") || strings.Contains(track.PreID, "ra.")) && Config.DlAlbumcoverForPlaylist {