Before you open an issue:
Describe the bug
The BingImages backend accepts the shared safesearch argument from DDGS.images(...), but does not apply it to the Bing image request payload.
When calling DDGS.images(..., safesearch="on", backend="bing") or backend="auto" when it falls back to Bing, I would expect Bing image search to receive an equivalent strict SafeSearch parameter. Instead, the Bing payload appears to omit SafeSearch entirely.
In ddgs/engines/bing_images.py, build_payload() currently receives safesearch but marks it unused:
Steps to reproduce the problem:
from ddgs import DDGS
with DDGS() as ddgs:
results = ddgs.images(
"deep sea fish",
safesearch="on",
backend="bing",
max_results=10,
)
Observe the Bing request URL/logs. It calls:
https://www.bing.com/images/async?q=deep+sea+fish&async=1&first=1&count=...
Expected:
https://www.bing.com/images/async?q=deep+sea+fish&async=1&first=1&count=...&safeSearch=Strict
Specify this information
- OS: macOS
- environment: Python 3.12
- ddgs version: 9.14.4
Before you open an issue:
pip install -I ddgs)Describe the bug
The BingImages backend accepts the shared safesearch argument from DDGS.images(...), but does not apply it to the Bing image request payload.
When calling DDGS.images(..., safesearch="on", backend="bing") or backend="auto" when it falls back to Bing, I would expect Bing image search to receive an equivalent strict SafeSearch parameter. Instead, the Bing payload appears to omit SafeSearch entirely.
In ddgs/engines/bing_images.py, build_payload() currently receives safesearch but marks it unused:
Steps to reproduce the problem:
from ddgs import DDGS
with DDGS() as ddgs:
results = ddgs.images(
"deep sea fish",
safesearch="on",
backend="bing",
max_results=10,
)
Observe the Bing request URL/logs. It calls:
https://www.bing.com/images/async?q=deep+sea+fish&async=1&first=1&count=...
Expected:
https://www.bing.com/images/async?q=deep+sea+fish&async=1&first=1&count=...&safeSearch=Strict
Specify this information