mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-06-17 10:15:27 -04:00
chore: Switch duckduckgo-search to ddgs (#3143)
* Switch to ddgs duckduckgo_search was deprecated, this is the recommended replacement * Update test_service_search_provider_guards.py According to review comment
This commit is contained in:
@@ -329,7 +329,7 @@ To expose Odysseus on a local network or Tailscale with HTTPS:
|
|||||||
| Package | Feature unlocked |
|
| Package | Feature unlocked |
|
||||||
|---------|-----------------|
|
|---------|-----------------|
|
||||||
| `faster-whisper` | Local speech-to-text (microphone -> text) via the "local" STT provider. |
|
| `faster-whisper` | Local speech-to-text (microphone -> text) via the "local" STT provider. |
|
||||||
| `duckduckgo-search` | DuckDuckGo as a search provider option. |
|
| `ddgs` | DuckDuckGo as a search provider option. |
|
||||||
| `PyMuPDF` | PDF page rendering in the side viewer panel and form-filling. (Note: AGPL-3.0) |
|
| `PyMuPDF` | PDF page rendering in the side viewer panel and form-filling. (Note: AGPL-3.0) |
|
||||||
| `markitdown` | Office/EPUB document text extraction (converts .docx/.xlsx/.pptx/.xls/.epub to Markdown). |
|
| `markitdown` | Office/EPUB document text extraction (converts .docx/.xlsx/.pptx/.xls/.epub to Markdown). |
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ faster-whisper
|
|||||||
# DuckDuckGo as a search provider option.
|
# DuckDuckGo as a search provider option.
|
||||||
# Install if you want DDG in the search-provider dropdown.
|
# Install if you want DDG in the search-provider dropdown.
|
||||||
# Alternatives: SearXNG, Brave, Tavily, Serper, Google PSE.
|
# Alternatives: SearXNG, Brave, Tavily, Serper, Google PSE.
|
||||||
duckduckgo-search
|
ddgs
|
||||||
|
|
||||||
# PDF form-filling feature (fillable AcroForm detection, field extraction,
|
# PDF form-filling feature (fillable AcroForm detection, field extraction,
|
||||||
# value/annotation/signature stamping, page rendering for the form overlay).
|
# value/annotation/signature stamping, page rendering for the form overlay).
|
||||||
|
|||||||
@@ -417,7 +417,7 @@ def duckduckgo_search(query: str, count: Optional[int] = None, time_filter: Opti
|
|||||||
return []
|
return []
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from duckduckgo_search import DDGS
|
from ddgs import DDGS
|
||||||
except ImportError:
|
except ImportError:
|
||||||
logger.warning("duckduckgo-search package not installed; using HTML fallback")
|
logger.warning("duckduckgo-search package not installed; using HTML fallback")
|
||||||
return _html_fallback()
|
return _html_fallback()
|
||||||
|
|||||||
@@ -90,8 +90,8 @@ def test_service_ddg_html_fallback_sends_safesearch(monkeypatch):
|
|||||||
seen["params"] = kwargs["params"]
|
seen["params"] = kwargs["params"]
|
||||||
return _Response()
|
return _Response()
|
||||||
|
|
||||||
monkeypatch.setitem(sys.modules, "duckduckgo_search", None)
|
|
||||||
monkeypatch.setattr(providers, "_get_search_settings", lambda: {"search_safesearch": "off"})
|
monkeypatch.setattr(providers, "_get_search_settings", lambda: {"search_safesearch": "off"})
|
||||||
|
monkeypatch.setitem(sys.modules, "ddgs", None)
|
||||||
monkeypatch.setattr(providers.httpx, "get", fake_get)
|
monkeypatch.setattr(providers.httpx, "get", fake_get)
|
||||||
|
|
||||||
results = providers.duckduckgo_search("odysseus", count=1)
|
results = providers.duckduckgo_search("odysseus", count=1)
|
||||||
|
|||||||
Reference in New Issue
Block a user