Skip to content

Commit

Permalink
FIX 403
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaozhou26 committed Aug 21, 2024
1 parent 3fd0729 commit c6316cf
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GHCR_PAT }}
with:
tag_name: v2.2.4
tag_name: v2.2.5
files: |
aurora-linux-amd64.tar.gz
aurora-linux-arm64.tar.gz
Expand Down
2 changes: 1 addition & 1 deletion httpclient/bogdanfinn/tls_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func NewStdClient() *TlsClient {
client, _ := tls_client.NewHttpClient(tls_client.NewNoopLogger(), []tls_client.HttpClientOption{
tls_client.WithCookieJar(tls_client.NewCookieJar()),
tls_client.WithTimeoutSeconds(600),
tls_client.WithClientProfile(profiles.Chrome_103),
tls_client.WithClientProfile(profiles.Safari_IOS_15_5),
}...)

stdClient := &TlsClient{Client: client}
Expand Down
8 changes: 4 additions & 4 deletions httpclient/bogdanfinn/tls_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ func init() {
_ = godotenv.Load(".env")
BaseURL = os.Getenv("BASE_URL")
if BaseURL == "" {
BaseURL = "https://chatgpt.com/backend-anon"
BaseURL = "https://chatgpt.com/backend-api"
}
}
func TestTlsClient_Request(t *testing.T) {
client := NewStdClient()
userAgent := "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36"
userAgent := "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36"
proxy := "http://127.0.0.1:7990"
client.SetProxy(proxy)

Expand Down Expand Up @@ -57,8 +57,8 @@ func TestTlsClient_Request(t *testing.T) {

func TestChatGPTModel(t *testing.T) {
client := NewStdClient()
userAgent := "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36"
apiUrl := "https://chatgpt.com/backend-anon/models"
userAgent := "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36"
apiUrl := "https://chatgpt.com/backend-api/models"

header := make(httpclient.AuroraHeaders)
header.Set("Content-Type", "application/json")
Expand Down
6 changes: 3 additions & 3 deletions internal/chatgpt/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func init() {
_ = godotenv.Load(".env")
BaseURL = os.Getenv("BASE_URL")
if BaseURL == "" {
BaseURL = "https://chatgpt.com/backend-anon"
BaseURL = "https://chatgpt.com/backend-api"
}
cores := []int{8, 12, 16, 24}
screens := []int{3000, 4000, 6000}
Expand All @@ -66,7 +66,7 @@ var (
API_REVERSE_PROXY = os.Getenv("API_REVERSE_PROXY")
FILES_REVERSE_PROXY = os.Getenv("FILES_REVERSE_PROXY")
connPool = map[string][]*connInfo{}
userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3"
userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36"
timeLocation, _ = time.LoadLocation("Asia/Shanghai")
timeLayout = "Mon Jan 2 2006 15:04:05"
BasicCookies []*http.Cookie
Expand All @@ -77,7 +77,7 @@ var (
)

func GetDpl(client httpclient.AuroraHttpClient, proxy string) {
requestURL := strings.Replace(BaseURL, "/backend-anon", "", 1) + "/?oai-dm=1"
requestURL := strings.Replace(BaseURL, "/backend-api", "", 1)

if len(cachedScripts) > 0 {
return
Expand Down

0 comments on commit c6316cf

Please sign in to comment.