downloader/main.go

30 lines
615 B
Go

package main
import (
"fmt"
"time"
"git.milar.in/nyaanime/logic"
)
func main() {
fmt.Println("generated priority values:")
fmt.Print(Map2Table("language", logic.PreferredLanguages))
fmt.Print(Map2Table("subtitle", logic.PreferredSubtitles))
fmt.Print(Map2Table("resolution", logic.PreferredResolutions))
fmt.Println()
// get access token once at startup to be sure that an access token is obtainable at all
if _, err := logic.GetAnilistAccessToken(); err != nil {
panic(err)
}
ticker := time.NewTicker(PollRate)
defer ticker.Stop()
CheckTorrents()
for range ticker.C {
CheckTorrents()
}
}