From: Harmon Date: Sat, 1 Jan 2022 14:35:17 +0000 (-0600) Subject: Add Media.url X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=9ade476e5dad2e5a806bd68f89afa9725bfb6969;p=tweepy.git Add Media.url Resolves #1722 --- diff --git a/tweepy/media.py b/tweepy/media.py index aec6435..6e49b10 100644 --- a/tweepy/media.py +++ b/tweepy/media.py @@ -10,7 +10,7 @@ class Media(DataMapping): __slots__ = ( "data", "media_key", "type", "duration_ms", "height", "non_public_metrics", "organic_metrics", "preview_image_url", - "promoted_metrics", "public_metrics", "width", "alt_text" + "promoted_metrics", "public_metrics", "width", "alt_text", "url" ) def __init__(self, data): @@ -28,6 +28,9 @@ class Media(DataMapping): self.width = data.get("width") self.alt_text = data.get("alt_text") + # https://twittercommunity.com/t/documentation-for-media-object-missing-url-field/163062 + self.url = data.get("url") + def __eq__(self, other): if isinstance(other, self.__class__): return self.media_key == other.media_key