Skip to content

Commit d91bdd8

Browse files
authored
Merge pull request #158 from AbelLin1214/master
修复#155 提到的must login错误
2 parents d345c9d + e2de2ea commit d91bdd8

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,13 @@ Cookie信息请勿直接 `document.cookie`,可能因为http-only 选项无法
161161

162162
![image-20230722194839975](./README/image-20230722194839975.png)
163163

164+
165+
**TYC auth_token**
166+
167+
配置COOKIE后配置auth_token
168+
169+
![image-20250215132223242](./README/image-20250215132223242.jpg)
170+
164171
其他Cookie请自行参考获取
165172

166173

README/image-20250215132223242.jpg

126 KB
Loading

common/config.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ package common
22

33
import (
44
"fmt"
5+
"path/filepath"
6+
"time"
7+
58
"github.com/tidwall/gjson"
69
"github.com/wgpsec/ENScan/common/utils"
710
"go.mongodb.org/mongo-driver/bson/primitive"
8-
"path/filepath"
9-
"time"
1011
)
1112

1213
var (
@@ -143,6 +144,7 @@ type ENConfig struct {
143144
KuaiCha string `yaml:"kuaicha"`
144145
Tianyancha string `yaml:"tianyancha"`
145146
Tycid string `yaml:"tycid"`
147+
AuthToken string `yaml:"auth_token"`
146148
QiMai string `yaml:"qimai"`
147149
}
148150
App struct {

internal/tianyancha/bean.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@ package tianyancha
33
import (
44
"crypto/tls"
55
"fmt"
6+
"regexp"
7+
"strings"
8+
"time"
9+
610
"github.com/antchfx/htmlquery"
711
"github.com/imroc/req/v3"
812
"github.com/robertkrimen/otto"
913
"github.com/wgpsec/ENScan/common"
1014
"github.com/wgpsec/ENScan/common/gologger"
1115
"golang.org/x/net/html"
12-
"regexp"
13-
"strings"
14-
"time"
1516
)
1617

1718
func getENMap() map[string]*common.EnsGo {
@@ -144,7 +145,7 @@ func GetReq(url string, data string, options *common.ENOptions) string {
144145
clientR.SetHeader("Content-Type", "application/json")
145146
//client.Header.Del("Cookie")
146147
clientR.SetHeader("X-Tycid", options.ENConfig.Cookies.Tycid)
147-
//client.Header.Set("X-Auth-Token", "")
148+
clientR.SetHeader("X-Auth-Token", options.ENConfig.Cookies.AuthToken)
148149
}
149150
//加延迟1S
150151
//强制延时1s

0 commit comments

Comments
 (0)