Skip to content

Commit

Permalink
Add co-authors to posts/reels
Browse files Browse the repository at this point in the history
  • Loading branch information
andersgb1 committed Mar 26, 2024
1 parent ecab86b commit 9121294
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion ensta/Guest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
)

0 comments on commit 9121294

Please sign in to comment.