pycliarr.api.radarr module¶
-
class
pycliarr.api.radarr.
RadarrCli
(*args, default_root_folder_id: int = 0, **kwargs)[source]¶ Bases:
pycliarr.api.base_media.BaseCliMediaApi
Radar api client.
- Radarr API reference:
- https://github.com/Radarr/Radarr/wiki/API https://pub.dev/packages/radarr
Note
Not all commands are implemented. Some commands available are implemented in BaseCliMediaApi: * get_calendar * get_command * get_quality_profiles * rename_files * get_disk_space * get_system_status * get_queue * delete_queue * get_history * get_logs * get_wanted * get_blocklist * delete_blocklist
-
add_movie
(quality: int, tmdb_id: Optional[int] = None, imdb_id: Optional[str] = None, movie_info: Optional[pycliarr.api.radarr.RadarrMovieItem] = None, monitored: bool = True, search: bool = True, path: Optional[str] = None, root_id: int = 0) → Union[Dict[str, Any], List[Dict[str, Any]]][source]¶ addMovie adds a new movie to collection.
The movie description movie_info must be specified. If the IMDB or TMDB id is provided instead, it will be used to fetch the required movie description from TMDB.
Parameters: - quality – Quality profile to use, as retrieved by get_quality_profiles()
- imdbp_id (Optional[int]) – IMDB id of the movie to add
- tmdb_id (Optional[int]) – TMDB id of the movie to add
- movie_info (Optional[RadarrMovieItem]) – Description of the movie to add
- monitored (bool) – Whether to monitor the movie. Default is True
- search (bool) – Whether to search for the movie once added. Default is True
- path (Optional[str]) – Specify the path awhere the movie should be stored. Default is root[0]/<movie name> (<movie year>).
- root_id (Optional[int]) – Specify the root folder to use. Ignored if a path is specified. Default is root[0].
Returns: json response
-
api_url_exclusions
= '/api/v3/exclusions'¶
-
api_url_item
= '/api/v3/movie'¶
-
api_url_itemlookup
= '/api/v3/movie/lookup'¶
-
api_url_wanted_missing
= '/api/wanted/missing'¶
-
build_movie_path
(movie_info: pycliarr.api.radarr.RadarrMovieItem, root_folder_id: int = 0) → pathlib.Path[source]¶ Build a movie folder path using the root folder specified. :param serie_info: :type serie_info: SonarrSerieItem :param root_folder_id: Id of the root folder (can be retrieved with get_root_folder()) :type root_folder_id: int :param If the id is not found or not specified, the first root folder in the list is used.:
Returns: Full path of the serie in the format <root path>/<movie name> (<movie year>)
-
create_exclusion
(title: str, tmdb_id: int, year: int) → Union[Dict[str, Any], List[Dict[str, Any]]][source]¶ Create the specified exclusions
Parameters: item_id (int) – id of the exclusions to create Returns: json response
-
delete_movie
(movie_id: int, delete_files: bool = True, add_exclusion: bool = False) → Union[Dict[str, Any], List[Dict[str, Any]]][source]¶ Delete the movie with the given ID
Parameters: - movie_id (int) – Movie to delete
- delete_files (bool) – Optional. Also delete files. Default is True
- add_exclusion – Optionally exclude the movie from further imdb/tmdb auto add
Returns: json response
-
edit_movie
(movie_info: pycliarr.api.radarr.RadarrMovieItem, move_files: bool = False) → Union[Dict[str, Any], List[Dict[str, Any]]][source]¶ Edit a movie from the collection.
The movie description movie_info must be specified, usually by getting the information from get_movie()
Parameters: - movie_info (Optional[RadarrMovieItem]) – Description of the movie to edit
- move_files (bool) – Whether to move files after edition. Default is False
Returns: json response
-
get_movie
(movie_id: Optional[int] = None) → Union[pycliarr.api.radarr.RadarrMovieItem, List[pycliarr.api.radarr.RadarrMovieItem]][source]¶ Get specified movie, or all if no id provided from server collection.
Parameters: movie_id (Optional[int]) – Returns: RadarrMovieItem
if a movie id is specified, or a list ofRadarrMovieItem
-
get_queue
(page: int = 1, sort_key: str = 'progress', page_size: int = 20, sort_dir: str = 'ascending', include_unknown: bool = True) → Union[Dict[str, Any], List[Dict[str, Any]]][source]¶ Get queue info (downloading/completed, ok/warning) as json
Parameters: - page (int) - 1-indexed (1 default) –
- sort_key (string) –
- page_size (int) – 10
- sort_dir (string) – asc
- options (Dict[str, Any]={}) – Optional additional options
-
lookup_movie
(term: Optional[str] = None, imdb_id: Optional[str] = None, tmdb_id: Optional[int] = None) → Union[pycliarr.api.radarr.RadarrMovieItem, List[pycliarr.api.radarr.RadarrMovieItem], None][source]¶ Search for a movie based on keyword, or imbd/tmdb id.
If no imdb id is provided, tvdb id will be used. If neither of them is provided, the keyword will be used. One of
term
,imdb_id
, ortmdb_id
must be specified.Parameters: - term (Optional[str]) – Keywords to seach for
- imdb_id (Optional[str]) – IMDB movie id
- tmdb_id (Optional[int]) – TMDB movie id
Returns: json response
-
missing_movies_search
() → Union[Dict[str, Any], List[Dict[str, Any]]][source]¶ Search for missing movies. :returns: json response
-
class
pycliarr.api.radarr.
RadarrMovieItem
(**kwargs)[source]¶ Bases:
pycliarr.api.base_api.BaseCliApiItem
Class for handling movie info.