From a23b832a694a63d49a0e0ca646a282a333c9d19f Mon Sep 17 00:00:00 2001 From: Alexander Graf <17130992+aandergr@users.noreply.github.com> Date: Fri, 12 Nov 2021 21:41:40 +0100 Subject: [PATCH] Add Post.accessibility_caption property --- instaloader/structures.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/instaloader/structures.py b/instaloader/structures.py index 2959f76..5b981a3 100644 --- a/instaloader/structures.py +++ b/instaloader/structures.py @@ -397,6 +397,16 @@ class Post: return (pcaption[:30] + u"\u2026") if len(pcaption) > 31 else pcaption return _elliptify(self.caption) if self.caption else '' + @property + def accessibility_caption(self) -> Optional[str]: + """Accessibility caption of the post, if available. + + .. versionadded:: 4.9""" + try: + return self._field("accessibility_caption") + except KeyError: + return None + @property def tagged_users(self) -> List[str]: """List of all lowercased users that are tagged in the Post."""