SonarrAPI

class pyarr.sonarr.SonarrAPI(host_url: str, api_key: str, ver_uri: str = '/v3')[source]

API wrapper for Sonarr endpoints.

add_root_folder(directory: str) dict[str, JsonDataType][source]

Adds a new root folder

Parameters:

directory (str) – The directory path

Returns:

Dictionary containing path details

Return type:

JsonObject

post_command(name: Literal['Backup', 'DownloadedEpisodesScan', 'EpisodeSearch', 'missingEpisodeSearch', 'RefreshSeries', 'RenameSeries', 'RenameFiles', 'RescanSeries', 'RssSync', 'SeasonSearch', 'SeriesSearch'], **kwargs: dict[str, Union[int, list[int]]] | None) dict[str, JsonDataType][source]

Performs any of the predetermined Sonarr command routines

Parameters:
  • name (SonarrCommands) – Command that should be executed

  • **kwargs – Additional parameters for specific commands.

Note

For available commands and required **kwargs see the SonarrCommands model

Returns:

Dictionary containing job

Return type:

JsonObject

get_episode(id_: int, series: bool = False) dict[str, JsonDataType][source]

Get episodes by ID or series

Parameters:
  • id (int) – ID for Episode or Series.

  • series (bool, optional) – Set to true if the ID is for a Series. Defaults to false.

Returns:

List of dictionaries with items

Return type:

JsonArray

get_episodes_by_series_id(id_: int) list[dict[str, JsonDataType]][source]

Gets all episodes from a given series ID

Parameters:

id (int) – Database id for series

Note

This method is deprecated and will be removed in a future release. Please use get_episode()

Returns:

List of dictionaries with items

Return type:

JsonArray

get_episode_by_episode_id(id_: int) dict[str, JsonDataType][source]

Gets a specific episode by database id

Parameters:

id (int) – Database id for episode

Note

This method is deprecated and will be removed in a future release. Please use get_episode()

Returns:

List of dictionaries with items

Return type:

JsonArray

upd_episode(id_: int, data: dict[str, JsonDataType]) dict[str, JsonDataType][source]

Update the given episodes, currently only monitored is supported

Parameters:
  • id (int) – ID of the Episode to be updated

  • data (dict[str, Any]) – Parameters to update the episode

Example

payload = {"monitored": True}
sonarr.upd_episode(1, payload)
Returns:

Dictionary with updated record

Return type:

JsonObject

upd_episode_monitor(episode_ids: list[int], monitored: bool = True) list[dict[str, JsonDataType]][source]

Update episode monitored status

Parameters:
  • episode_ids (list[int]) – All episode IDs to be updated

  • monitored (bool, optional) – True or False. Defaults to True.

Returns:

list of dictionaries containing updated records

Return type:

JsonArray

get_episode_files_by_series_id(id_: int) list[dict[str, JsonDataType]][source]

Returns all episode file information for series id specified

Parameters:

id (int) – Database id of series

Returns:

List of dictionaries with items

Return type:

JsonArray

get_episode_file(id_: int, series: bool = False) dict[str, JsonDataType][source]

Returns episode file information for specified id

Parameters:
  • id (int) – Database id of episode file

  • series (bool, optional) – Set to true if the ID is for a Series. Defaults to false.

Returns:

Dictionary with data

Return type:

JsonObject

del_episode_file(id_: int) Response | dict[str, JsonDataType] | dict[Any, Any][source]

Deletes the episode file with corresponding id

Parameters:

id (int) – Database id for episode file

Returns:

HTTP Response

Return type:

Response

upd_episode_file_quality(id_: int, data: dict[str, JsonDataType]) dict[str, JsonDataType][source]

Updates the quality of the episode file and returns the episode file

Parameters:
  • id (int) – Database id for episode file

  • data (JsonObject) –

    data with quality:

    {
        "quality": {
            "quality": {
            "id": 8
            },
            "revision": {
            "version": 1,
            "real": 0
            }
        },
    }
    

Returns:

Dictionary with updated record

Return type:

JsonObject

get_wanted(page: int | None = None, page_size: int | None = None, sort_key: Literal['airDateUtc', 'date', 'downloadClient', 'episode', 'episodeId', 'episode.title', 'id', 'indexer', 'language', 'message', 'path', 'progress', 'protocol', 'quality', 'ratings', 'seriesId', 'series.sortTitle', 'size', 'sourcetitle', 'status', 'timeleft'] | None = None, sort_dir: Literal['ascending', 'default', 'descending'] | None = None, include_series: bool | None = None) dict[str, JsonDataType][source]

