Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error 418 provider duckduckgo #344

Closed
quiquebg opened this issue Mar 20, 2025 · 7 comments
Closed

Error 418 provider duckduckgo #344

quiquebg opened this issue Mar 20, 2025 · 7 comments

Comments

@quiquebg
Copy link

I get this error, I have tried on different devices and in all of them it fails, before it worked correctly.

Tested with different models of duckduckgo.

Some error has occurred. Statuscode: 418
{"action":"error","status":418,"type":"ERR_CHALLENGE","overrideCode":"e1b9","cd":{"cc":"duckchat","e":0,"er":null,"gk":0,"i":"3","iadb":1,"o":"vSD8q42JVHCoF9%2FbVw5H14hboXQ%2Fk45%2BM9vIvWOX5Wg%3D%0A","p":"913e055842b04de5b0133ead01fd04b2-28dcbc8f81f149d6ae7e139496bddd3e-dfb0d4b78770498b80245731afc4f0a1-82cc79af9a3d42799a5059d572da5297-a62aa9a3e32b417eac2838f4bf66c04f-81590901a89b4c9c94ca8c531431999c-7642706ae65b4d13a2a647320cbdbf43-d9a34a82af2f40b2b09e501ff8fe8bf4-f4b7707f0df0437f9aff45398ce6f1bf","q":"","r":"eun","s":"aichat","sc":1}}

@johnd0e
Copy link
Contributor

johnd0e commented Mar 20, 2025

Minor change in tgpt required, as there is now additional header x-vqd-hash-1.

@aandrew-me
Copy link
Owner

Checking

@aandrew-me
Copy link
Owner

Minor change in tgpt required, as there is now additional header x-vqd-hash-1.

Definitely not minor

@johnd0e
Copy link
Contributor

johnd0e commented Mar 20, 2025

https://github.com/aandrew-me/tgpt/blob/main/providers%2Fduckduckgo%2Fduckduckgo.go#L70

Here instead of 1 header you need to get 2.
Seems like pretty trivial change.

@aandrew-me
Copy link
Owner

aandrew-me commented Mar 20, 2025

https://github.com/aandrew-me/tgpt/blob/main/providers%2Fduckduckgo%2Fduckduckgo.go#L70

Here instead of 1 header you need to get 2. Seems like pretty trivial change.

Well unlike that header, here the server sends some text which needs to be decoded, which results in js code to be executed on the site, then some hashes need to be calculated based on the User agent and encoded again and sent as the header

@johnd0e
Copy link
Contributor

johnd0e commented Mar 20, 2025

@aandrew-me

I suppose that trick will not live long, but as for now, I can pass arbitrary string as x-vqd-hash-1 header and the server accepts it.

P.S.
And to continue conversation you need to pass x-vqd-4-value responded by server on previous /chat request.

@aandrew-me
Copy link
Owner

You're right, well make me do a quick fix for now then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants