Skip to content

Commit

Permalink
fix unsupported operand type(s) for //: 'str' and 'int'
Browse files Browse the repository at this point in the history
  • Loading branch information
vltclz committed Feb 24, 2024
1 parent efa4823 commit b82a870
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions instagrapi/extractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,9 @@ def extract_direct_thread(data):
if "inviter" in data:
data["inviter"] = extract_user_short(data["inviter"])
data["left_users"] = data.get("left_users", [])
data["last_activity_at"] = datetime.datetime.fromtimestamp(data["last_activity_at"] // 1_000_000)
data["last_activity_at"] = datetime.datetime.fromtimestamp(
data["last_activity_at"] // 1_000_000
)
return DirectThread(**data)


Expand Down Expand Up @@ -334,8 +336,10 @@ 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
)
data["user_id"] = str(data.get("user_id", ""))

return DirectMessage(**data)

Expand Down

0 comments on commit b82a870

Please sign in to comment.