Gets missing episode (episodes without files)

Parameters:
  • page (Optional[int], optional) – Page number to return. Defaults to None.

  • page_size (Optional[int], optional) – Number of items per page. Defaults to None.

  • sort_key (Optional[SonarrSortKey], optional) – series.title or airDateUtc. Defaults to None.

  • sort_dir (Optional[PyarrSortDirection], optional) – Direction to sort the items. Defaults to None.

  • include_series (Optional[bool], optional) – Include the whole series. Defaults to None

Returns:

Dictionary with items

Return type:

JsonObject

get_queue(page: int | None = None, page_size: int | None = None, sort_key: Literal['airDateUtc', 'date', 'downloadClient', 'episode', 'episodeId', 'episode.title', 'id', 'indexer', 'language', 'message', 'path', 'progress', 'protocol', 'quality', 'ratings', 'seriesId', 'series.sortTitle', 'size', 'sourcetitle', 'status', 'timeleft'] | None = None, sort_dir: Literal['ascending', 'default', 'descending'] | None = None, include_unknown_series_items: bool | None = None, include_series: bool | None = None, include_episode: bool | None = None) dict[str, JsonDataType][source]

Gets currently downloading info

Parameters:
  • page (Optional[int], optional) – Page number to return. Defaults to None.

  • page_size (Optional[int], optional) – Number of items per page. Defaults to None.

  • sort_key (Optional[SonarrSortKey], optional) – Field to sort by. Defaults to None.

  • sort_dir (Optional[PyarrSortDirection], optional) – Direction to sort the items. Defaults to None.

  • include_unknown_series_items (Optional[bool], optional) – Include unknown series items. Defaults to None.

  • include_series (Optional[bool], optional) – Include series. Defaults to None.

  • include_episode (Optional[bool], optional) – Include episodes. Defaults to None.

Returns:

Dictionary with queue items

Return type:

JsonObject

get_parse_title_path(title: str | None = None, path: str | None = None) dict[str, JsonDataType][source]

Returns the result of parsing a title or path. series and episodes will be returned only if the parsing matches to a specific series and one or more episodes. series and episodes will be formatted the same as Series and Episode responses.

Parameters:
  • title (Optional[str], optional) – Title of series or episode. Defaults to None.

  • path (Optional[str], optional) – file path of series or episode. Defaults to None.

Raises:

PyarrMissingArgument – If no argument is passed, error

Returns:

Dictionary with items

Return type:

JsonObject

get_parsed_title(title: str) dict[str, JsonDataType][source]

Returns the result of parsing a title. series and episodes will be returned only if the parsing matches to a specific series and one or more episodes. series and episodes will be formatted the same as Series and Episode responses.

Parameters:

title (str) – Title of series / episode

Returns:

List of dictionaries with items

Return type:

JsonObject

get_parsed_path(file_path: str) dict[str, JsonDataType][source]

Returns the result of parsing a file path. series and episodes will be returned only if the parsing matches to a specific series and one or more episodes. series and episodes will be formatted the same as Series and Episode responses.

Parameters:

file_path (str) – file path of series / episode

Returns:

List of dictionaries with items

Return type:

JsonObject

get_release(id_: int | None = None) list[dict[str, JsonDataType]][source]

Query indexers for latest releases.

Parameters:

id (int) – Database id for episode to check

Returns:

List of dictionaries with items

Return type:

JsonArray

post_release(guid: str, indexer_id: int) dict[str, JsonDataType][source]
Adds a previously searched release to the download client, if the release is

still in Sonarr’s search cache (30 minute cache). If the release is not found in the cache Sonarr will return a 404.

Parameters:
  • guid (str) – Recently searched result guid

  • indexer_id (int) – Database id of indexer to use

Returns:

Dictionary with download release details

Return type:

JsonObject

post_release_push(title: str, download_url: str, protocol: str, publish_date: datetime) Any[source]

If the title is wanted, Sonarr will grab it.

Parameters:
  • title (str) – Release name

  • download_url (str) – .torrent file URL

  • protocol (str) – β€œUsenet” or β€œTorrent

  • publish_date (datetime) – ISO8601 date

