EHentai
Classes
EHentai
Bases: BaseSearchEngine[EHentaiResponse]
API client for the EHentai image search engine.
Used for performing reverse image searches using EHentai service.
Attributes:
Name | Type | Description |
---|---|---|
base_url |
str
|
The base URL for EHentai searches. |
is_ex |
bool
|
If True, search on exhentai.org; otherwise, use e-hentai.org. |
covers |
bool
|
A flag to search only for covers. |
similar |
bool
|
A flag to enable similarity scanning. |
exp |
bool
|
A flag to include results from expunged galleries. |
Source code in PicImageSearch/engines/ehentai.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
|
Attributes
covers = covers
instance-attribute
exp = exp
instance-attribute
is_ex = is_ex
instance-attribute
similar = similar
instance-attribute
Functions
__init__(is_ex=False, covers=False, similar=True, exp=False, **request_kwargs)
Initializes an EHentai API client with specified configurations.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
is_ex
|
bool
|
If True, search on exhentai.org; otherwise, use e-hentai.org. |
False
|
covers
|
bool
|
If True, search only for covers; otherwise, search all images. |
False
|
similar
|
bool
|
If True, enable similarity scanning for more results. |
True
|
exp
|
bool
|
If True, include results from expunged galleries. |
False
|
**request_kwargs
|
Any
|
Additional arguments for network requests (e.g., cookies, proxies). |
{}
|
Note
- For exhentai.org searches (is_ex=True), valid cookies must be provided in request_kwargs.
- The base URL is automatically selected based on the is_ex parameter.
Source code in PicImageSearch/engines/ehentai.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
|
search(url=None, file=None, **kwargs)
async
Performs a reverse image search on EHentai/ExHentai.
This method supports two ways of searching
- Search by image URL
- Search by uploading a local image file
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url
|
Optional[str]
|
URL of the image to search. |
None
|
file
|
Union[str, bytes, Path, None]
|
Local image file, can be a path string, bytes data, or Path object. |
None
|
**kwargs
|
Any
|
Additional arguments passed to the parent class. |
{}
|
Returns:
Name | Type | Description |
---|---|---|
EHentaiResponse |
EHentaiResponse
|
Contains search results and metadata, including: - Similar gallery entries - Gallery URLs and titles - Similarity scores - Additional metadata from the search results |
Raises:
Type | Description |
---|---|
ValueError
|
If neither |
RuntimeError
|
If searching on ExHentai without proper authentication. |
Note
- Only one of
url
orfile
should be provided. - For ExHentai searches, valid cookies must be provided in the request_kwargs.
- Search behavior is affected by the covers, similar, and exp flags set during initialization.
Source code in PicImageSearch/engines/ehentai.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
|