initial commit

This commit is contained in:
2025-06-06 16:45:59 +02:00
commit 8dccbf25b8
18 changed files with 835 additions and 0 deletions

39
main.go Normal file
View 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()
}
}