Skip to main content

yt-dlp Instagram HDR

A yt-dlp plugin that adds HDR formats for Instagram Reels, Stories, and video posts.

Supports VP9 Profile 2 and AV1 10-bit HDR. By default, the plugin starts with Instagram's web API and checks the iOS API when a successful web response lacks HDR or separate audio. It combines HDR, SDR, progressive video and audio formats for the same media item, so no extra extractor arguments are needed for HDR discovery or bv+ba. xHE-AAC is excluded unless explicitly enabled, or unless it is the only audio-only format available; a progressive video never replaces a separate audio track. Video and audio are merged without re-encoding (unless the hevc option is enabled) and the HDR video is verified with ffprobe.

Requirements

  • Python 3.10+
  • yt-dlp 2026.08.19+
  • FFmpeg and ffprobe on your PATH (the executables, not the Python ffmpeg package)
  • Authenticated Instagram cookies for the plugin's API extraction

Optional HEVC conversion requires an FFmpeg build with hevc_videotoolbox (macOS) or libx265. No conversion is performed unless you enable it.

Installation

If you know how yt-dlp was installed, jump to pip, pipx, or manual installation (Homebrew and standalone executables). Otherwise, identify the installation with the commands below; unavailable commands can be skipped.

macOS

command -v yt-dlp
pipx list
python3 -m pip show yt-dlp
brew list --versions yt-dlp

Linux

command -v yt-dlp
pipx list
python3 -m pip show yt-dlp

Windows (PowerShell)

Get-Command yt-dlp
pipx list
py -m pip show yt-dlp

Use the result that matches your output:

Output Installation type
package yt-dlp ... in pipx list pipx
Name: yt-dlp from pip show pip
yt-dlp <version> from brew list manual
yt-dlp has a path, but the checks above report it as missing manual

Package(s) not found, nothing has been installed with pipx, and No such keg are negative results; continue to the next check. If command -v or Get-Command cannot find yt-dlp, install yt-dlp first.

If more than one check finds yt-dlp, use the manual method to avoid installing the plugin into the wrong Python environment.

pip

Run these commands in the same Python environment as yt-dlp.

macOS/Linux:

python3 -m pip install -U yt-dlp-instagram-hdr

Windows:

py -m pip install -U yt-dlp-instagram-hdr

pipx

pipx inject yt-dlp yt-dlp-instagram-hdr --force

Manual

Download the latest .whl from Releases, and place it, without extracting it, in:

  • macOS/Linux: $XDG_CONFIG_HOME/yt-dlp/plugins/, or ~/.config/yt-dlp/plugins/ when it is not set
  • Windows: %APPDATA%/yt-dlp/plugins/

Create the folder if necessary. Keep only one version of this plugin there; when updating, replace the old yt_dlp_instagram_hdr-*.whl with the new wheel. See yt-dlp's plugin installation documentation for other supported locations.

Updating

For pip, repeat the installation command with -U. For pipx:

pipx upgrade yt-dlp --include-injected

For manual installations, replace the wheel as described above. Updating yt-dlp itself does not update a manually installed plugin.

Usage

Authenticated downloading can expose the account to challenges, session invalidation or suspension. A yt-dlp maintainer explicitly documents this risk of flagged or banned accounts. The plugin cannot guarantee that an account will not be suspended, and cannot determine which browser account is your main account. Avoid supplying a session for an account you cannot afford to lose. A separate browser profile using the same account still exposes that account.

For public content, you can first try without authenticated cookies:

yt-dlp "VIDEO_URL"

