1
This commit is contained in:
parent
8251a7cce1
commit
211acf690b
10
config.yaml
10
config.yaml
@ -11,12 +11,12 @@ force-api: false
|
||||
get-m3u8-from-device: false
|
||||
alac-max: 192000 #192000 96000 48000 44100
|
||||
atmos-max: 2768 #2768 2448
|
||||
#{AlbumId} {AlbumName} {ArtistName} {ReleaseDate} {ReleaseYear} {UPC} {Copyright} {Quality}
|
||||
#example: {ReleaseYear} - {ArtistName} - {AlbumName}({AlbumId})({UPC})({Copyright})
|
||||
#{AlbumId} {AlbumName} {ArtistName} {ReleaseDate} {ReleaseYear} {UPC} {Copyright} {Quality} {Codec}
|
||||
#example: {ReleaseYear} - {ArtistName} - {AlbumName}({AlbumId})({UPC})({Copyright}){Codec}
|
||||
album-folder-format: "{AlbumName}"
|
||||
#{PlaylistId} {PlaylistName} {ArtistName} {Quality}
|
||||
#{PlaylistId} {PlaylistName} {ArtistName} {Quality} {Codec}
|
||||
playlist-folder-format: "{PlaylistName}"
|
||||
#{SongId} {SongNumer} {SongName} {DiscNumber} {TrackNumber} {Quality}
|
||||
#{SongId} {SongNumer} {SongName} {DiscNumber} {TrackNumber} {Quality} {Codec}
|
||||
#example: Disk {DiscNumber} - Track {TrackNumber} {SongName} [{Quality}]"
|
||||
song-file-format: "{SongNumer}. {SongName}"
|
||||
#{ArtistId} {ArtistName}
|
||||
@ -26,5 +26,3 @@ artist-folder-format: "{ArtistName}"
|
||||
explicit-choice : "[E]"
|
||||
clean-choice : "[C]"
|
||||
apple-master-choice : "[M]"
|
||||
#if set true,Quality will change to [ALAC 24B-96.0kHz] [Atmos 768kbps]
|
||||
add-codec: false
|
||||
|
7
main.go
7
main.go
@ -56,7 +56,6 @@ type Config struct {
|
||||
Check string `yaml:"check"`
|
||||
GetM3u8FromDevice bool `yaml:"get-m3u8-from-device"`
|
||||
AlacMax int `yaml:"alac-max"`
|
||||
AddCodec bool `yaml:"add-codec"`
|
||||
}
|
||||
|
||||
var config Config
|
||||
@ -1200,9 +1199,6 @@ func rip(albumId string, token string, storefront string, userToken string) erro
|
||||
if err != nil {
|
||||
fmt.Println("Failed to extract quality from manifest.\n", err)
|
||||
}
|
||||
if config.AddCodec{
|
||||
Quality=fmt.Sprintf("ALAC %s", Quality)
|
||||
}
|
||||
}
|
||||
var albumFolder string
|
||||
if strings.Contains(albumId, "pl.") {
|
||||
@ -1211,6 +1207,7 @@ func rip(albumId string, token string, storefront string, userToken string) erro
|
||||
"{PlaylistName}", meta.Data[0].Attributes.Name,
|
||||
"{PlaylistId}", albumId,
|
||||
"{Quality}",Quality,
|
||||
"{Codec}", "ALAC",
|
||||
).Replace(config.PlaylistFolderFormat)
|
||||
}else{
|
||||
albumFolder = strings.NewReplacer(
|
||||
@ -1222,6 +1219,7 @@ func rip(albumId string, token string, storefront string, userToken string) erro
|
||||
"{Copyright}", meta.Data[0].Attributes.Copyright,
|
||||
"{AlbumId}", albumId,
|
||||
"{Quality}", Quality,
|
||||
"{Codec}", "ALAC",
|
||||
).Replace(config.AlbumFolderFormat)
|
||||
}
|
||||
if meta.Data[0].Attributes.IsMasteredForItunes{
|
||||
@ -1286,6 +1284,7 @@ func rip(albumId string, token string, storefront string, userToken string) erro
|
||||
"{DiscNumber}", fmt.Sprintf("%0d", track.Attributes.DiscNumber),
|
||||
"{TrackNumber}", fmt.Sprintf("%0d", track.Attributes.TrackNumber),
|
||||
"{Quality}", Quality,
|
||||
"{Codec}", "ALAC",
|
||||
).Replace(config.SongFileFormat)
|
||||
if track.Attributes.IsAppleDigitalMaster{
|
||||
if config.AppleMasterChoice != ""{
|
||||
|
@ -52,7 +52,6 @@ type Config struct {
|
||||
CleanChoice string `yaml:"clean-choice"`
|
||||
AppleMasterChoice string `yaml:"apple-master-choice"`
|
||||
AtmosMax int `yaml:"atmos-max"`
|
||||
AddCodec bool `yaml:"add-codec"`
|
||||
}
|
||||
|
||||
var config Config
|
||||
@ -1145,15 +1144,13 @@ func rip(albumId string, token string, storefront string, userToken string) erro
|
||||
singerFolder := filepath.Join(config.AtmosSaveFolder, forbiddenNames.ReplaceAllString(singerFoldername, "_"))
|
||||
var albumFolder string
|
||||
Quality:=fmt.Sprintf("%dkbps", config.AtmosMax-2000)
|
||||
if config.AddCodec{
|
||||
Quality=fmt.Sprintf("Atmos %dkbps", config.AtmosMax-2000)
|
||||
}
|
||||
if strings.Contains(albumId, "pl.") {
|
||||
albumFolder = strings.NewReplacer(
|
||||
"{ArtistName}", "Apple Music",
|
||||
"{PlaylistName}", meta.Data[0].Attributes.Name,
|
||||
"{PlaylistId}", albumId,
|
||||
"{Quality}",Quality,
|
||||
"{Codec}", "Atmos",
|
||||
).Replace(config.PlaylistFolderFormat)
|
||||
}else{
|
||||
albumFolder = strings.NewReplacer(
|
||||
@ -1165,6 +1162,7 @@ func rip(albumId string, token string, storefront string, userToken string) erro
|
||||
"{Copyright}", meta.Data[0].Attributes.Copyright,
|
||||
"{AlbumId}", albumId,
|
||||
"{Quality}",Quality,
|
||||
"{Codec}", "Atmos",
|
||||
).Replace(config.AlbumFolderFormat)
|
||||
}
|
||||
if meta.Data[0].Attributes.IsMasteredForItunes{
|
||||
@ -1214,6 +1212,7 @@ func rip(albumId string, token string, storefront string, userToken string) erro
|
||||
"{DiscNumber}", string(track.Attributes.DiscNumber),
|
||||
"{TrackNumber}", fmt.Sprintf("%02d", track.Attributes.TrackNumber),
|
||||
"{Quality}",Quality,
|
||||
"{Codec}", "Atmos",
|
||||
).Replace(config.SongFileFormat)
|
||||
if track.Attributes.IsAppleDigitalMaster{
|
||||
if config.AppleMasterChoice != ""{
|
||||
|
@ -52,7 +52,6 @@ type Config struct {
|
||||
ExplicitChoice string `yaml:"explicit-choice"`
|
||||
CleanChoice string `yaml:"clean-choice"`
|
||||
AppleMasterChoice string `yaml:"apple-master-choice"`
|
||||
AlacMax int `yaml:"alac-max"`
|
||||
}
|
||||
|
||||
var config Config
|
||||
@ -1151,7 +1150,8 @@ func rip(albumId string, token string, storefront string, userToken string) erro
|
||||
"{ArtistName}", "Apple Music",
|
||||
"{PlaylistName}", meta.Data[0].Attributes.Name,
|
||||
"{PlaylistId}", albumId,
|
||||
"{Quality}","ALAC",
|
||||
"{Quality}","",
|
||||
"{Codec}", "ALAC",
|
||||
).Replace(config.PlaylistFolderFormat)
|
||||
}else{
|
||||
albumFolder = strings.NewReplacer(
|
||||
@ -1162,7 +1162,8 @@ func rip(albumId string, token string, storefront string, userToken string) erro
|
||||
"{UPC}", meta.Data[0].Attributes.Upc,
|
||||
"{Copyright}", meta.Data[0].Attributes.Copyright,
|
||||
"{AlbumId}", albumId,
|
||||
"{Quality}", "ALAC",
|
||||
"{Quality}", "",
|
||||
"{Codec}", "ALAC",
|
||||
).Replace(config.AlbumFolderFormat)
|
||||
}
|
||||
if meta.Data[0].Attributes.IsMasteredForItunes{
|
||||
@ -1256,6 +1257,7 @@ func rip(albumId string, token string, storefront string, userToken string) erro
|
||||
"{DiscNumber}", string(track.Attributes.DiscNumber),
|
||||
"{TrackNumber}", fmt.Sprintf("%02d", track.Attributes.TrackNumber),
|
||||
"{Quality}","",
|
||||
"{Codec}", "ALAC",
|
||||
).Replace(config.SongFileFormat)
|
||||
if track.Attributes.IsAppleDigitalMaster{
|
||||
if config.AppleMasterChoice != ""{
|
||||
|
Loading…
x
Reference in New Issue
Block a user