Skip to content

Commit

Permalink
Merge pull request #1785 from DZeitounPEReN/extract_story
Browse files Browse the repository at this point in the history
Filling hashtags/locations in extract_story_v1
  • Loading branch information
subzeroid authored Feb 1, 2024
2 parents 1d88728 + cbc4378 commit e080e28
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
10 changes: 8 additions & 2 deletions instagrapi/extractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
StoryLink,
StoryMedia,
StoryMention,
StoryLocation,
StoryHashtag,
Track,
User,
UserShort,
Expand Down Expand Up @@ -393,8 +395,12 @@ def extract_story_v1(data):
story["mentions"] = [
StoryMention(**mention) for mention in story.get("reel_mentions", [])
]
story["locations"] = []
story["hashtags"] = []
story["locations"] = [
StoryLocation(**location) for location in story.get("story_locations", [])
]
story["hashtags"] = [
StoryHashtag(**hashtag) for hashtag in story.get("story_hashtags", [])
]
story["stickers"] = data.get("story_link_stickers") or []
feed_medias = []
story_feed_medias = data.get("story_feed_media") or []
Expand Down
4 changes: 3 additions & 1 deletion instagrapi/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ class StoryMention(TypesBaseModel):
y: Optional[float] = None
width: Optional[float] = None
height: Optional[float] = None
rotation: Optional[float] = None


class StoryMedia(TypesBaseModel):
Expand Down Expand Up @@ -241,14 +242,15 @@ class StoryHashtag(TypesBaseModel):
y: Optional[float] = None
width: Optional[float] = None
height: Optional[float] = None

rotation: Optional[float] = None

class StoryLocation(TypesBaseModel):
location: Location
x: Optional[float] = None
y: Optional[float] = None
width: Optional[float] = None
height: Optional[float] = None
rotation: Optional[float] = None


class StoryStickerLink(TypesBaseModel):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

setup(
name="instagrapi",
version="2.0.3",
version="2.0.4",
author="Mark Subzeroid",
author_email="[email protected]",
license="MIT",
Expand Down

0 comments on commit e080e28

Please sign in to comment.