bobocup commited on
Commit
58799a0
·
verified ·
1 Parent(s): 5f23fe1

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +4 -8
index.js CHANGED
@@ -98,21 +98,17 @@ class CapsolverClient {
98
  }
99
 
100
  async createTask(websiteURL, websiteKey, extraParams = {}) {
101
- // 第一步:发送初始化请求获取验证码
102
- const initResponse = await fetch(extraParams.captchaUrl + '/init', {
103
- method: 'POST',
104
  headers: {
105
- 'Content-Type': 'application/json',
106
  'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36',
107
  'sec-ch-ua': '"Not(A:Brand";v="99", "Google Chrome";v="133", "Chromium";v="133"',
108
  'sec-ch-ua-platform': '"Windows"',
109
  'sec-ch-ua-mobile': '?0',
110
  'Referer': 'https://partyrock.aws/',
111
  'Origin': 'https://partyrock.aws'
112
- },
113
- body: JSON.stringify({
114
- gokuProps: extraParams.gokuProps
115
- })
116
  });
117
 
118
  if (!initResponse.ok) {
 
98
  }
99
 
100
  async createTask(websiteURL, websiteKey, extraParams = {}) {
101
+ // 第一步:发送初始化请求获取验证码 - 改用 GET 请求
102
+ const initResponse = await fetch(`${extraParams.captchaUrl}/captcha`, {
103
+ method: 'GET',
104
  headers: {
 
105
  'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36',
106
  'sec-ch-ua': '"Not(A:Brand";v="99", "Google Chrome";v="133", "Chromium";v="133"',
107
  'sec-ch-ua-platform': '"Windows"',
108
  'sec-ch-ua-mobile': '?0',
109
  'Referer': 'https://partyrock.aws/',
110
  'Origin': 'https://partyrock.aws'
111
+ }
 
 
 
112
  });
113
 
114
  if (!initResponse.ok) {