Returns:

Array

Return type:

JSON

get_series(id_: int | None = None, tvdb: bool | None = False) list[dict[str, JsonDataType]] | dict[str, JsonDataType][source]

Returns all series in your collection or the series with the matching series ID if one is found.

Parameters:
  • id (Optional[int], optional) – Database id for series. Defaults to None.

  • tvdb (Optional[bool], optional) – Set to true if ID is tvdb. Defaults to False

Returns:

List of dictionaries with items, or a dictionary with single item

Return type:

Union[JsonArray, JsonObject]

add_series(series: dict[str, JsonDataType], quality_profile_id: int, language_profile_id: int, root_dir: str, season_folder: bool = True, monitored: bool = True, ignore_episodes_with_files: bool = False, ignore_episodes_without_files: bool = False, search_for_missing_episodes: bool = False) dict[str, JsonDataType][source]

Adds a new series to your collection

Note

if you do not add the required params, then the series wont function. some of these without the others can indeed make a β€œseries”. But it wont function properly in nzbdrone.

Parameters:
  • series (JsonObject) – A series object from lookup()

  • quality_profile_id (int) – Database id for quality profile

  • language_profile_id (int) – Database id for language profile

  • root_dir (str) – Root folder location, full path will be created from this

  • season_folder (bool, optional) – Create a folder for each season. Defaults to True.

  • monitored (bool, optional) – Monitor this series. Defaults to True.

  • ignore_episodes_with_files (bool, optional) – Ignore any episodes with existing files. Defaults to False.

  • ignore_episodes_without_files (bool, optional) – Ignore any episodes without existing files. Defaults to False.

  • search_for_missing_episodes (bool, optional) – Search for missing episodes to download. Defaults to False.

Returns:

Dictionary of added record

Return type:

JsonObject

upd_series(data: dict[str, JsonDataType]) dict[str, JsonDataType][source]

Update an existing series

Parameters:

data (JsonObject) – contains data obtained by get_series()

Returns:

Dictionary or updated record

Return type:

JsonObject

del_series(id_: int, delete_files: bool = False) Response | dict[str, JsonDataType] | dict[Any, Any][source]

Delete the series with the given ID

Parameters:
  • id (int) – Database ID for series

  • delete_files (bool, optional) – If true series folder and files will be deleted. Defaults to False.

Returns:

Blank dictionary

Return type:

dict

lookup_series(term: str | None = None, id_: int | None = None) list[dict[str, JsonDataType]][source]

Searches for new shows on TheTVDB.com utilizing sonarr.tv’s caching and augmentation proxy.

Parameters:
  • term (Optional[str], optional) – Series’ Name

  • id (Optional[int], optional) – TVDB ID for series

Returns:

List of dictionaries with items

Return type:

JsonArray

lookup_series_by_tvdb_id(id_: int) list[dict[str, JsonDataType]][source]

Searches for new shows on TheTVDB.com utilizing sonarr.tv’s caching and augmentation proxy.

Note

This method is deprecated and will be removed in a future release. Please use lookup_series()

Parameters:

id (int) – TVDB ID

Returns:

List of dictionaries with items

Return type:

JsonArray

get_history(page: int | None = None, page_size: int | None = None, sort_key: Literal['id', 'date', 'eventType', 'series.title', 'episode.title', 'movieFile.relativePath', 'sourceTitle', 'status'] | None = None, sort_dir: Literal['ascending', 'default', 'descending'] | None = None, id_: int | None = None) dict[str, JsonDataType][source]

Gets history (grabs/failures/completed)

Parameters:
  • page (Optional[int], optional) – Page number to return. Defaults to None.

  • page_size (Optional[int], optional) – Number of items per page. Defaults to None.

  • sort_key (Optional[PyarrHistorySortKey], optional) – Field to sort by. Defaults to None.

  • sort_dir (Optional[PyarrSortDirection], optional) – Direction to sort the items. Defaults to None.

  • id (Optional[int], optional) – Filter to a specific episode ID. Defaults to None.

Returns:

Dictionary with items

Return type:

JsonObject

get_language_profile(id_: int | None = None) list[dict[str, JsonDataType]] | dict[Any, Any][source]

Gets all language profiles or specific one with id

Parameters:

