Skip to content

Commit

Permalink
fix: fix type bug
Browse files Browse the repository at this point in the history
  • Loading branch information
aurorax-neo committed Apr 4, 2024
1 parent 94524f4 commit 1f8c102
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,23 @@ module aurora
go 1.21

require (
github.com/EDDYCJY/fake-useragent v0.2.0
github.com/acheong08/endless v0.0.0-20230615162514-90545c7793fd
github.com/aurorax-neo/go-logger v0.0.0-20240331061645-18b054649449
github.com/bogdanfinn/fhttp v0.5.24
github.com/bogdanfinn/tls-client v1.6.1
github.com/gin-gonic/gin v1.9.1
github.com/go-resty/resty/v2 v2.12.0
github.com/google/uuid v1.6.0
github.com/gorilla/websocket v1.5.1
github.com/joho/godotenv v1.5.1
github.com/xqdoo00o/funcaptcha v0.0.0-20240313153914-4ab805804232
)

require (
github.com/EDDYCJY/fake-useragent v0.2.0 // indirect
github.com/PuerkitoBio/goquery v1.9.1 // indirect
github.com/andybalholm/brotli v1.0.5 // indirect
github.com/andybalholm/cascadia v1.3.2 // indirect
github.com/aurorax-neo/go-logger v0.0.0-20240331061645-18b054649449 // indirect
github.com/bogdanfinn/utls v1.5.16 // indirect
github.com/bytedance/sonic v1.10.1 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect
Expand All @@ -28,7 +29,6 @@ require (
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.15.4 // indirect
github.com/go-resty/resty/v2 v2.12.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/json-iterator/go v1.1.12 // indirect
Expand Down
6 changes: 3 additions & 3 deletions internal/chatgpt/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ func GETTokenForRefreshToken(refresh_token string, proxy string) (interface{}, i
return nil, 0, err
}

req, _ := http.NewRequest("POST", url, bytes.NewBuffer(reqBody))
req, _ := fhttp.NewRequest("POST", url, bytes.NewBuffer(reqBody))
req.Header.Set("authority", "auth0.openai.com")
req.Header.Add("Accept-Language", "en-US,en;q=0.9")
req.Header.Set("Content-Type", "application/json")
Expand All @@ -776,7 +776,7 @@ func GETTokenForSessionToken(session_token string, proxy string) (interface{}, i
client.SetProxy(proxy)
}
url := "https://chat.openai.com/api/auth/session"
req, _ := http.NewRequest("GET", url, nil)
req, _ := fhttp.NewRequest("GET", url, nil)
req.Header.Set("authority", "chat.openai.com")
req.Header.Set("accept-language", "zh-CN,zh;q=0.9")
req.Header.Set("User-Agent", userAgent)
Expand All @@ -801,7 +801,7 @@ func GETTokenForSessionToken(session_token string, proxy string) (interface{}, i
return openai_sessionToken, resp.StatusCode, nil
}

func parseCookies(cookies []*http.Cookie) map[string]string {
func parseCookies(cookies []*fhttp.Cookie) map[string]string {
cookieDict := make(map[string]string)
for _, cookie := range cookies {
cookieDict[cookie.Name] = cookie.Value
Expand Down

0 comments on commit 1f8c102

Please sign in to comment.