Skip to content

Commit

Permalink
fix in the Location.py location_medias_v1_chunk() function. use nativ…
Browse files Browse the repository at this point in the history
…e instagram param "max_id"
  • Loading branch information
mur-28 committed Sep 25, 2023
1 parent 57fd719 commit 5112f7f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions instagrapi/mixins/location.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,10 @@ def location_medias_v1_chunk(
}
if max_id:
try:
[page_id, nm_ids] = json.loads(base64.b64decode(max_id))
[m_id, page_id, nm_ids] = json.loads(base64.b64decode(max_id))
except Exception:
raise WrongCursorError()
data["max_id"] = m_id
data["page"] = page_id
data["next_media_ids"] = nm_ids
medias = []
Expand All @@ -318,7 +319,8 @@ def location_medias_v1_chunk(
if result.get("next_page"):
np = result.get("next_page")
ids = result.get("next_media_ids")
next_max_id = base64.b64encode(json.dumps([np, ids]).encode()).decode()
next_m_id = result.get("next_max_id")
next_max_id = base64.b64encode(json.dumps([next_m_id, np, ids]).encode()).decode()
for section in result.get("sections") or []:
layout_content = section.get("layout_content") or {}
nodes = layout_content.get("medias") or []
Expand Down

0 comments on commit 5112f7f

Please sign in to comment.