Add job for monitoring bw limit status of tokens
This commit is contained in:
@@ -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"
|
||||
}
|
||||
|
||||
7
pkg/utils/mask_token.go
Normal file
7
pkg/utils/mask_token.go
Normal file
@@ -0,0 +1,7 @@
|
||||
package utils
|
||||
|
||||
import "strings"
|
||||
|
||||
func MaskToken(token string) string {
|
||||
return strings.Repeat("*", len(token)-4) + token[len(token)-4:]
|
||||
}
|
||||
Reference in New Issue
Block a user