v3.0.1
Bug Fixes
Fix irrelevant, repeated, and inappropriate images from Bing
Root causes fixed
1. Stale HTTP headers caused Bing to return truncated results
Bing recently changed server behavior so that requests with outdated headers (Accept-Encoding: none, Chrome 23 User-Agent) receive a severely truncated response — returning only ~1 image per page instead of 35. Updated headers to match a current browser fingerprint and added gzip decompression support.
2. Adult content filter was disabled by default
The adult_filter_off parameter defaulted to True, which explicitly sent adlt=off to Bing — disabling Bing's own built-in safe search. The default is now False, sending adlt=moderate (Bing's browser default).
3. Non-English results (e.g. Chinese-text images)
No market code was being sent, so Bing geo-detected the server's location and could return localized results. A new mkt parameter (default en-US) pins results to English.
Changes
- Updated
User-Agentto Chrome 124, addedRefererheader, switchedAccept-Encodingtogzip, deflate - Gzip response decompression in
bing.py adult_filter_offdefault changed fromTrue→False(safe search on by default)- Adult filter now maps to
adlt=moderateinstead ofadlt=onwhen active - New
mktparameter ondownloader()andBingclass (default:en-US) - New
-m/--mktCLI flag
Breaking Change
adult_filter_off now defaults to False (safe search enabled). To restore previous behavior (no filtering), pass adult_filter_off=True explicitly.