Error guide
Fix "The downloaded file is empty" (fragment request failed: HTTP Error 500)
You ask yt-dlp for audio — often format 140 (m4a) or just -x— and instead of a file you get a 500 on a fragment and an empty download. In November 2026 this was a real yt-dlp bug that mostly hit YouTube streams that had just ended. Here is how to tell if that's your case, the fix, and what to do when it's something else.
What the error looks like
[youtube] Fragment request failed: HTTP Error 500: Internal Server Error
[dashsegments] Total fragments: 0
ERROR: The downloaded file is emptyThe giveaway is Total fragments: 0. yt-dlp didn't lose a fragment halfway through — it never got a fragment list at all, so there was nothing to write. Run the same command with -v and look for this debug line:
[debug] <video id>: Video is in Post-Live Manifestless modeIf you see it, the video is a livestream that ended recently and YouTube hasn't finished turning it into a normal video yet. That's the case the rest of this section covers.
Fix 1: update to a build with the fix
This was reported as yt-dlp issue #18031 and closed on 15 November 2026 by "[ie/youtube] Fix post-live fragment generation" (#18058). That fix shipped in nightly 2026.11.15.232800. Stable 2026.10.26doesn't have it, so until the next stable release, switch to nightly:
# standalone binary
yt-dlp --update-to nightly
# pip install
python3 -m pip install -U --pre "yt-dlp[default]"
yt-dlp --version # should print 2026.11.15.232800 or laterYou can go back to stable later with yt-dlp --update-to stable. More on channels in how to update yt-dlp.
Fix 2: can't update? Switch the player client
Users in the issue thread got these streams working on older builds by asking for the visionos client explicitly:
yt-dlp --extractor-args "youtube:player_client=visionos" -f 140 "URL"
# same thing for audio extraction
yt-dlp --extractor-args "youtube:player_client=visionos" -x "URL"Treat this as a stopgap. Forcing one client removes yt-dlp's fallbacks, and the client list changes from release to release. Drop the flag once you're on a fixed build.
Fix 3: wait for YouTube to finish processing
The post-live state is temporary. Once YouTube finishes processing the stream into a regular video, the same command works again on any recent yt-dlp. If you archive streams on a schedule, the simple fix is to queue the download a few hours after the stream ends instead of right away.
Not a recently ended stream? Then it's probably transient
A 500 is the server's error, not yours. On a normal video, a 500 on one fragment out of hundreds is usually a blip, and yt-dlp already retries each fragment 10 times by default. On a flaky run, raise the retries and back off between them:
yt-dlp --fragment-retries 30 --retry-sleep fragment:exp=1:30 "URL"Retries won't help when the log says Total fragments: 0: there's nothing to retry. Also watch out for the opposite failure. By default yt-dlp skipsfragments it can't get, so a run can finish "successfully" with gaps in the audio. If a complete file matters more than getting a file, make it fail loudly instead:
yt-dlp --abort-on-unavailable-fragments "URL"If the errors are 403s instead of 500s, that's a different problem (usually IP reputation, a missing JS runtime, or a PO token). Start with Fix HTTP Error 403 and forcing SABR streaming + 403. If yt-dlp can't find format 140 at all, see Requested format is not available.
The pattern behind it
This error is a good example of why yt-dlp needs updating so often. Nothing on your side changed: YouTube changed how a stream behaves for a few hours after it ends, and the extractor needed a patch. On a laptop that just means updating. In a pipeline that pulls audio from streams automatically, every one of these changes is a silent failure until someone notices, and someone has to watch the tracker and roll out the fix.
Automation
Running this on a schedule? See the API version.
Paste a link and watch one API call do what your batch script does — extraction, retries, and site breakage handled.