Grabber¶
Low-level HTTP client with nhentai-compatible headers.
Used internally by NHentai, but available if you need raw HTML or image bytes.
nhentai.grabber.Grabber(url: str, timeout: int = 30, headers: dict | None = None)
¶
Fetches raw HTML or image bytes from a URL with nhentai-compatible headers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
Target URL. |
required |
timeout
|
int
|
Request timeout in seconds. |
30
|
headers
|
dict | None
|
Additional headers merged with defaults. |
None
|
Source code in nhentai/grabber.py
get_html() -> str
¶
Fetch and return the HTML of :attr:url.
Raises:
| Type | Description |
|---|---|
ConnectionError
|
On HTTP error, timeout, or network failure. |
Source code in nhentai/grabber.py
download_bytes(url: str) -> bytes
¶
Download and return raw bytes from url.
Raises:
| Type | Description |
|---|---|
ConnectionError
|
On HTTP error, timeout, or network failure. |