From fd6389249cd6faa19aff6e7351554908891feb4c Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Tue, 13 Mar 2018 16:19:26 +0100 Subject: [PATCH] Describe return type of Post.get_{likes,comments} --- instaloader.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/instaloader.py b/instaloader.py index 7584a0a..4285244 100755 --- a/instaloader.py +++ b/instaloader.py @@ -364,7 +364,11 @@ class Post: return self._field('edge_media_to_comment', 'count') def get_comments(self) -> Iterator[Dict[str, Any]]: - """Iterate over all comments of the post.""" + """Iterate over all comments of the post. + + Each comment is represented by a dictionary having the keys text, created_at, id and owner, which is a + dictionary with keys username, profile_pic_url and id. + """ if self.comments == 0: # Avoid doing additional requests if there are no comments return @@ -377,7 +381,11 @@ class Post: lambda d: d['data']['shortcode_media']['edge_media_to_comment']) def get_likes(self) -> Iterator[Dict[str, Any]]: - """Iterate over all likes of the post.""" + """Iterate over all likes of the post. + + Each like is represented by a dictionary having the keys username, followed_by_viewer, id, is_verified, + requested_by_viewer, followed_by_viewer, profile_pic_url. + """ if self.likes == 0: # Avoid doing additional requests if there are no comments return