Repository navigation
fix: request saved posts through the Instagram web host - #34
Conversation
Scrapes were stopping with "Instagram API returned status: fail" and the reason was lost, because a failure reported with a 2xx has no axios error to read the body from. Keep Instagram's reason in the error message and its response body on the run, and classify challenge_required as auth. Call www.instagram.com with the web client's headers and a desktop Chrome default user agent instead of i.instagram.com with an Android one, since the cookie comes from a browser. A non-JSON response now reports as an expired session. Not yet verified against live Instagram. Profiles with a saved custom user agent keep using it. If it is the old Android string, clear it or replace it with your browser's. Release-Note: Scrapes now use Instagram's web API, and failed runs show Instagram's actual error. If a profile has a custom Android user agent, clear it or replace it with your browser's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. Walkthrough
Merge Risk:
|
🧪 Beta Container Ready for TestingA preview beta version has been built for this Pull Request:
# Test this PR build locally:
docker pull ghcr.io/gitnasr/instagram-saved-posts:beta-pr-34 |
Summary
Scrapes stop with
Instagram API returned status: fail, and the reason is lost. This keeps the reason and moves the request to the host and headers other current projects use. Those projects' code is the basis for the switch; the actual cause is still unconfirmed.Also drops the
include_feed_onlyquery parameter, which none of the web examples checked send, and updates the UI placeholders that mentioned the Android default.Evidence
npm run test:instagram(new, Instagram stubbed) printsinstagram-api ok. It asserts:Not verified against live Instagram. No before/after from a real scrape yet. Test this on a deployment before merging, because merging publishes a release.
npm run lintpasses with 0 errorsnpx tsc --noEmitpasses with 0 errorsnpm run buildsucceedsRelease note
Release-Note: Scrapes now use Instagram's web API, and failed runs show Instagram's actual error. If a profile has a custom Android user agent, clear it or replace it with your browser's.
Type: Bug fix
Merge Danger
Door: two-way
No schema or data changes. Revert restores the old request.
Blast Radius: scraping
Every scrape and avatar lookup changes request shape, on accounts Instagram may already be restricting. Profiles with a saved custom user agent keep it, so a saved Android string stays mismatched with the new host until cleared.
Docs: gitnasr/instagram-saved-posts-landing, branch
docs/instagram-challenge-errors.🤖 Generated with Claude Code
Summary by CodeRabbit