Skip to content

Commit

Permalink
Merge pull request #1910 from New-dev0/patch-1
Browse files Browse the repository at this point in the history
Add missing "variants" to Media Object
  • Loading branch information
Harmon758 committed Oct 27, 2022
2 parents 2b1e159 + c5a5e7f commit d39847e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tweepy/media.py
Expand Up @@ -60,6 +60,9 @@ class Media(DataMapping):
A description of an image to enable and support accessibility. Can be
up to 1000 characters long. Alt text can only be added to images at the
moment.
variants: list[dict] | None
Each media object may have multiple display or playback variants,
with different resolutions or formats
References
----------
Expand All @@ -70,6 +73,7 @@ class Media(DataMapping):
"data", "media_key", "url", "type", "duration_ms", "height",
"non_public_metrics", "organic_metrics", "preview_image_url",
"promoted_metrics", "public_metrics", "width", "alt_text",
"variants"
)

def __init__(self, data):
Expand All @@ -87,6 +91,7 @@ def __init__(self, data):
self.public_metrics = data.get("public_metrics")
self.width = data.get("width")
self.alt_text = data.get("alt_text")
self.variants = data.get("variants")

def __eq__(self, other):
if isinstance(other, self.__class__):
Expand Down

0 comments on commit d39847e

Please sign in to comment.