fix apple master tag
This commit is contained in:
parent
5f528e76a9
commit
fa02c77ff8
7
main.go
7
main.go
@ -5,7 +5,6 @@ import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"encoding/json"
|
||||
"gopkg.in/yaml.v2"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
@ -23,6 +22,8 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"gopkg.in/yaml.v2"
|
||||
|
||||
"github.com/abema/go-mp4"
|
||||
"github.com/beevik/etree"
|
||||
"github.com/grafov/m3u8"
|
||||
@ -36,6 +37,7 @@ const (
|
||||
var (
|
||||
forbiddenNames = regexp.MustCompile(`[/\\<>:"|?*]`)
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
MediaUserToken string `yaml:"media-user-token"`
|
||||
SaveLrcFile bool `yaml:"save-lrc-file"`
|
||||
@ -76,6 +78,7 @@ type SongInfo struct {
|
||||
alacParam *Alac
|
||||
samples []SampleInfo
|
||||
}
|
||||
|
||||
func loadConfig() error {
|
||||
// 读取config.yaml文件内容
|
||||
data, err := ioutil.ReadFile("config.yaml")
|
||||
@ -1217,7 +1220,7 @@ func rip(albumId string, token string, storefront string, userToken string) erro
|
||||
}
|
||||
}
|
||||
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)
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -5,10 +5,8 @@ import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"encoding/json"
|
||||
"gopkg.in/yaml.v2"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/beevik/etree"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"math"
|
||||
@ -24,6 +22,9 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/beevik/etree"
|
||||
"gopkg.in/yaml.v2"
|
||||
|
||||
"github.com/abema/go-mp4"
|
||||
"github.com/grafov/m3u8"
|
||||
)
|
||||
@ -36,6 +37,7 @@ const (
|
||||
var (
|
||||
forbiddenNames = regexp.MustCompile(`[/\\<>:"|?*]`)
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
MediaUserToken string `yaml:"media-user-token"`
|
||||
SaveLrcFile bool `yaml:"save-lrc-file"`
|
||||
@ -1203,7 +1205,7 @@ func rip(albumId string, token string, storefront string, userToken string) erro
|
||||
}
|
||||
singerFolder := filepath.Join(config.AlacSaveFolder, 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)
|
||||
}
|
||||
@ -1250,7 +1252,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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user