From 11a4debc5e0cdce161f4fce3c3335a05e1600aed Mon Sep 17 00:00:00 2001 From: Devesh Pal Date: Thu, 9 Jun 2022 16:01:19 +0530 Subject: [PATCH] Add missing variant to Media Object --- tweepy/media.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tweepy/media.py b/tweepy/media.py index 7351dde..1729a2c 100644 --- a/tweepy/media.py +++ b/tweepy/media.py @@ -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 ---------- @@ -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): @@ -87,6 +91,7 @@ class Media(DataMapping): 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__): -- 2.25.1