id (Optional[int], optional) – Language profile id from database. Defaults to None.

Note

This method is deprecated and will be removed in a future release. Please use get_language()

Returns:

List of dictionaries with items

Return type:

Union[JsonArray, dict[Any, Any]]

get_language_profile_schema(id_: int | None = None) list[dict[str, JsonDataType]] | dict[Any, Any][source]

Gets all language profile schemas or specific one with id

Parameters:

id (Optional[int], optional) – Language profile schema id from database. Defaults to None.

Returns:

List of dictionaries with items

Return type:

Union[JsonArray, dict[Any, Any]]

add_quality_profile(name: str, upgrades_allowed: bool, cutoff: int, items: list) dict[str, JsonDataType][source]

Add new quality profile

Parameters:
  • name (str) – Name of the profile

  • upgrades_allowed (bool) – Are upgrades in quality allowed?

  • cutoff (int) – ID of quality definition to cutoff at. Must be an allowed definition ID.

  • items (list) – Add a list of items (from get_quality_definition())

Returns:

An object containing the profile

Return type:

JsonObject

get_manual_import(folder: str, download_id: str | None = None, series_id: int | None = None, filter_existing_files: bool | None = None, replace_existing_files: bool | None = None) list[dict[str, JsonDataType]][source]

Gets a manual import list

Parameters:
  • downloadId (str) – Download IDs

  • series_id (int, optional) – Series Database ID. Defaults to None.

  • folder (Optional[str], optional) – folder name. Defaults to None.

  • filterExistingFiles (bool, optional) – filter files. Defaults to True.

  • replaceExistingFiles (bool, optional) – replace files. Defaults to True.

Returns:

List of dictionaries with items

Return type:

JsonArray

upd_manual_import(data: dict[str, JsonDataType]) dict[str, JsonDataType][source]

Update a manual import

Note

To be used in conjunction with get_manual_import()

Parameters:

data (JsonObject) – Data containing changes

Returns:

Dictionary of updated record

Return type:

JsonObject

add_download_client(data: dict[str, JsonDataType]) dict[str, JsonDataType]

Add a download client based on the schema information supplied

Note

Recommended to be used in conjunction with get_download_client_schema()

Parameters:

data (JsonObject) – dictionary with download client schema and settings

Returns:

dictionary of added item

Return type:

JsonObject

add_import_list(data: dict[str, JsonDataType]) dict[str, JsonDataType]

Add an import list based on the schema information supplied

Note

Recommended to be used in conjunction with get_import_list_schema()

Parameters:

data (JsonObject) – dictionary with import list schema and settings

Returns:

dictionary of added item

Return type:

JsonObject

add_notification(data: dict[str, JsonDataType]) dict[str, JsonDataType]

Add an import list based on the schema information supplied

Note

Recommended to be used in conjunction with get_notification_schema()

Parameters:

data (JsonObject) – dictionary with import list schema and settings

Returns:

dictionary of added item

Return type:

JsonObject

basic_auth(username: str, password: str) HTTPBasicAuth | None

If you have basic authentication setup you will need to pass your username and passwords to the HTTPBASICAUTH() method.

Parameters:
  • username (str) – Username for basic auth.

  • password (str) – Password for basic auth.

Returns:

HTTP Auth object

Return type:

Object

create_tag(label: str) dict[str, JsonDataType]

Adds a new tag

Parameters:

label (str) – Tag name / label

Returns:

Dictionary of new record

Return type:

JsonObject

del_blocklist(id_: int) Response | dict[str, JsonDataType] | dict[Any, Any]

Removes a specific release (the id provided) from the blocklist

Parameters:

id (int) – Blocklist ID from database

Returns:

HTTP Response

Return type:

Response

del_blocklist_bulk(ids: list[int]) Response | dict[str, JsonDataType] | dict[Any, Any]

Delete blocked releases in bulk

Parameters:

ids (list[int]) – Blocklists ids that should be deleted

Returns:

HTTP Response

Return type:

Response

del_download_client(id_: int) Response | dict[str, JsonDataType] | dict[Any, Any]

Delete a download client by database id

Parameters:

id (int) – download client database id

Returns:

HTTP Response

Return type:

Response

del_import_list(id_: int) Response | dict[str, JsonDataType] | dict[Any, Any]

Delete an import list

Parameters:

id (int) – Import list database id

Returns:

