Skip to content

v3.0.1

Choose a tag to compare

@KTS-o7 KTS-o7 released this 04 Jun 08:35
· 22 commits to main since this release

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-Agent to Chrome 124, added Referer header, switched Accept-Encoding to gzip, deflate
  • Gzip response decompression in bing.py
  • adult_filter_off default changed from TrueFalse (safe search on by default)
  • Adult filter now maps to adlt=moderate instead of adlt=on when active
  • New mkt parameter on downloader() and Bing class (default: en-US)
  • New -m/--mkt CLI 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.