Boris' point is good. video files usually have a header, that includes info like the size of the video, the frame rate and other info.
Additionally frames are usually not stored completely but instead only the changes in the frames to safe lots of space. If you download just starting from byte x to byte y you miss the header and you can't be sure you get a boundary of a frame.
But if you want to download only a certain part of the Youtube video until the end, you just need to know the second where the part begins, you are interested in. Then you just need to change the URL a bit and add &t=x
to where x is the starting second (integer).
So if you want the rest of this video starting from 02:25
https://www.youtube.com/watch?v=LUk73pUe9i4
It becomes:
https://youtu.be/LUk73pUe9i4?t=125
or, which seems to give the same result:
https://www.youtube.com/watch?v=LUk73pUe9i4&feature=youtu.be&t=125
It should be possible to use this as a url in the library you use.
But I don't know if there also is a variable for the duration, if that is relevant for you. But I think, you just wanted the rest of the video, right?
But if it is relevant, you still could calculate the end (which could be difficult, because there is not really a straight linear dependency between length in seconds and size in bytes), or (but this would get a bit messy) say if you want to download the video part between second 100 and 500. Start downloading the first say 5MB starting at second 500. Throw away enough bytes to drop the header and the initial frame and use the rest of the bytes as a "stop"-pattern. So you would start downloading from 100 and as soon as you find your pattern, you know, that you are past second 500. Yeah I said it will get messy :-)