Skip to content

fix: restore public media GraphQL lookup#2711

Merged
subzeroid merged 2 commits into
masterfrom
fix/public-gql-2710
Jun 30, 2026
Merged

fix: restore public media GraphQL lookup#2711
subzeroid merged 2 commits into
masterfrom
fix/public-gql-2710

Conversation

@subzeroid

Copy link
Copy Markdown
Owner

Summary

  • Restores anonymous public media_info_gql fallback for Instagram's current web GraphQL response.
  • Adds /api/graphql doc_id support with LSD bootstrap for public web requests.
  • Normalizes xdt_api__v1__media__shortcode__web_info.items[0] media payloads through the existing v1 extractor.
  • Raises a ClientGraphqlError instead of leaking AttributeError when doc_id GraphQL returns data: null.

Closes #2710

Pre-Landing Review

No issues found after checklist review. One stale docstring was corrected before commit.

Test plan

  • uv run --extra test pytest -q tests/regression/test_public.py::PublicRegressionTestCase tests/regression/test_media.py::UserMediasGraphQLRegressionTestCase (19 passed)
  • uv run --extra test ruff check --output-format=github instagrapi/mixins/public.py instagrapi/mixins/media.py tests/regression/test_public.py
  • uv run --extra test ruff format --check instagrapi/mixins/public.py instagrapi/mixins/media.py tests/regression/test_public.py (3 files already formatted)
  • Live repro: Client().media_info_gql(Client().media_pk_from_url("https://www.instagram.com/reels/DaHEdwgogl4/")) returned Media with video_url=True and thumbnail_url=True.

@subzeroid
subzeroid merged commit 110fece into master Jun 30, 2026
12 checks passed
@subzeroid
subzeroid deleted the fix/public-gql-2710 branch June 30, 2026 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] public GQL fails

1 participant