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 19ceea9 commit ef12b41
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 21 deletions.
7 changes: 4 additions & 3 deletions us/DirecTVGO.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package us

import (
"fmt"
"github.com/oneclickvirt/UnlockTests/model"
"github.com/oneclickvirt/UnlockTests/utils"
"io"
"net/http"
"strings"

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

// DirecTVGO
Expand All @@ -28,7 +29,7 @@ func DirecTVGO(c *http.Client) model.Result {
return model.Result{Name: name, Status: model.StatusNetworkErr, Err: err}
}
body := string(b)
if strings.Contains(body, "proximamente") || resp.StatusCode == 403 {
if strings.Contains(body, "proximamente") || resp.StatusCode == 403 || resp.StatusCode == 404 {
return model.Result{Name: name, Status: model.StatusNo}
} else if resp.StatusCode == 200 {
parts := strings.Split(body, "/")
Expand Down
12 changes: 7 additions & 5 deletions us/ESPNPlus.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ package us
import (
"encoding/json"
"fmt"
"github.com/oneclickvirt/UnlockTests/model"
"github.com/oneclickvirt/UnlockTests/utils"
"io"
"net/http"
"net/url"
"strings"

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

// ESPNPlus
// espn.api.edge.bamgrid.com 双栈 且 post 请求 可能 有 cloudflare 的5秒盾
// espn.api.edge.bamgrid.com 双栈 且 post 请求
func ESPNPlus(c *http.Client) model.Result {
name := "ESPN+"
if c == nil {
Expand Down Expand Up @@ -81,6 +82,7 @@ func ESPNPlus(c *http.Client) model.Result {
if res2.Extensions.Sdk.Session.Location.CountryCode == "US" && res2.Extensions.Sdk.Session.InSupportedLocation {
return model.Result{Name: name, Status: model.StatusYes}
}
return model.Result{Name: name, Status: model.StatusUnexpected,
Err: fmt.Errorf("get espn.api.edge.bamgrid.com failed with code: %d", resp.StatusCode)}
return model.Result{Name: name, Status: model.StatusNo}
// return model.Result{Name: name, Status: model.StatusUnexpected,
// Err: fmt.Errorf("get espn.api.edge.bamgrid.com failed with code: %d", resp.StatusCode)}
}
20 changes: 13 additions & 7 deletions us/Funimation.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package us

import (
"fmt"
"net/http"

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

// Funimation
Expand All @@ -21,19 +22,24 @@ func Funimation(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)
if resp.StatusCode == 403 {
// 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 || resp.StatusCode == 400 {
return model.Result{Name: name, Status: model.StatusNo}
}
// fmt.Println(resp.Request.Cookies)
for _, ck := range resp.Request.Cookies {
if ck.Name == "region" {
return model.Result{Name: name, Status: model.StatusYes, Region: ck.Value}
}
}
if resp.StatusCode == 200 {
return model.Result{Name: name, Status: model.StatusYes}
}
return model.Result{Name: name, Status: model.StatusUnexpected,
Err: fmt.Errorf("get www.crunchyroll.com failed with code: %d", resp.StatusCode)}
}
10 changes: 6 additions & 4 deletions us/Hulu.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package us

import (
"fmt"
"github.com/oneclickvirt/UnlockTests/model"
"github.com/oneclickvirt/UnlockTests/utils"
"io"
"net/http"
"strings"

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

// Hulu
Expand Down Expand Up @@ -85,6 +86,7 @@ func Hulu(c *http.Client) model.Result {
return model.Result{Name: name, Status: model.StatusYes}
}
}
return model.Result{Name: name, Status: model.StatusUnexpected,
Err: fmt.Errorf("get www.hulu.com failed with code: %d", resp.StatusCode)}
return model.Result{Name: name, Status: model.StatusNo}
// return model.Result{Name: name, Status: model.StatusUnexpected,
// Err: fmt.Errorf("get www.hulu.com failed with code: %d", resp.StatusCode)}
}
5 changes: 3 additions & 2 deletions us/Popcornflix.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package us

import (
"fmt"
"net/http"

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

// Popcornflix
Expand All @@ -26,7 +27,7 @@ func Popcornflix(c *http.Client) model.Result {
// return model.Result{Name: name, Status: model.StatusNetworkErr, Err: fmt.Errorf("can not parse body")}
//}
//body := string(b)
if resp.StatusCode == 403 || resp.StatusCode == 451 {
if resp.StatusCode == 403 || resp.StatusCode == 451 || resp.StatusCode == 400 {
return model.Result{Name: name, Status: model.StatusNo}
} else if resp.StatusCode == 200 {
return model.Result{Name: name, Status: model.StatusYes}
Expand Down

0 comments on commit ef12b41

Please sign in to comment.