Skip to content

Commit

Permalink
Netflix does not detect US nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
lizenghui committed Nov 23, 2022
1 parent 8c742f8 commit af0d41e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: v0.1.1
tag_name: v0.1.2
files:
check

Expand Down
38 changes: 20 additions & 18 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,7 @@ func main() {
for node, server := range nodes {

var (
unblock bool
res string
res string
)

if server.Type() != constant.Shadowsocks && server.Type() != constant.ShadowsocksR && server.Type() != constant.Snell && server.Type() != constant.Socks5 && server.Type() != constant.Http && server.Type() != constant.Vmess && server.Type() != constant.Trojan {
Expand All @@ -190,26 +189,29 @@ func main() {
ip := getIpInfo()
str := fmt.Sprintf("%d.node: %s", index, node)

// if ip == "Error" {
// continue
// }
re := regexp.MustCompile("美|波特兰|达拉斯|俄勒冈|凤凰城|费利蒙|硅谷|拉斯维加斯|洛杉矶|圣何塞|圣克拉拉|西雅图|芝加哥|US|United States")

//Netflix检测
if ctype == "0" {
if re.MatchString(node) {
res += "\tyoutube:" + youtube_premium()
} else {
res += "\t"
}

if ctype == "0" && !re.MatchString(node) {
vs := validator.NewVerify(proxy_url)
res = "\tnetflix:" + vs.Netflix()

} else {
unblock = true
if unblock {
res += "\tgoogle:" + google()

re := regexp.MustCompile("美|波特兰|达拉斯|俄勒冈|凤凰城|费利蒙|硅谷|拉斯维加斯|洛杉矶|圣何塞|圣克拉拉|西雅图|芝加哥|US|United States")
if re.MatchString(node) {
res += "\tyoutube:" + youtube_premium()
} else {
res += "\t"
}
continue
}

if ctype == "1" {

res += "\tgoogle:" + google()

if re.MatchString(node) {
res += "\tyoutube:" + youtube_premium()
} else {
res += "\t"
}
}
logger.Printf("%s%s\t%s\n", str, res, ip)
Expand Down
3 changes: 1 addition & 2 deletions validator/verify.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package validator

import (
"fmt"
"io"
"net/http"
"net/url"
Expand Down Expand Up @@ -61,7 +60,7 @@ func (vs *Ver) Netflix() string {
} else if resp.StatusCode == 200 {
return "Y"
} else {
fmt.Println(resp)
// fmt.Println(resp)
return "unknow"
}

Expand Down

0 comments on commit af0d41e

Please sign in to comment.