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