This uses yt-dlp's built-in extractor; available formats and anonymous access depend on Instagram. For authenticated extraction, choose the browser/profile deliberately and log in there first. Replace VIDEO_URL with a Reel, post or Story URL, keeping the quotes. --cookies-from-browser chrome is still supported; to select a Chrome profile explicitly, use --cookies-from-browser "chrome:PROFILE_DIRECTORY", replacing PROFILE_DIRECTORY with that profile's directory name or path (shown at chrome://version). Replace chrome with your supported browser name if needed. Cookies are credentials, not a protection against account restrictions.

Default: download HDR when available, without converting the video codec.

yt-dlp --cookies-from-browser chrome "VIDEO_URL"

yt-dlp selects the best available formats and merges video/audio when needed. Merging is not re-encoding: an .mp4 can still contain VP9 or AV1 video. The HDR verified message is a read-only metadata check, not a conversion; if the check fails, a warning is printed and the download is kept.

Apple's players (QuickTime, Photos, iPhone and iPad) cannot play VP9 in MP4, which is how Instagram delivers HDR. For files that play and save on Apple devices, enable the optional HEVC conversion.

List available formats with -F:

yt-dlp -F --cookies-from-browser chrome "VIDEO_URL"

Plugin HDR formats have IDs starting with hdr-. To explicitly select separate video and audio streams:

yt-dlp -f "bv+ba" --cookies-from-browser chrome "VIDEO_URL"

The automatic API selection preserves compatible audio from the web response when HDR comes from iOS. For silent videos, use the default selection instead, since an audio-only stream may not exist.

You can also use a cookie file:

yt-dlp --cookies cookies.txt "VIDEO_URL"

The cookie file must use the Netscape format supported by yt-dlp. Treat it as a password: do not share it or commit it to a repository.

Without authenticated cookies, the plugin shows a warning and delegates to yt-dlp's built-in Instagram extractor. With authentication, media without HDR keeps the available SDR and audio formats from the same response.

Account access and request limits

The default api=auto starts with the web application ID and yt-dlp's browser headers. After a successful response without HDR or separate audio, it makes one additional media request using the iOS application ID and user agent, then combines formats by media ID. This uses a mobile application identity with browser cookies and carries the account risk described above. Use instagramhdr:api=web to restrict extraction to the web API. Neither mode fabricates device IDs or random telemetry. Changing headers cannot make authenticated automation indistinguishable from normal browsing.

Metadata requests made by this plugin are spaced by two seconds by default, shared between Reels and Stories in the same yt-dlp run. Use yt-dlp's --sleep-requests SECONDS to set an explicit interval. This limits request bursts; it is not an Instagram-approved rate or a guarantee against suspension. Avoid running multiple download processes with the same session.

HTTP 401/403/404/429, login/verification redirects and recognized challenge or restriction JSON responses stop further metadata requests through this plugin for the current run, including with --ignore-errors. There is no automatic authenticated fallback after these errors. A 404 can indicate unavailable media or a session restriction, so it also stops the run's plugin requests. Check the account in Instagram and resolve restrictions before trying again; repeatedly refreshing cookies is not a fix for account limits. The stop flag is local to that yt-dlp process, not a persistent or cross-process account lock. Extractors outside this plugin, including the explicitly disabled mode, retain yt-dlp's own behavior.

Stories preserve the tray's available audio and video formats. When the tray omits HDR, the plugin requests media details (a tray's SDR manifest can omit available HDR). Automatic mode also checks iOS when HDR or separate audio is still missing. With a specific Story URL and --no-playlist, other Stories are not queried for media details.

Instagram can return different formats for web and mobile clients. Automatic mode handles this without extra arguments. To start directly with the iOS API:

yt-dlp --cookies-from-browser "chrome:PROFILE_DIRECTORY" --extractor-args "instagramhdr:api=ios" "VIDEO_URL"

This option prints a warning and also checks the web API when the iOS response lacks compatible separate audio, unless include_xhe_aac is enabled and xHE-AAC audio is available. All modes retain the request interval and stop protections; an access rejection never triggers a request with another client. They preserve the available VP9/AV1 HDR downloads, optional HEVC conversion, Stories and the audio options below. Availability still depends on the API responses; the plugin cannot force Instagram to expose an HDR rendition.

Plugin options

Disable the HDR plugin and force yt-dlp's built-in Instagram extractor:

yt-dlp --cookies-from-browser chrome --extractor-args "instagramhdr:disable" "VIDEO_URL"

Include xHE-AAC (mp4a.40.42) audio alongside the other audio formats:

yt-dlp --cookies-from-browser chrome --extractor-args "instagramhdr:include_xhe_aac" -F "VIDEO_URL"

Remove -F to download. Enabling this option can make yt-dlp select xHE-AAC, which some players do not support. Leave it off for better compatibility.

Optional HEVC conversion

HEVC conversion is disabled by default: without instagramhdr:hevc, the original video codec is preserved. Merging video/audio and verifying HDR metadata do not re-encode the video.

For better compatibility with HEVC-capable Apple devices and other players, explicitly enable conversion of HDR downloads to HEVC Main 10 (hvc1). The result is an .mp4 whatever --merge-output-format says; --remux-video can still change its container afterwards. --recode-video would re-encode it again, so with it the conversion is skipped with a warning; likewise with -x. This is a lossy re-encode and takes additional time; it preserves and checks the HDR colour tags, but is not a lossless copy. VideoToolbox is used when your FFmpeg has it, with libx265 as a slower software fallback. Audio, subtitles and cover art are copied:

yt-dlp --cookies-from-browser chrome --extractor-args "instagramhdr:hevc" "VIDEO_URL"

The HEVC file is usually larger than the download (about 1.3–3× in tests). For smaller files at lower quality, pass encoder options; they are applied after the plugin's defaults. -q:v sets the VideoToolbox quality (default 50, higher is better) and -crf the libx265 quality (default 22, lower is better):

yt-dlp --cookies-from-browser chrome --extractor-args "instagramhdr:hevc" --ppa "InstagramHDRHEVC:-q:v 40 -crf 26" "VIDEO_URL"

