Skip to content

fix: restore Instagram media extraction for posts, reels, and stories#107

Open
pzzzy wants to merge 1 commit intotheus:gh-pagesfrom
pzzzy:codex/fix-instagram-media-sources
Open

fix: restore Instagram media extraction for posts, reels, and stories#107
pzzzy wants to merge 1 commit intotheus:gh-pagesfrom
pzzzy:codex/fix-instagram-media-sources

Conversation

@pzzzy
Copy link
Copy Markdown

@pzzzy pzzzy commented Apr 23, 2026

Summary

This PR restores instantgram support for current Instagram web behavior across posts, reels, and stories.

What changed

  • rewrote media selection to target the active visible item instead of the first matching DOM node
  • added a shared bookmarklet.js source and bookmarklet-loader.js so all published bookmarklet links stay in sync
  • added permalink and page-content fallback resolution for posts, reels, and stories
  • fixed Safari video failures by stripping Instagram CDN byte-range params like bytestart and byteend
  • stopped forcing modern video URLs onto the legacy generic CDN hostname

User-facing fixes

  • photos now open from the item currently in view
  • videos now resolve correctly for posts, reels, and stories
  • stories no longer default to the first visible item when another one is active
  • Safari can open the resolved video URL instead of landing on an invalid CDN fragment

Verification

  • verified the new bookmarklet logic against current Instagram web behavior
  • confirmed Safari video URLs worked after removing byte-range query params
  • ran node --check on:
    • bookmarklet.js
    • bookmarklet-loader.js

Notes

This keeps the published site lightweight while moving the bookmarklet payload into a readable source file, which should make future Instagram compatibility fixes easier to maintain.

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