[feat] engines: add duckduckgo web engine as alternative to html.duckduckgo.com

html.duckduckgo.com captchas all my IPs very fast. I figured out that using
duckduckgo.com works even if html.duckduckgo.com is captcha-ed, hence adding
support for duckduckgo.com's general web search here.

This implementation fetches the link to the first API page
(i.e. ``links.duckduckgo.com/d.js?...``) from duckduckgo.com and uses the ``n``
parameter of the API to fetch all subsequent pages.

This also means that it's not possible to immediately search for the third
page - the first and the second page would need to be loaded first.

The reason why we can't just normally use the `vqd` value is that the API URLs
require an additional parameter `dp` which seems generated at server-side, so we
can't build it ourselves and must scrape it from the HTML pages.
This commit is contained in:
Bnyro
2026-06-01 11:01:23 +02:00
parent 26801e92af
commit f4c63c8eb0
2 changed files with 161 additions and 0 deletions
+7
View File
@@ -803,10 +803,17 @@ engines:
display_type: ["infobox"]
categories: [general]
# duckduckgo uses html.duckduckgo.com,
# duckduckgo web uses duckduckgo.com
- name: duckduckgo
engine: duckduckgo
shortcut: ddg
- name: duckduckgo web
engine: duckduckgo_web
shortcut: ddgw
disabled: true
- name: duckduckgo images
engine: duckduckgo_extra
categories: [images]