fix Quality
This commit is contained in:
parent
ab9f035019
commit
1cdf29cebc
32
main.go
32
main.go
@ -45,7 +45,7 @@ type Config struct {
|
||||
EmbyAnimatedArtwork bool `yaml:"emby-animated-artwork"`
|
||||
EmbedLrc bool `yaml:"embed-lrc"`
|
||||
EmbedCover bool `yaml:"embed-cover"`
|
||||
SaveArtistCover bool `yaml:"save-artist-cover"`
|
||||
SaveArtistCover bool `yaml:"save-artist-cover"`
|
||||
CoverSize string `yaml:"cover-size"`
|
||||
CoverFormat string `yaml:"cover-format"`
|
||||
AlacSaveFolder string `yaml:"alac-save-folder"`
|
||||
@ -1334,22 +1334,24 @@ func rip(albumId string, token string, storefront string, userToken string) erro
|
||||
fmt.Println(singerFoldername)
|
||||
}
|
||||
singerFolder := filepath.Join(config.AlacSaveFolder, forbiddenNames.ReplaceAllString(singerFoldername, "_"))
|
||||
manifest1, err := getInfoFromAdam(meta.Data[0].Relationships.Tracks.Data[0].ID, token, storefront)
|
||||
if err != nil {
|
||||
fmt.Println("Failed to get manifest.\n", err)
|
||||
}
|
||||
if manifest1.Attributes.ExtendedAssetUrls.EnhancedHls == "" {
|
||||
fmt.Println("Unavailable in ALAC.")
|
||||
}
|
||||
var Quality string
|
||||
EnhancedHls_m3u8, err := checkM3u8(meta.Data[0].Relationships.Tracks.Data[0].ID, "album")
|
||||
if strings.HasPrefix(EnhancedHls_m3u8, "http") {
|
||||
manifest1.Attributes.ExtendedAssetUrls.EnhancedHls = EnhancedHls_m3u8
|
||||
}
|
||||
if strings.Contains(config.AlbumFolderFormat, "Quality") {
|
||||
Quality, err = extractMediaQuality(manifest1.Attributes.ExtendedAssetUrls.EnhancedHls)
|
||||
manifest1, err := getInfoFromAdam(meta.Data[0].Relationships.Tracks.Data[0].ID, token, storefront)
|
||||
if err != nil {
|
||||
fmt.Println("Failed to extract quality from manifest.\n", err)
|
||||
fmt.Println("Failed to get manifest.\n", err)
|
||||
} else {
|
||||
if manifest1.Attributes.ExtendedAssetUrls.EnhancedHls == "" {
|
||||
fmt.Println("Unavailable in ALAC.\n")
|
||||
} else {
|
||||
EnhancedHls_m3u8, err := checkM3u8(meta.Data[0].Relationships.Tracks.Data[0].ID, "album")
|
||||
if strings.HasPrefix(EnhancedHls_m3u8, "http") {
|
||||
manifest1.Attributes.ExtendedAssetUrls.EnhancedHls = EnhancedHls_m3u8
|
||||
}
|
||||
Quality, err = extractMediaQuality(manifest1.Attributes.ExtendedAssetUrls.EnhancedHls)
|
||||
if err != nil {
|
||||
fmt.Println("Failed to extract quality from manifest.\n", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stringsToJoin := []string{}
|
||||
@ -2420,7 +2422,7 @@ type AutoGenerated struct {
|
||||
Type string `json:"type"`
|
||||
Href string `json:"href"`
|
||||
Attributes struct {
|
||||
Name string `json:"name"`
|
||||
Name string `json:"name"`
|
||||
Artwork struct {
|
||||
Url string `json:"url"`
|
||||
} `json:"artwork"`
|
||||
|
@ -45,7 +45,7 @@ type Config struct {
|
||||
EmbyAnimatedArtwork bool `yaml:"emby-animated-artwork"`
|
||||
EmbedLrc bool `yaml:"embed-lrc"`
|
||||
EmbedCover bool `yaml:"embed-cover"`
|
||||
SaveArtistCover bool `yaml:"save-artist-cover"`
|
||||
SaveArtistCover bool `yaml:"save-artist-cover"`
|
||||
CoverSize string `yaml:"cover-size"`
|
||||
CoverFormat string `yaml:"cover-format"`
|
||||
AlacSaveFolder string `yaml:"alac-save-folder"`
|
||||
@ -1232,18 +1232,20 @@ func rip(albumId string, token string, storefront string, userToken string) erro
|
||||
}
|
||||
}
|
||||
Tag_string := strings.Join(stringsToJoin, " ")
|
||||
manifest1, err := getInfoFromAdam(meta.Data[0].Relationships.Tracks.Data[0].ID, token, storefront)
|
||||
if err != nil {
|
||||
fmt.Println("Failed to get manifest.\n", err)
|
||||
}
|
||||
if manifest1.Attributes.ExtendedAssetUrls.EnhancedHls == "" {
|
||||
fmt.Println("Unavailable in ALAC.")
|
||||
}
|
||||
var Quality string
|
||||
if strings.Contains(config.AlbumFolderFormat, "Quality") {
|
||||
Quality, err = extractMediaQuality(manifest1.Attributes.ExtendedAssetUrls.EnhancedHls)
|
||||
manifest1, err := getInfoFromAdam(meta.Data[0].Relationships.Tracks.Data[0].ID, token, storefront)
|
||||
if err != nil {
|
||||
fmt.Println("Failed to extract quality from manifest.\n", err)
|
||||
fmt.Println("Failed to get manifest.\n", err)
|
||||
} else {
|
||||
if manifest1.Attributes.ExtendedAssetUrls.EnhancedHls == "" {
|
||||
fmt.Println("Unavailable in ALAC.\n")
|
||||
} else {
|
||||
Quality, err = extractMediaQuality(manifest1.Attributes.ExtendedAssetUrls.EnhancedHls)
|
||||
if err != nil {
|
||||
fmt.Println("Failed to extract quality from manifest.\n", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var albumFolder string
|
||||
@ -2217,7 +2219,7 @@ type AutoGenerated struct {
|
||||
ID string `json:"id"`
|
||||
Kind string `json:"kind"`
|
||||
} `json:"playParams"`
|
||||
IsCompilation bool `json:"isCompilation"`
|
||||
IsCompilation bool `json:"isCompilation"`
|
||||
EditorialVideo struct {
|
||||
MotionDetailSquare struct {
|
||||
Video string `json:"video"`
|
||||
@ -2239,7 +2241,7 @@ type AutoGenerated struct {
|
||||
Type string `json:"type"`
|
||||
Href string `json:"href"`
|
||||
Attributes struct {
|
||||
Name string `json:"name"`
|
||||
Name string `json:"name"`
|
||||
Artwork struct {
|
||||
Url string `json:"url"`
|
||||
} `json:"artwork"`
|
||||
|
Loading…
x
Reference in New Issue
Block a user