Skip to content

Commit 98c6664

Browse files
committed
修复查询list bug fix #197
1 parent a43e58a commit 98c6664

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

internal/tianyancha/bean.go

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
package tianyancha
22

33
import (
4+
"strings"
5+
"time"
6+
47
"github.com/antchfx/htmlquery"
58
"github.com/wgpsec/ENScan/common"
69
"github.com/wgpsec/ENScan/common/gologger"
710
"golang.org/x/net/html"
8-
"strings"
9-
"time"
1011
)
1112

1213
func getENMap() map[string]*common.EnsGo {
@@ -150,6 +151,11 @@ func (h *TYC) req(url string, data string) string {
150151
if strings.Contains(resp.String(), "\"message\":\"mustlogin\"") {
151152
gologger.Error().Msgf("【TYC】需要登陆后尝试")
152153
}
154+
if strings.Contains(resp.String(), "账号存在风险") {
155+
gologger.Error().Msgf("【TYC】账号存在风险需要认证,打开页面查看是否有提示人机验证,程序将在10秒后重试 %s \n", url)
156+
time.Sleep(10 * time.Second)
157+
return h.req(url, data)
158+
}
153159
return resp.String()
154160
} else if resp.StatusCode == 403 {
155161
gologger.Error().Msgf("【TYC】ip被禁止访问网站,请更换ip\n")
@@ -163,10 +169,14 @@ func (h *TYC) req(url string, data string) string {
163169
gologger.Error().Msgf("【TYC】429请求被拦截,清打开链接滑动验证码,程序将在10秒后重试 %s \n", url)
164170
time.Sleep(10 * time.Second)
165171
return h.req(url, data)
172+
} else if resp.StatusCode == 433 {
173+
gologger.Error().Msgf("【TYC】433账号存在风险需要认证,打开页面查看是否有提示人机验证,程序将在10秒后重试 %s \n", url)
174+
time.Sleep(10 * time.Second)
175+
return h.req(url, data)
166176
} else {
167-
gologger.Error().Msgf("【TYC】未知错误 %s\n", resp.StatusCode)
168-
gologger.Debug().Msgf("【TYC】\nURL:%s\nDATA:%s\n", url, data)
169-
gologger.Debug().Msgf("【TYC】\n%s\n", resp.String())
177+
gologger.Error().Msgf("【TYC】未知状态码:【%d】\n提交报错信息请打开DEBUG模式提交数据包\n", resp.StatusCode)
178+
gologger.Debug().Msgf("【TYC】URL:%s\nDATA:%s\n", url, data)
179+
gologger.Debug().Msgf("【TYC】\n返回数据包信息:%s\n", resp.String())
170180
}
171181
return ""
172182
}

0 commit comments

Comments
 (0)