Skip to content

Commit

Permalink
Merge branch 'add-coauthors'
Browse files Browse the repository at this point in the history
  • Loading branch information
andersgb1 committed Mar 26, 2024
2 parents ecab86b + 9a57e4f commit 0129aa1
Show file tree
Hide file tree
Showing 2 changed files with 13 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,
)
1 change: 1 addition & 0 deletions ensta/containers/Post.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 0129aa1

Please sign in to comment.