HTTP Response

Return type:

Response

del_indexer(id_: int) Response | dict[str, JsonDataType] | dict[Any, Any]

Removes a specific indexer from the blocklist

Parameters:

id (int) – indexer id from database

Returns:

HTTP Response

Return type:

Response

del_notification(id_: int) Response | dict[str, JsonDataType] | dict[Any, Any]

Delete a notification by its database id

Parameters:

id (int) – Database id of notification.

Returns:

HTTP Response

Return type:

Response

del_quality_profile(id_: int) Response | dict[str, JsonDataType] | dict[Any, Any]

Removes a specific quality profile from the blocklist

Parameters:

id (int) – Quality profile ID from database

Returns:

HTTP Response

Return type:

Response

del_queue(id_: int, remove_from_client: bool | None = None, blocklist: bool | None = None) Response | dict[str, JsonDataType] | dict[Any, Any]

Remove an item from the queue and blocklist it

Parameters:
  • id (int) – ID of the item to be removed

  • remove_from_client (Optional[bool], optional) – Remove the item from the client. Defaults to None.

  • blocklist (Optional[bool], optional) – Add the item to the blocklist. Defaults to None.

Returns:

HTTP Response

Return type:

Response

del_root_folder(id_: int) Response | dict[str, JsonDataType] | dict[Any, Any]

Delete root folder with specified id

Parameters:

id (int) – Root folder id from database

Returns:

HTTP Response

Return type:

Response

del_tag(id_: int) Response | dict[str, JsonDataType] | dict[Any, Any]

Delete the tag with the given ID

Parameters:

id (int) – Database id of tag

Returns:

HTTP Response

Return type:

Response

download_release(guid: str, indexer_id: int) dict[str, JsonDataType]
Adds a previously searched release to the download client, if the release is

still in Sonarr’s search cache (30 minute cache). If the release is not found in the cache Sonarr will return a 404.

Parameters:
  • guid (str) – Recently searched result guid

  • indexer_id (int) – Database id of indexer to use

Returns:

Dictionary with download release details

Return type:

JsonObject

get_backup() list[dict[str, JsonDataType]]

Returns the list of available backups

Returns:

List of dictionaries with items

Return type:

JsonArray

get_blocklist(page: int | None = None, page_size: int | None = None, sort_key: Literal['date'] | None = None, sort_dir: Literal['ascending', 'default', 'descending'] | None = None) dict[str, JsonDataType]

Returns blocked releases.

Parameters:
  • page (Optional[int], optional) – Page number to return. Defaults to None.

  • page_size (Optional[int], optional) – Number of items per page. Defaults to None.

  • sort_key (Optional[PyarrBlocklistSortKey], optional) – Field to sort by. Defaults to None.

  • sort_dir (Optional[PyarrSortDirection], optional) – Direction to sort the items. Defaults to None.

Returns:

Dictionary with items

Return type:

JsonObject

get_calendar(start_date: datetime | None = None, end_date: datetime | None = None, unmonitored: bool = True) list[dict[str, JsonDataType]]

Gets upcoming releases by monitored, if start/end are not supplied, today and tomorrow will be returned

Parameters:
  • start_date (Optional[str], optional) – ISO8601 start datetime. Defaults to None.

  • end_date (Optional[str], optional) – ISO8601 end datetime. Defaults to None.

  • unmonitored (bool, optional) – Include unmonitored movies. Defaults to True.

Returns:

List of dictionaries with items

Return type:

JsonArray

get_command(id_: int | None = None) list[dict[str, JsonDataType]] | dict[str, JsonDataType]

Queries the status of a previously started command, or all currently started commands.

Parameters:

id (Optional[int], optional) – Database ID of the command. Defaults to None.

Returns:

List of dictionaries with items

Return type:

Union[JsonArray, JsonObject]

get_config_download_client() dict[str, JsonDataType]

Gets download client page configuration

Returns:

Dictionary of configuration

Return type:

JsonObject

get_config_host() dict[str, JsonDataType]

Get General/Host settings.

Returns:

Dictionaries with items

Return type:

JsonObject

get_config_naming() dict[str, JsonDataType]

Get Settings for file and folder naming.

Returns:

Dictionary with items

Return type:

JsonObject

get_config_ui() dict[str, JsonDataType]

Query Radarr for UI configuration

Returns:

List of dictionaries with items

