37 lines
610 B
Go
Raw Normal View History

2018-03-11 02:10:49 +01:00
package main
import (
"fmt"
"github.com/animenotifier/arn"
"github.com/fatih/color"
)
func main() {
color.Yellow("Downloading soundtracks")
2018-03-29 00:26:19 +02:00
defer color.Green("Finished.")
2018-03-11 02:10:49 +01:00
defer arn.Node.Close()
for track := range arn.StreamSoundTracks() {
2018-03-11 02:29:46 +01:00
if track.IsDraft {
continue
}
2018-10-11 03:31:41 +09:00
fmt.Println("--------------------------------------------------------------------------------")
2018-03-11 02:20:30 +01:00
fmt.Println(track.Title)
2018-03-11 02:10:49 +01:00
err := track.Download()
if err != nil {
color.Red(err.Error())
continue
2018-10-11 03:31:41 +09:00
} else {
color.Green("Downloaded %s!", track.File)
2018-03-11 02:10:49 +01:00
}
// Save the file information
track.Save()
}
}