-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
-F does not give FILESIZE of ID 22 #1400
Comments
YouTube does not provide the filesize for these formats. The only way to get it is to make try fetching the file to get the size from either the HTTP headers, or using ffprobe - which #613 already requests |
I see what you mean @pukkandan. From the view-source:, I can see that However We can derive a very close approximation of the
Please don't close this?
Thanks. |
This is a good idea. I should be able to do this in general, and not just for youtube |
* master: (43 commits) [MLSScoccer] Add extractor (yt-dlp#1452) [itv] Add support for ITV News (yt-dlp#1456) [viewlift] Fix typo in 5be76d1 [utils] Add `jwt_decode_hs256` Code from yt-dlp#1340 Authored by: Ashish0804 [viewlift] Add cookie-based login and series support Closes yt-dlp#1340, yt-dlp#1316 Authored by: Ashish0804, pukkandan [sky] Add `SkyNewsStoryIE` (yt-dlp#1443) [wakanim] Detect geo-restriction (yt-dlp#1429) [wakanim] Add support for MPD manifests (yt-dlp#1428) [compat] Don't create console in `windows_enable_vt_mode` Closes yt-dlp#1420 [3speak] Add extractors (yt-dlp#1430) [twitter] Do not sort by codec Closes yt-dlp#1431 [extractor] Fix some errors being converted to `ExtractorError` [utils] Create `DownloadCancelled` exception as super-class of ExistingVideoReached, RejectedVideoReached, MaxDownloadsReached [downloader/ffmpeg] Fix vtt download with ffmpeg [outtmpl] Add type `link` for internet shortcut files and refactor related code Closes yt-dlp#1405 [utils] Sanitize URL when determining protocol Closes yt-dlp#1406 [DiscoveryPlus] Allow language codes in URL Closes yt-dlp#1425 [Bilibili:comments] Fix infinite loop (yt-dlp#1423) [instagram] Fix bug in ab2ffab (yt-dlp#1403) Approximate filesize from bitrate Closes yt-dlp#1400 ... # Conflicts: # Makefile # supportedsites.md
@pukkandan is it possible to make this more precise? I feel like there's too much rounding off happening in the code. yt-dlp's I do the f22 size math for this video on paper,
and I get Paper Math size = 2.201489045300987 GiB Here's the actual size
which is But,
which is a full I like to embed the filesize(upto 2 decimal points) in filename, but the Please make this more accurate, if possible. Thanks @pukkandan |
This comment was marked as outdated.
This comment was marked as outdated.
@pukkandan I just I'm still getting the wrong size for -f 22. Was 2024.03.14.232657 built with the fix for 140a13f ? |
Thanks @bashonly . Comment edited. |
This comment was marked as spam.
This comment was marked as spam.
Regarding 22e4dfa While this commit fixes the conversion of file sizes (in MiB [base-2]), the bit rates (now in base-2) doesn't match the values displayed on players or MediaInfo. And it increases the discrepancy of ABR values that where already not matching before; for example, YT, audio-only format 140 has 128kb/s, but YT-DL traditionally display 129k for it, but now with this commit it became 126k. Imo, in order to fix the calculation of file sizes in base-2 should not involve changing the display of all bit rates to base-2. |
|
@pukkandan |
Thanks for the update. However, there are still inaccuracies in the size estimates of some videos. VIDEOID=EpLxHWg_-hk
VIDEOID=LMDO3tt8enM
VIDEOID=oonE_eLmKZ8
VIDEOID=BaW_jenozKc
Admittedly in the last one even the Paper Math Size estimate doesn't quite match the actual size, but the other three could be more accurate. Thanks. |
@pukkandan Here is a comparison to illustrate what I compared. In this example, I'm comparing yt-dlp-nightly build 2024.03.17.232657 (before the commit) with 2024.03.18.232707 (after the commit). Then I got formats 137+140 so we can compare Bit Rates with the values MediaInfo provide; versions before the commit are much closer. MediaInfo:
|
YouTube provides slightly different duration for each format. Calculating file-size based on this duration instead of the global video duration is shown to give more accurate results. Ref: yt-dlp#1400 (comment)
YouTube provides slightly different duration for each format. Calculating file-size based on this duration instead of the global video duration is shown to give more accurate results. Ref: yt-dlp#1400 (comment)
YouTube provides slightly different duration for each format. Calculating file-size based on this duration instead of the video duration gives more accurate results. Ref: #1400 (comment)
YouTube provides slightly different duration for each format. Calculating file-size based on this duration instead of the video duration gives more accurate results. Ref: yt-dlp#1400 (comment)
Checklist
Region
No response
Example URLs
https://www.youtube.com/watch?v=BaW_jenozKc
Description
Requesting yt-dlp to also be able to extract file size of
-f 22
The text was updated successfully, but these errors were encountered: