|
|
|
@ -4,10 +4,8 @@ import ( |
|
|
|
|
"bytes" |
|
|
|
|
"encoding/binary" |
|
|
|
|
"encoding/json" |
|
|
|
|
"gopkg.in/yaml.v2" |
|
|
|
|
"errors" |
|
|
|
|
"fmt" |
|
|
|
|
"github.com/beevik/etree" |
|
|
|
|
"io" |
|
|
|
|
"io/ioutil" |
|
|
|
|
"math" |
|
|
|
@ -23,6 +21,9 @@ import ( |
|
|
|
|
"strings" |
|
|
|
|
"time" |
|
|
|
|
|
|
|
|
|
"github.com/beevik/etree" |
|
|
|
|
"gopkg.in/yaml.v2" |
|
|
|
|
|
|
|
|
|
"github.com/abema/go-mp4" |
|
|
|
|
"github.com/grafov/m3u8" |
|
|
|
|
) |
|
|
|
@ -35,6 +36,7 @@ const ( |
|
|
|
|
var ( |
|
|
|
|
forbiddenNames = regexp.MustCompile(`[/\\<>:"|?*]`) |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
type Config struct { |
|
|
|
|
MediaUserToken string `yaml:"media-user-token"` |
|
|
|
|
SaveLrcFile bool `yaml:"save-lrc-file"` |
|
|
|
@ -1145,7 +1147,7 @@ func rip(albumId string, token string, storefront string, userToken string) erro |
|
|
|
|
} |
|
|
|
|
singerFolder := filepath.Join(config.AtmosSaveFolder, forbiddenNames.ReplaceAllString(singerFoldername, "_")) |
|
|
|
|
stringsToJoin := []string{} |
|
|
|
|
if meta.Data[0].Attributes.IsAppleDigitalMaster{ |
|
|
|
|
if meta.Data[0].Attributes.IsAppleDigitalMaster || meta.Data[0].Attributes.IsMasteredForItunes { |
|
|
|
|
if config.AppleMasterChoice != "" { |
|
|
|
|
stringsToJoin = append(stringsToJoin, config.AppleMasterChoice) |
|
|
|
|
} |
|
|
|
@ -1179,7 +1181,6 @@ func rip(albumId string, token string, storefront string, userToken string) erro |
|
|
|
|
"{ArtistName}", meta.Data[0].Attributes.ArtistName, |
|
|
|
|
"{AlbumName}", meta.Data[0].Attributes.Name, |
|
|
|
|
"{UPC}", meta.Data[0].Attributes.Upc, |
|
|
|
|
"{RecordLabel}", meta.Data[0].Attributes.RecordLabel, |
|
|
|
|
"{Copyright}", meta.Data[0].Attributes.Copyright, |
|
|
|
|
"{AlbumId}", albumId, |
|
|
|
|
"{Quality}", Quality, |
|
|
|
|