Skip to content

Commit 58e1576

Browse files
committed
chore: fix GPT-4 Web arkose_token (#34)
1 parent 6c42167 commit 58e1576

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/services/apis/chatgpt-web.mjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,13 @@ export async function generateAnswersWithChatgptWebApi(port, question, session,
113113
timezone_offset_min: new Date().getTimezoneOffset(),
114114
variant_purpose: 'none',
115115
history_and_training_disabled: config.disableWebModeHistory,
116+
arkose_token: usedModel.startsWith('gpt-4')
117+
? `${Array.from({ length: 17 }, () => Math.floor(Math.random() * 16).toString(16)).join(
118+
'',
119+
)}|r=ap-southeast-1|meta=3|meta_width=300|metabgclr=transparent|metaiconclr=%23555555|guitextcolor=%23000000|pk=35536E1E-65B4-4D96-9D97-6ADB7EFF8147|at=40|sup=1|rid=${
120+
Math.floor(Math.random() * 99) + 1
121+
}|ag=101|cdn_url=https%3A%2F%2Ftcr9i.chat.openai.com%2Fcdn%2Ffc|lurl=https%3A%2F%2Faudio-ap-southeast-1.arkoselabs.com|surl=https%3A%2F%2Ftcr9i.chat.openai.com|smurl=https%3A%2F%2Ftcr9i.chat.openai.com%2Fcdn%2Ffc%2Fassets%2Fstyle-manager`
122+
: undefined,
116123
}),
117124
onMessage(message) {
118125
console.debug('sse message', message)

0 commit comments

Comments
 (0)