Return type:

JsonObject

get_disk_space() list[dict[str, JsonDataType]]
Query disk usage information

System > Status

Returns:

List of dictionaries with items

Return type:

JsonArray

get_download_client(id_: int | None = None) list[dict[str, JsonDataType]] | dict[str, JsonDataType]

Get a list of all the download clients or a single client by its database id

Parameters:

id (Optional[int], optional) – Download client database id. Defaults to None.

Returns:

List of dictionaries with items

Return type:

Union[JsonArray, JsonObject]

get_download_client_schema(implementation: Literal['Aria2', 'Deluge', 'TorrentDownloadStation', 'UsenetDownloadStation', 'Flood', 'Hadouken', 'Nzbget', 'NzbVortex', 'Pneumatic', 'QBittorrent', 'RTorrent', 'Sabnzbd', 'TorrentBlackhole', 'Transmission', 'UsenetBlackhole', 'UTorrent', 'Vuze'] | None = None) list[dict[str, JsonDataType]]

Gets the schemas for the different download Clients

Parameters:

implementation (Optional[PyarrDownloadClientSchema], optional) – Client implementation name. Defaults to None.

Returns:

List of dictionaries with items

Return type:

JsonArray

get_health() list[dict[str, JsonDataType]]

Get health information

Returns:

List of dictionaries with items

Return type:

JsonArray

get_import_list(id_: int | None = None) list[dict[str, JsonDataType]]

Query for all lists or a single list by its database id

Parameters:

id (Optional[int], optional) – Import list database id. Defaults to None.

Returns:

List of dictionaries with items

Return type:

JsonArray

get_import_list_schema(implementation: Literal['PlexImport', 'SonarrImport', 'TraktListImport', 'TraktPopularImport', 'TraktUserImport'] | Literal['LidarrImport', 'HeadphonesImport', 'LastFmTag', 'LastFmUser', 'LidarrLists', 'MusicBrainzSeries', 'SpotifyFollowedArtists', 'SpotifyPlaylist', 'SpotifySavedAlbums'] | None = None) list[dict[str, JsonDataType]]

Gets the schemas for the different import list sources

Parameters:

implementation (Optional[Union[PyarrImportListSchema, LidarrImportListSchema]], optional) – Client implementation name. Defaults to None.

Returns:

List of dictionaries with items

Return type:

JsonArray

get_indexer(id_: int | None = None) list[dict[str, JsonDataType]] | dict[Any, Any]

Get all indexers or specific by id

Parameters:

id (Optional[int], optional) – Database if of indexer to return. Defaults to None.

Returns:

List of dictionaries with items

Return type:

Union[JsonArray, dict[Any, Any]]

get_indexer_schema(implementation: Literal['FileList', 'HDBits', 'IPTorrents', 'Newznab', 'Nyaa', 'Omgwtfnzbs', 'PassThePopcorn', 'Rarbg', 'TorrentRssIndexer', 'TorrentPotato', 'Torznab'] | None = None) list[dict[str, JsonDataType]] | dict[str, JsonDataType]

Get possible indexer connections

Parameters:

implementation (Optional[PyarrIndexerSchema], optional) – indexer system

Returns:

List of dictionaries with items

Return type:

Union[JsonArray, JsonObject]

get_language(id_: int | None = None) list[dict[str, JsonDataType]] | dict[Any, Any]

Gets all language profiles or specific one with id

Note

This method is not working in Sonarr, use get_language_profile() I have raised this with the Sonarr team.

Parameters:

id (Optional[int], optional) – Language profile id from database. Defaults to None.

Returns:

List of dictionaries with items

Return type:

Union[JsonArray, dict[Any, Any]]

get_log(page: int | None = None, page_size: int | None = None, sort_key: Literal['Id', 'level', 'time', 'logger', 'message', 'exception', 'exceptionType'] | None = None, sort_dir: Literal['ascending', 'default', 'descending'] | None = None, filter_key: Literal['level'] | None = None, filter_value: Literal['all', 'info', 'warn', 'error'] | None = None) dict[str, JsonDataType]

Gets logs from instance

