kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
fix: timeouts for browser
rodzic
504d8d513b
commit
025f9682e4
|
@ -262,7 +262,10 @@ export class ChatGPTAPIBrowser {
|
|||
|
||||
const markdownMessages = htmlMessages.map((messageHtml) => {
|
||||
// parse markdown from message HTML
|
||||
messageHtml = messageHtml.replace('Copy code</button>', '</button>')
|
||||
messageHtml = messageHtml
|
||||
.replaceAll('Copy code</button>', '</button>')
|
||||
.replace(/Copy code\s*<\/button>/gim, '</button>')
|
||||
|
||||
return html2md(messageHtml, {
|
||||
ignoreTags: [
|
||||
'button',
|
||||
|
|
|
@ -71,7 +71,7 @@ export async function getOpenAIAuth({
|
|||
}
|
||||
|
||||
await page.goto('https://chat.openai.com/auth/login', {
|
||||
waitUntil: 'networkidle0'
|
||||
waitUntil: 'networkidle2'
|
||||
})
|
||||
|
||||
// NOTE: this is where you may encounter a CAPTCHA
|
||||
|
@ -93,7 +93,8 @@ export async function getOpenAIAuth({
|
|||
// click login button and wait for navigation to finish
|
||||
await Promise.all([
|
||||
page.waitForNavigation({
|
||||
waitUntil: 'networkidle0'
|
||||
waitUntil: 'networkidle2',
|
||||
timeout: timeoutMs
|
||||
}),
|
||||
|
||||
page.click('#__next .btn-primary')
|
||||
|
@ -134,7 +135,8 @@ export async function getOpenAIAuth({
|
|||
await Promise.all([
|
||||
waitForConditionOrAtCapacity(page, () =>
|
||||
page.waitForNavigation({
|
||||
waitUntil: 'networkidle0'
|
||||
waitUntil: 'networkidle2',
|
||||
timeout: timeoutMs
|
||||
})
|
||||
),
|
||||
submitP()
|
||||
|
|
Ładowanie…
Reference in New Issue