Request

class asyncpow.apis.request.Request(base_url: URL, api_key: str, session: ClientSession, raw_response: bool, tv_instance: Tv, movie_instance: Movie)[source]

Class to interact with request-related endpoints.

Initialize the Request object with the base URL, API key, and session.

async async_get_requests(raw_response: bool | None = None, take: int = 20, skip: int = 0, filter: Literal['all', 'approved', 'available', 'pending', 'processing', 'unavailable', 'failed'] = 'all', sort: Literal['added', 'modified', 'mediaAdded'] = 'added', requested_by: int = 1) dict | RequestResultsResponseModel[source]

Get a list of requests

Parameters:
  • raw_response (bool, optional) – Return JSON response. Defaults to None.

  • take (int, optional) – Number if pages. Defaults to 20.

  • skip (int, optional) – Pages to skip. Defaults to 0.

  • filter (RequestFilterOptions, optional) – Filter requests. Defaults to β€œall”.

  • sort (SortOptions, optional) – Sort Requests. Defaults to β€œadded”.

  • requested_by (int, optional) – Only requests by user. Defaults to 1.

Returns:

Returns a request record

Return type:

dict | RequestResultsResponseModel

async async_post_request(id: int, type: Literal['movie', 'tv'], series: Literal['all', 'latest', 'first'] = 'all', raw_response: bool | None = None) dict | MediaRequestModel[source]

Get a list of requests

Parameters:
  • id (int) – Movie or TV ID.

  • type (str) – Type of request movie | tv.

  • series (str, optional) – What series to request - all | latest | first, only aplies to tv. Defautls to all

  • raw_response (bool, optional) – Return JSON response. Defaults to None.

Returns:

Returns a request record

Return type:

dict | MediaRequestModel