commit
42ca991329
@ -44,3 +44,4 @@ use-songinfo-for-playlist: false
|
|||||||
dl-albumcover-for-playlist: false
|
dl-albumcover-for-playlist: false
|
||||||
mv-audio-type: atmos #atmos ac3 aac
|
mv-audio-type: atmos #atmos ac3 aac
|
||||||
mv-max: 2160
|
mv-max: 2160
|
||||||
|
save-thumbnail-image: false #true or false of thumbnail image
|
18
main.go
18
main.go
@ -1440,6 +1440,24 @@ func mvDownloader(adamID string, saveDir string, token string, storefront string
|
|||||||
defer os.Remove(vidPath)
|
defer os.Remove(vidPath)
|
||||||
defer os.Remove(audPath)
|
defer os.Remove(audPath)
|
||||||
|
|
||||||
|
// Extract and save thumbnail if enabled
|
||||||
|
if Config.SaveThumbnailImage {
|
||||||
|
// Get the highest quality thumbnail URL from the MV info
|
||||||
|
thumbURL := MVInfo.Data[0].Attributes.Artwork.URL
|
||||||
|
thumbURL = strings.Replace(thumbURL, "{w}x{h}", Config.CoverSize, 1)
|
||||||
|
|
||||||
|
// Generate base name without extension
|
||||||
|
baseThumbName := forbiddenNames.ReplaceAllString(mvSaveName, "_") + "_thumbnail"
|
||||||
|
|
||||||
|
// Download and save thumbnail
|
||||||
|
err = writeCover(saveDir, baseThumbName, thumbURL)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Failed to save MV thumbnail:", err)
|
||||||
|
} else {
|
||||||
|
fmt.Println("MV thumbnail saved successfully")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,6 +36,7 @@ type ConfigSet struct {
|
|||||||
DlAlbumcoverForPlaylist bool `yaml:"dl-albumcover-for-playlist"`
|
DlAlbumcoverForPlaylist bool `yaml:"dl-albumcover-for-playlist"`
|
||||||
MVAudioType string `yaml:"mv-audio-type"`
|
MVAudioType string `yaml:"mv-audio-type"`
|
||||||
MVMax int `yaml:"mv-max"`
|
MVMax int `yaml:"mv-max"`
|
||||||
|
SaveThumbnailImage bool `yaml:"save-thumbnail-image"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Counter struct {
|
type Counter struct {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user