Media¶
- class praw.models.Media(fp, /, name=None)¶
Base class representing media that can be uploaded to Reddit.
Use one of the subclasses, e.g.,
EmojiMediaorPostMedia, depending on what the media is being uploaded for.- __init__(fp, /, name=None)¶
Initialize a
Mediainstance.- Parameters:
fp (
str|bytes) – The path to a media file as a string, or the content of a media file as abytesobject.name (
str|None) – The name of the media file, e.g.,"picture.png". The name is used to infer the media’s MIME type. Whenfpis a path the name is derived from it, otherwise this parameter is required.
- Return type:
None