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.
Is there any way to determine the length of a video without downloading it? #474
Comments
|
Currently, we do not determine the length (in seconds, I assume you don't mean in bytes) of the video, but we certainly could. |
|
@phihag Yes - you're correct, I meant seconds. I use ffmpeg to determine the length of a video after it's done downloading. Are you saying there's a way to determine either the length in seconds or bytes without downloading the entire video? That'd be really cool and I'd be interested in knowing how you would go about approaching that! |
|
There is a way a webplayer knows it. Thus, there may be an info on that |
|
The YouTube API provides a "duration" field for each media:content, and there's also a "yt:duration" tag, both providing the length of the video in seconds, so extracting that info shouldn't be too hard. |
|
@Tailszefox Do you know if the "yt:duration" information is available in the output of |
|
@ledzeppelin No, it's only available through YouTube's API. I just made a pull request that adds it to the json file, though, and more generally makes it accessible to the rest of the program if needed. |
|
@Tailszefox Awesome - Looking forward to it in the next release |
|
Is there an ETA when this will be included in the python built? |
|
A new version is near, but you can |
I was looking at the output of --write-info-json but could not determine the parameter (if there is any) that says the length of a video.