Files
zurg/pkg/utils/bwlimit.go
Ben Adrian Sarmiento f8f31b3b67 Catch nil on error
2024-06-28 19:55:15 +02:00

15 lines
352 B
Go

package utils
import "github.com/debridmediamanager/zurg/pkg/http"
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 != nil && err.Error() == "all tokens are expired"
}