Skip to content

miniproto.media.download.download_media

download_media(invoke: RawInvoker, media: object, destination: Destination = None, **kwargs: Any) -> MediaDownloadResult

Resolve media and materialize it through :func:download_file.

Parameters:

  • invoke (RawInvoker) – Async raw-RPC invoker used for file requests.
  • media (object) – A :class:Media, file ID, raw document/photo/message, or input file location.
  • destination (Destination) – In-memory, path, or binary-stream destination forwarded to :func:download_file.
  • kwargs (Any) – Remaining forwarded **kwargs download options; cache identity and total size are inferred when possible.

Returns:

  • MediaDownloadResult – The same result and destination-ownership semantics as :func:download_file.

Raises: