Clients
Nyaa
Nyaa(
*,
base_url: str = "https://nyaa.si/",
client: Client | None = None,
)
Client for interacting with Nyaa.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_url
|
str
|
Base URL of Nyaa. Used to construct full URLs from relative URLs. |
'https://nyaa.si/'
|
client
|
Client
|
Custom |
None
|
Source code in src/pynyaa/_client.py
close
get
get(page: int | str) -> NyaaRelease
Fetch metadata for a specific Nyaa release.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
page
|
int or str
|
Release ID or full URL (e.g., |
required |
Raises:
| Type | Description |
|---|---|
ReleaseNotFoundError
|
If the release does not exist (HTTP 404). |
TypeError
|
If |
ValueError
|
If |
Returns:
| Type | Description |
|---|---|
NyaaRelease
|
Parsed release metadata. |
Source code in src/pynyaa/_client.py
search
search(
query: str,
/,
*,
category: ParentCategory | Category = ALL,
filter: Filter = NO_FILTER,
sort_by: SortBy = DATETIME,
order: Order = DESCENDING,
) -> Iterator[NyaaRelease]
Search for releases on Nyaa.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
Search query string. |
required |
category
|
ParentCategory | Category
|
Category or subcategory used to filter results. |
ALL
|
filter
|
Filter
|
Filter applied to the search results. |
NO_FILTER
|
sort_by
|
SortBy
|
Field used to sort the results. |
DATETIME
|
order
|
Order
|
Order of the results. |
DESCENDING
|
Yields:
| Type | Description |
|---|---|
NyaaRelease
|
Parsed release metadata for each search result. |
Source code in src/pynyaa/_client.py
AsyncNyaa
AsyncNyaa(
*,
base_url: str = "https://nyaa.si/",
client: AsyncClient | None = None,
)
Client for interacting with Nyaa.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_url
|
str
|
Base URL of Nyaa. Used to construct full URLs from relative URLs. |
'https://nyaa.si/'
|
client
|
AsyncClient
|
Custom |
None
|
Source code in src/pynyaa/_aclient.py
close
async
get
async
get(page: int | str) -> NyaaRelease
Fetch metadata for a specific Nyaa release.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
page
|
int or str
|
Release ID or full URL (e.g., |
required |
Raises:
| Type | Description |
|---|---|
ReleaseNotFoundError
|
If the release does not exist (HTTP 404). |
TypeError
|
If |
ValueError
|
If |
Returns:
| Type | Description |
|---|---|
NyaaRelease
|
Parsed release metadata. |
Source code in src/pynyaa/_aclient.py
search
async
search(
query: str,
/,
*,
category: ParentCategory | Category = ALL,
filter: Filter = NO_FILTER,
sort_by: SortBy = DATETIME,
order: Order = DESCENDING,
) -> AsyncIterator[NyaaRelease]
Search for releases on Nyaa.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
Search query string. |
required |
category
|
ParentCategory | Category
|
Category or subcategory used to filter results. |
ALL
|
filter
|
Filter
|
Filter applied to the search results. |
NO_FILTER
|
sort_by
|
SortBy
|
Field used to sort the results. |
DATETIME
|
order
|
Order
|
Order of the results. |
DESCENDING
|
Yields:
| Type | Description |
|---|---|
NyaaRelease
|
Parsed release metadata for each search result. |