initial commit
This commit is contained in:
39
main.go
Normal file
39
main.go
Normal file
@ -0,0 +1,39 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
"time"
|
||||
|
||||
"git.tordarus.net/nyaanime/logic"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// check for ffmpeg in PATH
|
||||
if _, err := exec.LookPath("ffmpeg"); err != nil {
|
||||
panic(err) // TODO error handling
|
||||
}
|
||||
|
||||
// check for ffprobe in PATH
|
||||
if _, err := exec.LookPath("ffprobe"); err != nil {
|
||||
panic(err) // TODO error handling
|
||||
}
|
||||
|
||||
// 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) // TODO error handling
|
||||
}
|
||||
|
||||
if err := InitTelegramBot(); err != nil {
|
||||
panic(err) // TODO error handling
|
||||
}
|
||||
|
||||
logic.PrintPriorityTables()
|
||||
|
||||
ticker := time.NewTicker(PollRate)
|
||||
defer ticker.Stop()
|
||||
|
||||
CheckTorrents()
|
||||
for range ticker.C {
|
||||
CheckTorrents()
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user