PostMedia

class praw.models.PostMedia(fp, /, name=None)

Media to be uploaded as part of a submission.

See Subreddit.submit_image(), Subreddit.submit_gallery(), Subreddit.submit_video(), and InlineMedia.

Parameters:
__init__(fp, /, name=None)

Initialize a Media instance.

Parameters:
  • fp (str | bytes) – The path to a media file as a string, or the content of a media file as a bytes object.

  • name (str | None) – The name of the media file, e.g., "picture.png". The name is used to infer the media’s MIME type. When fp is a path the name is derived from it, otherwise this parameter is required.

Return type:

None