diff --git a/ensta/Guest.py b/ensta/Guest.py index ab67d3c..5692059 100644 --- a/ensta/Guest.py +++ b/ensta/Guest.py @@ -443,6 +443,16 @@ def __process_post_data(data: dict, reel: bool = False) -> Post: latest_reel_media=user_data.get("latest_reel_media", 0) ) + coauthors = [] + for coauthor in data.get("coauthor_producers", []): + coauthors.append( + { + "uid": coauthor.get("pk", ""), + "username": coauthor.get("username", ""), + "full_name": coauthor.get("full_name", ""), + } + ) + return Post( share_url=f"https://www.instagram.com/reel/{data.get('code', '')}" if reel @@ -482,5 +492,6 @@ def __process_post_data(data: dict, reel: bool = False) -> Post: explore_hide_comments=data.get("explore_hide_comments", False), has_delayed_metadata=data.get("has_delayed_metadata", False), location_latitude=data.get("lat", 0), - location_longitude=data.get("lng", 0) + location_longitude=data.get("lng", 0), + coauthors=coauthors, ) diff --git a/ensta/containers/Post.py b/ensta/containers/Post.py index ed5a691..0453805 100644 --- a/ensta/containers/Post.py +++ b/ensta/containers/Post.py @@ -41,3 +41,4 @@ class Post: has_delayed_metadata: bool = False location_latitude: float = 0 location_longitude: float = 0 + coauthors: list[dict] = field(default_factory=list)