Determine file size in advance #667

Open
opened 2026-02-20 23:10:00 -05:00 by deekerman · 3 comments
Owner

Originally created by @androidealp on GitHub (Jun 23, 2013).

I searched the youtube api and found how to get the size of the video "getVideoBytesTotal ()", but need to run the video to get the size.

My goal is to make an ajax progressbar via php where to display the download progress. I noticed that the youtube-dl does not bring this information.

Is there a way where I can get the size of the video prior to downloading? ssh or via php?

Originally created by @androidealp on GitHub (Jun 23, 2013). I searched the youtube api and found how to get the size of the video "getVideoBytesTotal ()", but need to run the video to get the size. My goal is to make an ajax progressbar via php where to display the download progress. I noticed that the youtube-dl does not bring this information. Is there a way where I can get the size of the video prior to downloading? ssh or via php?
Author
Owner

@phihag commented on GitHub (Jun 23, 2013):

See #152 for a generic solution for your problem, but that hasn't been implemented yet.

@phihag commented on GitHub (Jun 23, 2013): See #152 for a generic solution for your problem, but that hasn't been implemented yet.
Author
Owner

@linuph commented on GitHub (Nov 6, 2013):

I don't know if there is already a solution implemented. I use curl (in BASH):

contentlength=$(curl -sI $vidurl | awk '/Content-Length/{sub("\r","");print $2}')
(-s+captial i)

This accesses the header of vidurl, the final, decoded url of the video to be downloaded.
I hope this helps.

Linuph

@linuph commented on GitHub (Nov 6, 2013): I don't know if there is already a solution implemented. I use curl (in BASH): contentlength=$(curl -sI $vidurl | awk '/Content-Length/{sub("\r","");print $2}') (-s+captial i) This accesses the header of vidurl, the final, decoded url of the video to be downloaded. I hope this helps. Linuph
Author
Owner

@usamamashkoor commented on GitHub (Oct 14, 2017):

did any one find any solution for this..?

@usamamashkoor commented on GitHub (Oct 14, 2017): did any one find any solution for this..?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/youtube-dl-ytdl-org#667
No description provided.