After a successful conversion the original is deleted, like with --recode-video, unless:

  • -k is used: the original is kept (as *.orig.mp4 when it was already an MP4), together with the separately downloaded video/audio streams (*.f<format>.*);
  • --no-overwrites is used and the original was not downloaded by this run (for example a file that yt-dlp reports as already downloaded): it is kept too (as *.orig.mp4 when it was already an MP4).

Running the same command again skips files that are already converted: like --remux-video, an existing <name>.mp4 (or the container chosen with --remux-video) counts as the finished result. If that file is an earlier download that is not HDR, a warning says so and it is kept; pass --force-overwrites to download it again. An existing file at the HEVC destination, or an existing *.orig.mp4 that would be kept, also stops the conversion unless --force-overwrites is given.

The option only affects HDR video selections; it does not turn SDR into HDR, and it is skipped (with a warning) when several video streams are merged with --video-multistreams. If your -f/-S options pick an SDR format although HDR formats exist, a warning says so before the download. Audio-only downloads, including -x, skip HDR conversion and verification. The option does not convert xHE-AAC audio, so enabling both options can still produce audio that your player cannot play.

Other controls

These instagramhdr options apply to Reels, posts, and Stories. Boolean values can be disabled explicitly, for example instagramhdr:hevc=false. To combine options, separate them with semicolons inside the same quoted argument:

yt-dlp --cookies-from-browser chrome --extractor-args "instagramhdr:hevc;include_xhe_aac" "VIDEO_URL"

Use the instagramhdrstory key to override an option for Stories only. Advanced: instagramhdr:verify=false disables the default read-only HDR check; HEVC conversion still verifies its input and output.

The options are stored in the info JSON when the video is extracted. When downloading from --load-info-json, no extraction runs, so add the plugin's post-processors yourself:

yt-dlp --load-info-json FILE --use-postprocessor "InstagramHDRSelection:when=video" --use-postprocessor InstagramHDRHEVC --use-postprocessor "InstagramHDRVerify:when=after_move"

Troubleshooting

  • No HDR formats: check that the selected browser/profile is logged in and that the upload has HDR. Available SDR/audio formats are kept. Web and iOS can expose different formats; see the explicit iOS option and its account risk above.
  • HTTP 401/403/404/429 or account verification: the plugin stops its metadata requests for that run. Check the account and content directly in Instagram; resolve challenges and allow limits to clear before another attempt. Neither switching clients nor disabling the plugin bypasses Instagram's restrictions.
  • Missing FFmpeg/ffprobe or HEVC encoder: install the executables, check ffmpeg -version and ffprobe -version, or set --ffmpeg-location "PATH". ffmpeg -hide_banner -encoders must list hevc_videotoolbox or libx265.
  • SDR downloaded although HDR formats are listed: check -f/-S in your command and configuration; -f "bv*[dynamic_range!=SDR]+ba/b" prefers HDR.
  • Unexpected conversion: check your yt-dlp configuration for hevc or other conversion options. Use --ignore-config to test without saved settings.
  • Old plugin still loaded: remove duplicate copies of this plugin and check the plugin paths in yt-dlp --verbose -F --cookies-from-browser chrome "VIDEO_URL". A manually installed wheel may take precedence over a pip installation.

When reporting a problem, include the yt-dlp/plugin versions and the command used. Redact cookies, credentials, private URLs and other personal data from logs.

Testing a checkout

Run from the repository root with a Python environment containing yt-dlp:

python -m unittest discover -s tests -v
yt-dlp --ignore-config --no-plugin-dirs --plugin-dirs .. --cookies-from-browser chrome -F "VIDEO_URL"

The tests use the local source, not an installed wheel. The second command also loads this checkout; add --extractor-args "instagramhdr:hevc" and remove -F only when you want to test conversion. The automated tests do not contact Instagram.

License

MIT © 2026 Vinicius Roncetti

Metadata

Release files for yt-dlp-instagram-hdr 0.6.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for yt-dlp-instagram-hdr 0.6.1
File Interpreter ABI Platform Actions
yt_dlp_instagram_hdr-0.6.1-py3-none-any.whl Python 3 none any Details for yt_dlp_instagram_hdr-0.6.1-py3-none-any.whl

Release files / yt_dlp_instagram_hdr-0.6.1-py3-none-any.whl

Download URL yt_dlp_instagram_hdr-0.6.1-py3-none-any.whl
Size 22.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c5635fa7cff439fb97ad4ac3385f05b34689cb64515e75ab34c925748091d31f
BLAKE2b-256 checksum
How to use checksums
eb4454c0389dd858d7eb662b815304399914959c0ca1fe79e2607a11ba098795
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

Security for yt-dlp-instagram-hdr 0.6.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

1 file in this release has been uploaded with provenance metadata.

Attestation for yt_dlp_instagram_hdr-0.6.1-py3-none-any.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page