Skip to content

fix(instagram): read the user timeline the web client loads - #2522

Open
Benjamin-eecs wants to merge 1 commit into
jackwener:mainfrom
Benjamin-eecs:fix/instagram-user-timeline
Open

Benjamin-eecs wants to merge 1 commit into
jackwener:mainfrom
Benjamin-eecs:fix/instagram-user-timeline

Conversation

@Benjamin-eecs

@Benjamin-eecs Benjamin-eecs commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Description

instagram user is dead for every account. Instagram retired /api/v1/feed/user/* for web sessions: it answers 200 with redirected: true and the homepage app shell, so this command's if (!r2.ok) guard cannot fire and r2.json() throws a raw SyntaxError under the UNKNOWN code. Its documented fallback is gone too, web_profile_info answers 429 with an HTML block page (#2456).

The command now reads the timeline the web client itself loads: it forces a fresh document, installs the request interceptor, routes to the profile through the history API so the interceptor survives, drains captures until the timeline arrives, and scrolls when the limit needs another page. Instagram's own Relay client issues the query, so nothing here pins a persisted-query doc_id.

Related issue: Closes #2456

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 🌐 New site adapter
  • 📝 Documentation
  • ♻️ Refactor
  • 🔧 CI / build / tooling

Checklist

  • I ran the checks relevant to this PR
  • I updated tests or docs if needed
  • I included output or screenshots when useful

Documentation (if adding/modifying an adapter)

  • Added doc page under docs/adapters/ (if new adapter)
  • Updated docs/adapters/index.md table (if new adapter)
  • Updated sidebar in docs/.vitepress/config.mts (if new adapter)
  • Updated README.md / README.zh-CN.md when command discoverability changed
  • Used positional args for the command's primary subject unless a named flag is clearly better
  • Normalized expected adapter failures to CliError subclasses instead of raw Error

Screenshots / Output

Both endpoints, probed in a logged-in session:

feed/user/natgeo/username/   200  redirected:true  finalUrl:https://www.instagram.com/  text/html
web_profile_info?username=   429  text/html (block page)

Before, on any account:

$ opencli instagram user natgeo --limit 3
ok: false
error:
  code: UNKNOWN
  message: 'SyntaxError: Unexpected token ''<'', "<!DOCTYPE "... is not valid JSON'
  exitCode: 1
# AutoFix: re-run with --trace=retain-on-failure for trace artifact
# opencli instagram user --trace retain-on-failure

After, same session (first of three rows):

$ opencli instagram user natgeo --limit 3
- index: 1
  caption: 'Presented by @Rolex. Welcome to Africa 🌍 Africa Earth’s Wild Home takes you deep into the heart of '
  likes: 69973
  comments: 405
  type: video
  date: 9/10/2026

--limit 20 returns 20 distinct posts across captured pages, a professional account resolves the same way, and a handle with no public timeline reports COMMAND_EXEC naming the cause instead of leaking a page stack trace. clis/instagram suite 204 / 204, and every behaviour above is mutation-checked: reverting any one of the forced reload, the envelope unwrap, the settled-pathname check, the pagination gates, deduplication, media id or media type validation, capture-timeout classification or deferred GraphQL error reporting fails a test. Typecheck, both lint gates and doc coverage pass; cli-manifest.json changes only this command's strategy and navigateBefore entries.

@Benjamin-eecs
Benjamin-eecs force-pushed the fix/instagram-user-timeline branch 3 times, most recently from 34e1ab7 to cc3e18f Compare September 17, 2026 08:37
Instagram retired /api/v1/feed/user/* for web sessions and web_profile_info answers 429 (jackwener#2456).
@Benjamin-eecs
Benjamin-eecs force-pushed the fix/instagram-user-timeline branch from cc3e18f to 01bc0e3 Compare September 17, 2026 09:18
@Benjamin-eecs
Benjamin-eecs marked this pull request as ready for review September 17, 2026 09:27
Copilot AI lite review requested due to automatic review settings September 17, 2026 09:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch has not been deployed

No deployments
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.

instagram/user: feed/user redirects to HTML shell, web_profile_info fallback returns 429

2 participants