Repository navigation
Show an estimated size for HLS formats in the video dropdown - #146
Merged
Merged
Conversation
HLS (m3u8) formats carry no filesize, so their rows showed only a bitrate and looked smaller than the direct-file rows. Estimate the size from tbr x duration, as yt-dlp -F does, and mark it with ~. The estimate goes into the label only: filesize stays 0 because it becomes expected_size and drives the 85% completeness check. Closes #144 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
HLS (
m3u8) video formats have nofilesize, so the dropdown showed[617] 1080p60 ~7546knext to[303] 1080p60 ~3191k (40.7GB). The HLS row looked smaller, though it is more than twice the bitrate._get_formats()now estimates the size fromtbr × duration(asyt-dlp -Fdoes) and labels it(~96.3GB).Safety
The estimate goes into the label only.
filesizestays0for estimated formats, because the UI sends it asexpected_size, which drives the 85% download-completeness check. A test pins both.Caveat seen in practice
For the 30 h test video, yt-dlp's tbr gave ~96 GiB but the real download is tracking ~45 GB. The
~marks it as an upper-bound guess, not a promise.Verify
.venv/Scripts/python.exe -m unittest discover -s tests→ 382 tests OKtest_hls_format_without_size_gets_an_estimated_label_only.Closes #144