Spaces:
Running
Running
github-actions[bot]
commited on
Commit
·
2fd5f48
1
Parent(s):
2496079
Update from GitHub Actions
Browse files- src/index.ts +3 -3
src/index.ts
CHANGED
@@ -41,7 +41,7 @@ async function initGensparkContext() {
|
|
41 |
viewport: { width: 1920, height: 1080 },
|
42 |
deviceScaleFactor: 1,
|
43 |
hasTouch: false,
|
44 |
-
locale: '
|
45 |
timezoneId: 'America/New_York',
|
46 |
geolocation: { longitude: -73.935242, latitude: 40.730610 }, // 纽约坐标,可根据需要调整
|
47 |
permissions: ['geolocation'],
|
@@ -72,7 +72,7 @@ async function getReCaptchaToken(page: Page): Promise<string> {
|
|
72 |
window.grecaptcha.ready(function () {
|
73 |
// @ts-ignore
|
74 |
grecaptcha.execute(
|
75 |
-
|
76 |
{ action: 'copilot' },
|
77 |
).then(function (token: string) {
|
78 |
resolve(token)
|
@@ -136,7 +136,7 @@ async function handleRequest(url: string, method: string, headers: any, body?: a
|
|
136 |
}
|
137 |
|
138 |
// 等待页面加载完成,使用更短的超时时间
|
139 |
-
await page.waitForLoadState('networkidle', { timeout:
|
140 |
console.log('等待页面加载超时,继续处理');
|
141 |
});
|
142 |
|
|
|
41 |
viewport: { width: 1920, height: 1080 },
|
42 |
deviceScaleFactor: 1,
|
43 |
hasTouch: false,
|
44 |
+
locale: 'zh-CN',
|
45 |
timezoneId: 'America/New_York',
|
46 |
geolocation: { longitude: -73.935242, latitude: 40.730610 }, // 纽约坐标,可根据需要调整
|
47 |
permissions: ['geolocation'],
|
|
|
72 |
window.grecaptcha.ready(function () {
|
73 |
// @ts-ignore
|
74 |
grecaptcha.execute(
|
75 |
+
RECAPTCHA_SITE_KEY,
|
76 |
{ action: 'copilot' },
|
77 |
).then(function (token: string) {
|
78 |
resolve(token)
|
|
|
136 |
}
|
137 |
|
138 |
// 等待页面加载完成,使用更短的超时时间
|
139 |
+
await page.waitForLoadState('networkidle', { timeout: 600000 }).catch(() => {
|
140 |
console.log('等待页面加载超时,继续处理');
|
141 |
});
|
142 |
|