Parameters:
  • page (Optional[int], optional) – Specifiy page to return. Defaults to None.

  • page_size (Optional[int], optional) – Number of items per page. Defaults to None.

  • sort_key (Optional[PyarrLogSortKey], optional) – Field to sort by. Defaults to None.

  • sort_dir (Optional[PyarrSortDirection], optional) – Direction to sort. Defaults to None.

  • filter_key (Optional[PyarrFilterKey], optional) – Key to filter by. Defaults to None.

  • filter_value (Optional[PyarrFilterValue], optional) – Value of the filter. Defaults to None.

Returns:

List of dictionaries with items

Return type:

JsonObject

get_media_management() dict[str, JsonDataType]

Get media management configuration

Returns:

Dictionary with items

Return type:

JsonObject

get_metadata(id_: int | None = None) list[dict[str, JsonDataType]] | dict[str, JsonDataType]

Get all metadata consumer settings

Parameters:

id (Optional[int], optional) – ID for specific metadata record

Returns:

List of dictionaries with items

Return type:

Union[JsonArray, JsonObject]

get_notification(id_: int | None = None) list[dict[str, JsonDataType]] | dict[Any, Any]

Get a list of all notification services, or single by ID

Parameters:

id (Optional[int], optional) – Notification ID. Defaults to None.

Returns:

List of dictionaries with items

Return type:

Union[JsonArray, dict[Any, Any]]

get_notification_schema(implementation: Literal['Boxcar', 'CustomScript', 'Discord', 'Email', 'MediaBrowser', 'Gotify', 'Join', 'Xbmc', 'MailGun', 'PlexHomeTheater', 'PlexClient', 'PlexServer', 'Prowl', 'PushBullet', 'Pushover', 'SendGrid', 'Slack', 'SynologyIndexer', 'Telegram', 'Trakt', 'Twitter', 'Webhook'] | None = None) list[dict[str, JsonDataType]] | dict[str, JsonDataType]

Get possible notification connections

Parameters:

implementation (Optional[PyarrNotificationSchema], optional) – notification system

Returns:

List of dictionaries with items

Return type:

Union[JsonArray, JsonObject]

get_quality_definition(id_: int | None = None) list[dict[str, JsonDataType]] | dict[Any, Any]

Gets all quality definitions or specific one by ID

Parameters:

id (Optional[int], optional) – Import list database id. Defaults to None.

Returns:

List of dictionaries with items

Return type:

Union[JsonArray, dict[Any, Any]]

get_quality_profile(id_: int | None = None) list[dict[str, JsonDataType]] | dict[Any, Any]

Gets all quality profiles or specific one with id

Parameters:

id (Optional[int], optional) – Quality profile id from database. Defaults to None.

Returns:

List of dictionaries with items

Return type:

JsonArray

get_quality_profile_schema() list[dict[str, JsonDataType]]

Get the schemas for quality profiles

Returns:

List of dictionaries with items

Return type:

JsonArray

get_releases(id_: int | None = None) list[dict[str, JsonDataType]]

Query indexers for latest releases.

Parameters:

id (int) – Database id for episode to check

Returns:

List of dictionaries with items

Return type:

JsonArray

get_remote_path_mapping(id_: int | None = None) list[dict[str, JsonDataType]] | dict[Any, Any]

Get remote path mappings for downloads Directory

Parameters:

id (Optional[int], optional) – ID for specific record. Defaults to None.

Returns:

List of dictionaries with items

Return type:

JsonArray

get_root_folder(id_: int | None = None) list[dict[str, JsonDataType]] | dict[str, JsonDataType]

Get list of root folders, free space and any unmappedFolders

Parameters:

id (Optional[int], optional) – ID of the folder to return. Defaults to None.

Returns:

List of dictionaries with items

Return type:

Union[JsonArray, JsonObject]

get_system_status() dict[str, JsonDataType]

Gets system status

Returns:

Dictionary with items

Return type:

JsonObject

get_tag(id_: int | None = None) list[dict[str, JsonDataType]] | dict[str, JsonDataType]

Returns all tags or specific tag by database id

Parameters:

id (Optional[int], optional) – Database id for tag. Defaults to None.

Returns:

List of dictionaries with items

Return type:

Union[JsonArray, JsonObject]

get_tag_detail(id_: int | None = None) list[dict[str, JsonDataType]] | dict[str, JsonDataType]

Returns all tags or specific tag by database id with detailed information

Parameters:

id (Optional[int], optional) – Database id for tag. Defaults to None.

Returns:

List of dictionaries with items

Return type:

