Skip to content

Fix: Update Instagram detection logic#2903

Open
Sumit0x00 wants to merge 1 commit intosherlock-project:masterfrom
Sumit0x00:fix-instagram-detection
Open

Fix: Update Instagram detection logic#2903
Sumit0x00 wants to merge 1 commit intosherlock-project:masterfrom
Sumit0x00:fix-instagram-detection

Conversation

@Sumit0x00
Copy link
Copy Markdown

This PR fixes the broken Instagram detection which was causing false negatives (existing accounts reported as "Not Found").

Problem

  1. Proxy Blocked: The previous implementation relied on imginn.com, which is currently returning a 403 (Cloudflare challenge) for automated requests.

  2. Soft 404s: Direct probes to instagram.com return a 200 OK status for both existing and non-existing accounts.

  3. UA Sensitivity: Standard desktop User-Agents often lead to a generic login wall, making it impossible to differentiate account existence via HTTP headers.

Solution

  1. Switched to Message Detection: Changed errorType from status_code to message.

  2. 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.

  3. Error Patterns: Added detection patterns for non-existent profiles:

  • <title>Instagram</title> (The generic title returned for the "unavailable" page).
  • Profile isn't available.
  1. Clean Up: Removed the non-functional urlProbe (imginn.com).

Verification Results
Tested locally with the --local flag:

  • Existing Account: instagram.com/blamesumit -> Found
  • Non-existent Account: instagram.com/random_handle_123 -> Not Found

@github-actions
Copy link
Copy Markdown
Contributor

Automatic validation of changes

Target F+ Check F- Check
Instagram ❌   Fail ✔️   Pass

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).

@Sumit0x00 Sumit0x00 mentioned this pull request Apr 16, 2026
1 task
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.

1 participant