2018-03-11 01:10:49 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
2019-04-23 05:45:17 +00:00
|
|
|
"github.com/akyoto/color"
|
2019-06-03 09:32:43 +00:00
|
|
|
"github.com/animenotifier/notify.moe/arn"
|
2018-03-11 01:10:49 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
color.Yellow("Downloading soundtracks")
|
2018-03-28 22:26:19 +00:00
|
|
|
|
|
|
|
defer color.Green("Finished.")
|
2018-03-11 01:10:49 +00:00
|
|
|
defer arn.Node.Close()
|
|
|
|
|
|
|
|
for track := range arn.StreamSoundTracks() {
|
2018-03-11 01:29:46 +00:00
|
|
|
if track.IsDraft {
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
|
2018-10-10 18:31:41 +00:00
|
|
|
fmt.Println("--------------------------------------------------------------------------------")
|
2018-03-11 01:20:30 +00:00
|
|
|
fmt.Println(track.Title)
|
2018-03-11 01:10:49 +00:00
|
|
|
|
|
|
|
err := track.Download()
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
color.Red(err.Error())
|
|
|
|
continue
|
2018-10-10 18:31:41 +00:00
|
|
|
} else {
|
|
|
|
color.Green("Downloaded %s!", track.File)
|
2018-03-11 01:10:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Save the file information
|
|
|
|
track.Save()
|
|
|
|
}
|
|
|
|
}
|