Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
spiritLHLS committed Jun 22, 2024
1 parent b7fee55 commit 19ceea9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
5 changes: 3 additions & 2 deletions au/Binge.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package au

import (
"fmt"
"net/http"

"github.com/oneclickvirt/UnlockTests/model"
"github.com/oneclickvirt/UnlockTests/utils"
"net/http"
)

// Binge
Expand All @@ -30,7 +31,7 @@ func Binge(c *http.Client) model.Result {
if resp.StatusCode == 403 || resp.StatusCode == 451 {
return model.Result{Name: name, Status: model.StatusNo}
}
if resp.StatusCode == 302 {
if resp.StatusCode == 302 || resp.StatusCode == 200 {
return model.Result{Name: name, Status: model.StatusYes}
}
return model.Result{Name: name, Status: model.StatusUnexpected,
Expand Down
19 changes: 11 additions & 8 deletions au/Channel9.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ package au

import (
"fmt"
"io"
"net/http"
"strings"

"github.com/oneclickvirt/UnlockTests/model"
"github.com/oneclickvirt/UnlockTests/utils"
"net/http"
)

// Channel9
Expand All @@ -21,15 +24,15 @@ func Channel9(c *http.Client) model.Result {
return model.Result{Name: name, Status: model.StatusNetworkErr, Err: err}
}
defer resp.Body.Close()
//b, err := io.ReadAll(resp.Body)
//if err != nil {
// return model.Result{Name: name, Status: model.StatusNetworkErr, Err: fmt.Errorf("can not parse body")}
//}
//body := string(b)
b, err := io.ReadAll(resp.Body)
if err != nil {
return model.Result{Name: name, Status: model.StatusNetworkErr, Err: fmt.Errorf("can not parse body")}
}
body := string(b)
//fmt.Println(body)
if resp.StatusCode == 403 {
if strings.Contains(body, "Geoblock") || resp.StatusCode == 403 {
return model.Result{Name: name, Status: model.StatusNo}
} else if resp.StatusCode == 302 {
} else if strings.Contains(body, "Log in to") || resp.StatusCode == 302 {
return model.Result{Name: name, Status: model.StatusYes}
}
return model.Result{Name: name, Status: model.StatusUnexpected,
Expand Down

0 comments on commit 19ceea9

Please sign in to comment.