Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Output file size with -s or -g #6
Comments
|
Originally by anonymous: This would be an amazing feature! Please implement it :) |
|
The closest thing I can find for this is: Possibly we could write a small virtualization just for the "player.getVideoBytesTotal():Number" function. |
|
Or using "json-c" we could use some math and calculate the size of the video http://code.google.com/apis/youtube/2.0/developers_guide_jsonc.html |
|
No need to use that. The size is known in the moment you're ready to download (remember the download progress bar). |
|
Diregard, I'm a complete moron. I need to actually get on MY computer when I'm posting, and some more sleep :( |
|
youtube-dl was in dire need of a --get-filesize option and I needed it now, so I just wrote it. your welcome. I don't know how github works yet so maybe someone else can request this be added. |
|
@Acuity The best way would be a github pull request, since that can be commented line-by-line. However, you can also provide your own git repository, or a patches. Providing a link to the changed version means I have to create the patch manually. Note that why your implementation works in some cases, it can also output the undocumented However, since |
|
indeed, you won't believe the plans here. 10Gb at 512kbs capped and then 256 kbs beyond 10gb. And that's the 'unlimited' plan |
|
Yea, I just did only what was necessary to make it work for my project. I just needed to set a download limit on youtube video size. Another thing I added was a cheat to get around the youtube bandwidth limitation. After downloading about 1MB of video, it limits your bandwidth severely. So I added another option --partial that only downloads 1MB of video, then resets the connection using the partial file. This lets you utilize youtube's bandwidth, and is about 60 times faster after the first 1MB (on my server). It probably has more problems outside what I'm using it for though, so I probably shouldn't share that version. |
|
@phihag Another use case for --get-filesize? Determining the size of many videos in advance, like when downloading a complete YouTube channel. Not as a single-option-there-is-your-total-download-size-solution, but with reasonable parsing effort afterwards. For single videos, you can always start the download and stop immediately. For multiple videos (read: possibly hundreds) that's not a practical way to do it. --skip-download skips the download before actually getting/printing the size. |
|
Out of curiosity, is this a lot harder to implement than it sounds? I mean, as far as I know, the progress indicators always contain the file size, so it seems like it should be pretty easy. Meanwhile, this request's been open for literally over five years… |
|
Well, if you have a progress indicator, then yes, that is pretty obvious. But there are other cases, like RTMP, HLS, HDS, all that streaming crap ;) You don't have a single video file, instead there are lots of fragments. You somehow could fetch the sizes of these, I think, but yes, it is a lot harder to implement than a single, direct download ;) |
|
@Hrxn Maybe |
|
Yes, that should be possible, but as someone stated earlier, I'm also not sure about a good use case.. |
|
Hi, 1°) I suggest to force the user to add the format along with the
|
|
Another example with python
|
|
Even easier with python
|
|
If we are still looking for use cases, I often have to send videos over messaging applications (whatsapp, messenger etc.), and it would be useful to know if there is a version that is within the file size limits when using the -F flag. |
|
I would love a "--size" flag for estimating the final size of a download. Ideally this would act as a dry run, returning the approximate size of a download. |
|
AtomicParsley 0.9.0 in FreeBSD apparently does not embed thumbnails in video sizes over 4GB. On my arch linux it has AtomicParsley 0.9.6 and it works fine, but FreeBSD hasn't updated AtomicParsley yet. Youtube doesn't give file sizes for a lot of formats like mp4_dash or webm_dash containers. If youtube-dl had a way to get file size it would help avoid embedding files over 4GB. |
Was: http://bitbucket.org/rg3/youtube-dl/issue/141/
If the file size was outputted it would be possible to script youtube-dl to test if the current video the the harddrive is in the best possible quality.
It happens that Youtube re-encode videos, and with higher resolution, so being able to extract the file size from youtube-dl would be very useful.
File size in bytes would be preferred.