github-actions[bot] commited on
Commit
8727c8f
·
1 Parent(s): 0af80ea

Update from GitHub Actions

Browse files
Files changed (1) hide show
  1. src/index.ts +3 -3
src/index.ts CHANGED
@@ -195,15 +195,15 @@ app.get('/genspark', async (c) => {
195
  await gensparkContext.clearCookies()
196
  await gensparkContext.addCookies(cookies);
197
  }
 
198
  const gensparkPage = await gensparkContext.newPage()
199
- try {
200
- await gensparkPage.waitForTimeout(1000)
201
  //刷新页面以确保获取新令牌
202
  await gensparkPage.goto('https://www.genspark.ai/agents?type=moa_chat', {
203
  waitUntil: 'networkidle',
204
  timeout: 3600000
205
  })
206
- await gensparkPage.waitForTimeout(1000)
207
  // 执行脚本获取令牌
208
  const token = await gensparkPage.evaluate(() => {
209
  return new Promise((resolve, reject) => {
 
195
  await gensparkContext.clearCookies()
196
  await gensparkContext.addCookies(cookies);
197
  }
198
+ await new Promise(resolve => setTimeout(resolve, 1000));
199
  const gensparkPage = await gensparkContext.newPage()
200
+ try {
 
201
  //刷新页面以确保获取新令牌
202
  await gensparkPage.goto('https://www.genspark.ai/agents?type=moa_chat', {
203
  waitUntil: 'networkidle',
204
  timeout: 3600000
205
  })
206
+ await new Promise(resolve => setTimeout(resolve, 1000));
207
  // 执行脚本获取令牌
208
  const token = await gensparkPage.evaluate(() => {
209
  return new Promise((resolve, reject) => {