Skip to content

Extend Instagram GraphQL scheme with bio links, tagged usernames, post count - #262

Merged
soxoj merged 1 commit into
soxoj:masterfrom
tgalery:instagram-bio-links-tagged-usernames
Jul 14, 2026
Merged

Extend Instagram GraphQL scheme with bio links, tagged usernames, post count#262
soxoj merged 1 commit into
soxoj:masterfrom
tgalery:instagram-bio-links-tagged-usernames

Conversation

@tgalery

@tgalery tgalery commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Context

soxoj/maigret#2848 reported that socid_extractor.extract() returns {} for Instagram's web_profile_info API response — no bio, links, or tagged usernames extracted despite a fully populated JSON response — and added a maigret-side fallback parser to work around it.

Root cause

That maigret PR predates the Instagram GraphQL scheme added here in #253, which already matches this exact response shape (data.user, flagged on "biography"/"edge_followed_by"/"profile_pic_url_hd"). The scheme just didn't extract bio_links, tagged usernames from biography_with_entities, or the post count.

Fix

Extend the existing Instagram GraphQL scheme (socid_extractor/schemes.py) with:

  • links — URLs from bio_links
  • usernames — tagged usernames from biography_with_entities.entities
  • post_count — from edge_owner_to_timeline_media

No new scheme needed; upgrading socid_extractor should let maigret drop its fallback.

Test plan

  • Added test_instagram_graphql_bio_links_and_tagged_usernames (synthetic fixture, no network) covering the new fields
  • pytest tests/ -m "not github_failed and not rate_limited" passes (pre-existing unrelated failures: cookie fixture paths, snapchat encoding)

…t count

maigret PR soxoj/maigret#2848 reported that extract() returns {} for
Instagram's web_profile_info response, because their release predates
the "Instagram GraphQL" scheme (added in soxoj#253) that already parses this
exact JSON shape. That scheme was missing bio_links, tagged usernames
from biography_with_entities, and the post count, so upgrading
socid_extractor picks up the missing fields without maigret needing its
own fallback parser.
@soxoj

soxoj commented Jul 14, 2026

Copy link
Copy Markdown
Owner

@tgalery great job! Thank you! 🔥 🚀

@tgalery

tgalery commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

CI failure on attempt 1 (test_medium) is unrelated to this change — a transient JSONDecodeError from a live network fetch in an existing e2e test that doesn't touch schemes.py's Instagram scheme. Re-run (attempt 2, same commit) passed clean: 154 passed, 0 failed, across Python 3.10–3.14.

@soxoj
soxoj merged commit 0fbd297 into soxoj:master Jul 14, 2026
9 of 10 checks passed
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.

2 participants