Repository navigation
Conversation
Keep httpx2 from sending a bodiless GET with a multipart content type after a redirect, which E-Hentai rejects with 403.
Read the signature key from the search page, query insights by BCID for both URL and file searches, and keep cookies between requests.
Load the streamed AI overview referenced by the results page when `ai_overview` is enabled, and parse its text and cited sources.
This was referenced Nov 27, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Restores broken engines, surfaces clearer errors, and adds AI overviews for Bing and Google Lens.
Closes #343
Fixes
Content-Typewhen a redirect turns POST into GET. httpx2 keeps the multipart header on the bodiless GET, and E-Hentai's Cloudflare rules reject it with 403.SignatureUtils.init(...), they change per page), insights are queried by BCID for both URL and file searches, and cookies are kept between requests. Like Copyseeker, Bing needs a sharedclient, so the test and the sync demo now useNetwork.uploadbyurlredirects to the sign-in page; URL searches now fall back to downloading the image and uploading it as a file.retries,retry_delay), and an error page now raisesParsingErrorinstead ofIndexError.retries,retry_delay) and raiseParsingErrorif still rejected.ParsingErrorinstead of building an empty response that fails withKeyError: 'id'(Copyseeker engine broken: site now gates search behind account authentication (all hardcoded action tokens stale) #393).Features
ParsingErroron Cloudflare challenge pages for Ascii2D and TinEye, instead of empty results orJSONDecodeError.BingResponse.ai_overviewwith the AI-generated description and cited sources (already present in the insights response).GoogleLens(ai_overview=True)loads the "AI overview" shown with Lens results and exposesGoogleLensResponse.ai_overview(text and sources). Off by default since it costs an extra request.Yandex(ai_overview=True)loads the Yandex Neuro answer for the image (optionally for a questionq) and exposesYandexResponse.ai_overview(text and sources). Off by default; Yandex limits it to about 100 requests per hour.Docs
POST https://accounts.google.com/RotateCookiesand save the returned cookies.Testing
Live run (
pytest --disable-vcr) with a SauceNAO key and Google cookies: 21 passed, 2 failed, 4 skipped.ParsingError).base_urlconfigured) and the deprecated Google engine.Results of Bing, Google Lens, E-Hentai, SauceNAO and IQDB were also checked against the query images.