Support partially downloading videos #21748

Open
opened 2026-02-21 11:50:26 -05:00 by deekerman · 2 comments
Owner

Originally created by @bodqhrohro on GitHub (Sep 30, 2020).

Checklist

  • I'm reporting a feature request
  • I've verified that I'm running youtube-dl version 2020.09.20
  • I've searched the bugtracker for similar feature requests including closed ones

Description

I often need to download the whole video only to extract from it a short clip later, with ffmpeg's -ss and -t keys. Thus downloading the rest of the video is redundant, and consumes lots of traffic and disk space.

For HLS videos, which are present on lots of supported sites including YouTube, only certain chunks
may be fetched if their timing is known. Thus the time range may be specified via CLI parameters, either the start point and the duration, or the start and end points. youtube-dl should automatically pick the smallest number of chunks that fit the specified range; optionally it also may pass the parameters to ffmpeg after downloading, so it trims the unnecessary parts from the edge chunks. If the video is not chunked, youtube-dl may fall back to downloading the whole video, or trigger an error.

Originally created by @bodqhrohro on GitHub (Sep 30, 2020). <!-- ###################################################################### WARNING! IGNORING THE FOLLOWING TEMPLATE WILL RESULT IN ISSUE CLOSED AS INCOMPLETE ###################################################################### --> ## Checklist <!-- Carefully read and work through this check list in order to prevent the most common mistakes and misuse of youtube-dl: - First of, make sure you are using the latest version of youtube-dl. Run `youtube-dl --version` and ensure your version is 2020.09.20. If it's not, see https://yt-dl.org/update on how to update. Issues with outdated version will be REJECTED. - Search the bugtracker for similar feature requests: http://yt-dl.org/search-issues. DO NOT post duplicates. - Finally, put x into all relevant boxes (like this [x]) --> - [x] I'm reporting a feature request - [x] I've verified that I'm running youtube-dl version **2020.09.20** - [x] I've searched the bugtracker for similar feature requests including closed ones ## Description <!-- Provide an explanation of your issue in an arbitrary form. Please make sure the description is worded well enough to be understood, see https://github.com/ytdl-org/youtube-dl#is-the-description-of-the-issue-itself-sufficient. Provide any additional information, suggested solution and as much context and examples as possible. --> I often need to download the whole video only to extract from it a short clip later, with `ffmpeg`'s `-ss` and `-t` keys. Thus downloading the rest of the video is redundant, and consumes lots of traffic and disk space. For HLS videos, which are present on lots of supported sites including YouTube, only certain chunks may be fetched if their timing is known. Thus the time range may be specified via CLI parameters, either the *start point* and the *duration*, or the *start* and *end* points. `youtube-dl` should automatically pick the smallest number of chunks that fit the specified range; optionally it also may pass the parameters to `ffmpeg` after downloading, so it trims the unnecessary parts from the edge chunks. If the video is not chunked, `youtube-dl` may fall back to downloading the whole video, or trigger an error.
Author
Owner

@antgiant commented on GitHub (Oct 10, 2020):

Please see #622.

@antgiant commented on GitHub (Oct 10, 2020): Please see #622.
Author
Owner

@jidanni commented on GitHub (Jan 7, 2021):

I think the youtube-dl man page should mention that partial downloads (x:xx - y:yy) aren't yet possible. Else users think nobody has ever thought about it.

Also, let's say yesterday we watched about half of a two hour long video before we fell asleep, and today we want to download the rest.
We aren't concerned about precision. A few extra minutes tacked on would still be better than having to download the whole thing. We don't even remember the exact point we want to start at. We just want to say "skip the first hour or so".
No we don't want to download the whole thing and then edit it, as our whole point is to reduce the amount of bytes needed for the transfer over the Internet. All I know is YouTube seems to be real good at knowing where one places the red dot on the progress bar... so maybe emulate those commands back to YouTube...

@jidanni commented on GitHub (Jan 7, 2021): I think the youtube-dl man page should mention that partial downloads (x:xx - y:yy) aren't yet possible. Else users think nobody has ever thought about it. Also, let's say yesterday we watched about half of a two hour long video before we fell asleep, and today we want to download the rest. We aren't concerned about precision. A few extra minutes tacked on would still be better than having to download the whole thing. We don't even remember the exact point we want to start at. We just want to say "skip the first hour or so". No we don't want to download the whole thing and then edit it, as our whole point is to reduce the amount of bytes needed for the transfer over the Internet. All I know is YouTube seems to be real good at knowing where one places the red dot on the progress bar... so maybe emulate those commands back to YouTube...
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#21748
No description provided.