Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/pip/mkdocs-minify-plugin-0.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
subzeroid authored Feb 26, 2024
2 parents 551daed + 246d0de commit 216ce5f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
13 changes: 9 additions & 4 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 @@ -332,8 +334,7 @@ def extract_direct_message(data):
if xma_media_share:
data["xma_share"] = extract_media_v1_xma(xma_media_share[0])

data['timestamp'] = datetime.datetime.fromtimestamp(data['timestamp'] // 1_000_000)
data['user_id'] = str(data['user_id'])
data['timestamp'] = datetime.datetime.fromtimestamp(int(data['timestamp']) // 1_000_000)

return DirectMessage(**data)

Expand Down Expand Up @@ -393,8 +394,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 requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ isort==5.13.2
bandit==1.7.7
mike==2.0.0
markdown-include==0.8.1
mkdocs-material==9.5.5
mkdocs-material==9.5.10
mkdocs-minify-plugin==0.8.0
mkdocstrings==0.24.0
./util/mkdocs-redirects
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
requests==2.31.0
PySocks==1.7.1
pydantic==2.5.3
pydantic==2.6.2
moviepy==1.0.3
pycryptodomex==3.20.0
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
requirements = [
"requests<3.0,>=2.25.1",
"PySocks==1.7.1",
"pydantic==2.5.3",
"pydantic==2.6.2",
"pycryptodomex==3.20.0",
]
# requirements = [
Expand All @@ -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 216ce5f

Please sign in to comment.