Union[JsonArray, JsonObject]

get_task(id_: int | None = None) dict[str, JsonDataType]

Return a list of tasks, or specify a task ID to return single task

Parameters:

id (Optional[int], optional) – ID for task. Defaults to None.

Returns:

List of dictionaries with items

Return type:

JsonObject

get_update() list[dict[str, JsonDataType]]

Will return a list of recent updated

Returns:

List of dictionaries with items

Return type:

JsonArray

push_release(title: str, download_url: str, protocol: str, publish_date: datetime) Any

If the title is wanted, Sonarr will grab it.

Parameters:
  • title (str) – Release name

  • download_url (str) – .torrent file URL

  • protocol (str) – β€œUsenet” or β€œTorrent

  • publish_date (datetime) – ISO8601 date

Returns:

Array

Return type:

JSON

upd_config_download_client(data: dict[str, JsonDataType]) dict[str, JsonDataType]

Update download client page configurations

Note

Recommended to be used in conjunction with get_config_download_client()

Parameters:

data (JsonObject) – data to be updated

Returns:

dictionary with updated items

Return type:

JsonObject

upd_config_host(data: dict[str, JsonDataType]) dict[str, JsonDataType]

Edit General/Host settings.

Parameters:

data (JsonObject) – data to be updated

Returns:

Dictionaries with items

Return type:

JsonObject

upd_config_naming(data: dict[str, JsonDataType]) dict[str, JsonDataType]

Edit Settings for file and folder naming.

Parameters:

data (JsonObject) – data to be updated

Returns:

Dictionary with items

Return type:

JsonObject

upd_config_ui(data: dict[str, JsonDataType]) dict[str, JsonDataType]

Edit one or many UI settings and save to to the database

Parameters:

data (JsonObject) – Data to be Updated.

Returns:

Dictionary with items

Return type:

JsonObject

upd_download_client(id_: int, data: dict[str, JsonDataType]) dict[str, JsonDataType]

Edit a downloadclient by database id

Parameters:
  • id (int) – Download client database id

  • data (JsonObject) – data to be updated within download client

Returns:

dictionary of updated item

Return type:

dict[str, v]

upd_import_list(id_: int, data: dict[str, JsonDataType]) dict[str, JsonDataType]

Edit an importlist

Parameters:
  • id (int) – Import list database id

  • data (JsonObject) – data to be updated within the import list

Returns:

Dictionary of updated data

Return type:

JsonObject

upd_indexer(id_: int, data: dict[str, JsonDataType]) dict[str, JsonDataType]

Edit a Indexer by database id

Note

To be used in conjunction with get_indexer()

Parameters:
  • id (int) – Indexer database id

  • data (JsonObject) – Data to be updated within Indexer

Returns:

Dictionary of updated record

Return type:

JsonObject

upd_media_management(data: dict[str, JsonDataType]) dict[str, JsonDataType]

Get media management configuration

Note

Recommended to use with get_media_management()

Parameters:

data (JsonObject) – data to be updated

Returns:

Dictionary with items

Return type:

JsonObject

upd_notification(id_: int, data: dict[str, JsonDataType]) dict[str, JsonDataType]

Edit notification by database id

Parameters:
  • id (int) – Database id of notification

  • data (JsonObject) – data that requires updating

Returns:

Dictionary of updated record

Return type:

JsonObject

upd_quality_definition(id_: int, data: dict[str, JsonDataType]) dict[str, JsonDataType]

Update the quality definitions.

Note

To be used in conjunction with get_quality_definition()

Parameters:
  • id (int) – ID of definition to update

  • data (JsonObject) – All parameters to update

Returns:

Dictionary of updated record

Return type:

JsonObject

upd_quality_profile(id_: int, data: dict[str, JsonDataType]) dict[str, JsonDataType]

Update the quality profile data

Note

To be used in conjunction with get_quality_profile()

Parameters:
  • id (int) – Profile ID to Update

  • data (JsonObject) – All parameters to update

Returns:

Dictionary of updated record

Return type:

JsonObject

upd_tag(id_: int, label: str) dict[str, JsonDataType]

Update an existing tag

Note

You should perform a get_tag() and submit the full body with changes

Parameters:
  • id (int) – Database id of tag

  • label (str) – tag name / label

Returns:

Dictionary of updated items

Return type:

JsonObject