Skip to content

Fix media extraction when video_versions is null#2714

Merged
subzeroid merged 1 commit into
masterfrom
fix/public-media-null-video-versions
Jun 30, 2026
Merged

Fix media extraction when video_versions is null#2714
subzeroid merged 1 commit into
masterfrom
fix/public-media-null-video-versions

Conversation

@subzeroid

Copy link
Copy Markdown
Owner

Summary

  • handle video_versions: null in media, resource, direct media, and story extractors
  • add a public media regression test for current xdt_api__v1__media__shortcode__web_info payloads with null video versions

Notes

  • Related to [BUG] #2713. This fixes the crash/LoginRequired fallback path for null video_versions.
  • I checked current web bundles/HAR/APK paths and did not find a public anonymous doc_id that restores Reels view/play counts; authenticated private media/{pk}/info/ remains the verified source for play_count.

Tests

  • PYTHONDONTWRITEBYTECODE=1 .venv/bin/pytest -q tests/regression/test_public.py::PublicRegressionTestCase::test_media_info_handles_web_info_payload_with_null_video_versions tests/regression/test_public.py::PublicRegressionTestCase::test_media_info_gql_extracts_current_web_info_payload tests/regression/test_media.py::MediaInfoV2RegressionTestCase::test_extract_media_v1_normalizes_video_view_count
  • PYTHONDONTWRITEBYTECODE=1 .venv/bin/pytest -q tests/regression/test_public.py tests/regression/test_media.py
  • PYTHONDONTWRITEBYTECODE=1 .venv/bin/ruff check instagrapi/extractors.py tests/regression/test_public.py
  • git diff --check

@subzeroid subzeroid merged commit f6ade6d into master Jun 30, 2026
12 checks passed
@subzeroid subzeroid deleted the fix/public-media-null-video-versions branch June 30, 2026 14:21
@subzeroid subzeroid mentioned this pull request Jun 30, 2026
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