Fix: Update Instagram detection logic#2903
Open
Sumit0x00 wants to merge 1 commit intosherlock-project:masterfrom
Open
Fix: Update Instagram detection logic#2903Sumit0x00 wants to merge 1 commit intosherlock-project:masterfrom
Sumit0x00 wants to merge 1 commit intosherlock-project:masterfrom
Conversation
Contributor
Automatic validation of changes
Failures were detected on at least one updated target. Commits containing accuracy failures will often not be merged (unless a rationale is provided, such as false negatives due to regional differences). |
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.
This PR fixes the broken Instagram detection which was causing false negatives (existing accounts reported as "Not Found").
Problem
Proxy Blocked: The previous implementation relied on imginn.com, which is currently returning a 403 (Cloudflare challenge) for automated requests.
Soft 404s: Direct probes to instagram.com return a 200 OK status for both existing and non-existing accounts.
UA Sensitivity: Standard desktop User-Agents often lead to a generic login wall, making it impossible to differentiate account existence via HTTP headers.
Solution
Switched to Message Detection: Changed errorType from status_code to message.
Mobile User-Agent: Updated headers to use a Mobile (iPhone) User-Agent. My testing confirmed that Instagram serves unique <title> tags for existing profiles when queried with a mobile UA, even without a session.
Error Patterns: Added detection patterns for non-existent profiles:
Verification Results
Tested locally with the --local flag: