Add job for monitoring bw limit status of tokens

This commit is contained in:
Ben Adrian Sarmiento
2024-06-28 18:55:02 +02:00
parent c3aea427d0
commit 67111696a2
13 changed files with 136 additions and 55 deletions

View File

@@ -2,9 +2,13 @@ package utils
import "github.com/debridmediamanager/zurg/pkg/http"
func IsBWLimitExceeded(err error) bool {
func IsBytesLimitReached(err error) bool {
if dlErr, ok := err.(*http.DownloadErrorResponse); ok && dlErr.Message == "bytes_limit_reached" {
return true
}
return false
}
func AreAllTokensExpired(err error) bool {
return err.Error() == "all tokens are expired"
}