libWiiPy.title.nus Module#
Description#
The libWiiPy.title.nus
module provides support for downloading digital Wii titles from the Nintendo Update Servers. This module provides easy methods for downloading TMDs, common Tickets (when present), encrypted content, and the certificate chain.
Module Contents#
- class libWiiPy.title.nus.DownloadCallback(*args, **kwargs)#
Bases:
Protocol
The format of a callable passed to a NUS download function.
- __call__(done: int, total: int) Any #
This function will be called with the current number of bytes downloaded and the total size of the file being downloaded.
- Parameters:
done (int) – The number of bytes already downloaded.
total (int) – The total size of the file being downloaded.
- libWiiPy.title.nus.download_cert_chain(wiiu_endpoint: bool = False, endpoint_override: str | None = None) bytes #
Downloads the signing certificate chain used by all WADs. This uses System Menu 4.3U as the source.
- Parameters:
wiiu_endpoint (bool, option) – Whether the Wii U endpoint for the NUS should be used or not. This increases download speeds. Defaults to False.
endpoint_override (str, optional) – A custom endpoint URL to use instead of the standard Wii or Wii U endpoints. Defaults to no override, and if set entirely overrides the “wiiu_endpoint” parameter.
- Returns:
The cert file.
- Return type:
bytes
- libWiiPy.title.nus.download_content(title_id: str, content_id: int, wiiu_endpoint: bool = False, endpoint_override: str | None = None, progress: ~libWiiPy.title.nus.DownloadCallback = <function <lambda>>) bytes #
Downloads a specified content for the title specified in the object.
- Parameters:
title_id (str) – The Title ID of the title to download content from.
content_id (int) – The Content ID of the content you wish to download.
wiiu_endpoint (bool, option) – Whether the Wii U endpoint for the NUS should be used or not. This increases download speeds. Defaults to False.
endpoint_override (str, optional) – A custom endpoint URL to use instead of the standard Wii or Wii U endpoints. Defaults to no override, and if set entirely overrides the “wiiu_endpoint” parameter.
progress (DownloadCallback, optional) – A callback function used to return the progress of the download. The provided callable must match the signature defined in DownloadCallback.
- Returns:
The downloaded content.
- Return type:
bytes
See also
- libWiiPy.title.nus.download_contents(title_id: str, tmd: ~libWiiPy.title.tmd.TMD, wiiu_endpoint: bool = False, endpoint_override: str | None = None, progress: ~libWiiPy.title.nus.DownloadCallback = <function <lambda>>) List[bytes] #
Downloads all the contents for the title specified in the object. This requires a TMD to already be available so that the content records can be accessed.
- Parameters:
title_id (str) – The Title ID of the title to download content from.
tmd (TMD) – The TMD that matches the title that the contents being downloaded are from.
wiiu_endpoint (bool, option) – Whether the Wii U endpoint for the NUS should be used or not. This increases download speeds. Defaults to False.
endpoint_override (str, optional) – A custom endpoint URL to use instead of the standard Wii or Wii U endpoints. Defaults to no override, and if set entirely overrides the “wiiu_endpoint” parameter.
progress (DownloadCallback, optional) – A callback function used to return the progress of the downloads. The provided callable must match the signature defined in DownloadCallback.
- Returns:
A list of all the downloaded contents.
- Return type:
List[bytes]
See also
- libWiiPy.title.nus.download_ticket(title_id: str, wiiu_endpoint: bool = False, endpoint_override: str | None = None, progress: ~libWiiPy.title.nus.DownloadCallback = <function <lambda>>) bytes #
Downloads the Ticket of the Title specified in the object. This will only work if the Title ID specified is for a free title.
- Parameters:
title_id (str) – The Title ID of the title to download the Ticket for.
wiiu_endpoint (bool, option) – Whether the Wii U endpoint for the NUS should be used or not. This increases download speeds. Defaults to False.
endpoint_override (str, optional) – A custom endpoint URL to use instead of the standard Wii or Wii U endpoints. Defaults to no override, and if set entirely overrides the “wiiu_endpoint” parameter.
progress (DownloadCallback, optional) – A callback function used to return the progress of the download. The provided callable must match the signature defined in DownloadCallback.
- Returns:
The Ticket file from the NUS.
- Return type:
bytes
See also
- libWiiPy.title.nus.download_title(title_id: str, title_version: int | None = None, wiiu_endpoint: bool = False, endpoint_override: str | None = None, progress: ~libWiiPy.title.nus.DownloadCallback = <function <lambda>>) Title #
Download an entire title and all of its contents, then load the downloaded components into a Title object for further use. This method is NOT recommended for general use, as it has extremely limited verbosity. It is instead recommended to call the individual download methods instead to provide more flexibility and output.
Be aware that you will receive fairly vague feedback from this function if you attach a progress callback. The callback will be connected to each of the individual functions called by this function, but there will be no indication of which function is currently running, just the progress of its download.
- Parameters:
title_id (str) – The Title ID of the title to download.
title_version (int, optional) – The version of the title to download. Defaults to latest if not set.
wiiu_endpoint (bool, optional) – Whether the Wii U endpoint for the NUS should be used or not. This increases download speeds. Defaults to False.
endpoint_override (str, optional) – A custom endpoint URL to use instead of the standard Wii or Wii U endpoints. Defaults to no override, and if set entirely overrides the “wiiu_endpoint” parameter.
progress (DownloadCallback, optional) – A callback function used to return the progress of the downloads. The provided callable must match the signature defined in DownloadCallback.
- Returns:
A Title object containing all the data from the downloaded title.
- Return type:
See also
- libWiiPy.title.nus.download_tmd(title_id: str, title_version: int | None = None, wiiu_endpoint: bool = False, endpoint_override: str | None = None, progress: ~libWiiPy.title.nus.DownloadCallback = <function <lambda>>) bytes #
Downloads the TMD of the Title specified in the object. Will download the latest version by default, or another version if it was manually specified in the object.
- Parameters:
title_id (str) – The Title ID of the title to download the TMD for.
title_version (int, option) – The version of the TMD to download. Defaults to latest if not set.
wiiu_endpoint (bool, option) – Whether the Wii U endpoint for the NUS should be used or not. This increases download speeds. Defaults to False.
endpoint_override (str, optional) – A custom endpoint URL to use instead of the standard Wii or Wii U endpoints. Defaults to no override, and if set entirely overrides the “wiiu_endpoint” parameter.
progress (DownloadCallback, optional) – A callback function used to return the progress of the download. The provided callable must match the signature defined in DownloadCallback.
- Returns:
The TMD file from the NUS.
- Return type:
bytes
See also