diff --git a/instaloader/__init__.py b/instaloader/__init__.py index 5dd58e2..eed35c9 100644 --- a/instaloader/__init__.py +++ b/instaloader/__init__.py @@ -14,4 +14,4 @@ else: from .exceptions import * from .instaloader import Instaloader, Tristate -from .structures import Post, Profile, shortcode_to_mediaid, mediaid_to_shortcode +from .structures import Post, Profile, Story, StoryItem, shortcode_to_mediaid, mediaid_to_shortcode diff --git a/instaloader/structures.py b/instaloader/structures.py index 910177f..68c1262 100644 --- a/instaloader/structures.py +++ b/instaloader/structures.py @@ -618,6 +618,7 @@ class Story: self._context = context self._node = node self._unique_id = None + self._owner_profile = None def __repr__(self): return ''.format(self.owner_username, self.latest_media_utc) @@ -672,7 +673,9 @@ class Story: @property def owner_profile(self) -> Profile: """:class:`Profile` instance of the story owner.""" - return Profile(self._context, self._node['user']) + if not self._owner_profile: + self._owner_profile = Profile(self._context, self._node['user']) + return self._owner_profile @property def owner_username(self) -> str: