Extend Instagram GraphQL scheme with bio links, tagged usernames, post count - #262
Merged
Merged
Conversation
…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.
Owner
|
@tgalery great job! Thank you! 🔥 🚀 |
Contributor
Author
|
CI failure on attempt 1 ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
soxoj/maigret#2848 reported that
socid_extractor.extract()returns{}for Instagram'sweb_profile_infoAPI 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 GraphQLscheme 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 extractbio_links, tagged usernames frombiography_with_entities, or the post count.Fix
Extend the existing
Instagram GraphQLscheme (socid_extractor/schemes.py) with:links— URLs frombio_linksusernames— tagged usernames frombiography_with_entities.entitiespost_count— fromedge_owner_to_timeline_mediaNo new scheme needed; upgrading
socid_extractorshould let maigret drop its fallback.Test plan
test_instagram_graphql_bio_links_and_tagged_usernames(synthetic fixture, no network) covering the new fieldspytest tests/ -m "not github_failed and not rate_limited"passes (pre-existing unrelated failures: cookie fixture paths, snapchat encoding)