[GH-ISSUE #1044] Does downloading videos in chunks help improve download success rates? #28730

Closed
opened 2026-07-13 09:23:59 -05:00 by GiteaMirror · 6 comments
Owner

Originally created by @teddy171 on GitHub (Jan 11, 2025).
Original GitHub issue: https://github.com/imputnet/cobalt/issues/1044

describe the feature you'd like to see

According to #1040 and #1039, youtube either blocking or intentionally breaking streams at random points so the video fail to be downloaded. In this case, it's impossible to download any video larger than 100MB. I wonder if cobalt download videos in chunks can deal with the situaion. If video is divided to several chunks in small size(such as 10MB), cobalt doesn't need to give up all chunks when the stream break. If this is a possible solution, I'll try to make a PR to achieve the feature.

additional context

No response

Originally created by @teddy171 on GitHub (Jan 11, 2025). Original GitHub issue: https://github.com/imputnet/cobalt/issues/1044 ### describe the feature you'd like to see According to #1040 and #1039, youtube either blocking or intentionally breaking streams at random points so the video fail to be downloaded. In this case, it's impossible to download any video larger than 100MB. I wonder if cobalt download videos in chunks can deal with the situaion. If video is divided to several chunks in small size(such as 10MB), cobalt doesn't need to give up all chunks when the stream break. If this is a possible solution, I'll try to make a PR to achieve the feature. ### additional context _No response_
GiteaMirror added the feature request label 2026-07-13 09:23:59 -05:00
Author
Owner

@wukko commented on GitHub (Jan 11, 2025):

cobalt already downloads videos in chunks. if you're talking about HLS (for youtube), it can be enabled in settings: https://cobalt.tools/settings/video#youtube-hls

<!-- gh-comment-id:2585185754 --> @wukko commented on GitHub (Jan 11, 2025): cobalt already downloads videos in chunks. if you're talking about HLS (for youtube), it can be enabled in settings: https://cobalt.tools/settings/video#youtube-hls
Author
Owner

@teddy171 commented on GitHub (Jan 11, 2025):

But why did cobalt's download speed become 0 after sometime's download. If it's caused by heavy downloads, is it better to resume, wait for a while, and then continue downloading?

<!-- gh-comment-id:2585245865 --> @teddy171 commented on GitHub (Jan 11, 2025): But why did cobalt's download speed become 0 after sometime's download. If it's caused by heavy downloads, is it better to resume, wait for a while, and then continue downloading?
Author
Owner

@teddy171 commented on GitHub (Jan 11, 2025):

Another possible solution is only download a part of video(such as 50MB) each time. If a part encounters the error, just that part should be redownloaded instead of all the file.

<!-- gh-comment-id:2585246780 --> @teddy171 commented on GitHub (Jan 11, 2025): Another possible solution is only download a part of video(such as 50MB) each time. If a part encounters the error, just that part should be redownloaded instead of all the file.
Author
Owner

@wukko commented on GitHub (Jan 11, 2025):

i’m not sure that you understand why this is happening in the first place, so i’ll try to explain:

after some time, usually closer to the end of the stream, googlevideo starts returning 403 with no actual data. the stream won’t ever return anything but 403 from this point, so you have to request the entire video info again to continue downloading or start over. there’s no solution to this as far as we’re aware, but you’re welcome to make a pull request that follows our contribution guidelines and doesn’t break anything else.

hls is not affected by this, however, and we’ll soon make it default.

<!-- gh-comment-id:2585249905 --> @wukko commented on GitHub (Jan 11, 2025): i’m not sure that you understand why this is happening in the first place, so i’ll try to explain: after some time, usually closer to the end of the stream, googlevideo starts returning 403 with no actual data. the stream won’t ever return anything but 403 from this point, so you have to request the entire video info again to continue downloading or start over. there’s no solution to this as far as we’re aware, but you’re welcome to make a pull request that follows our [contribution guidelines](https://github.com/imputnet/cobalt/blob/main/CONTRIBUTING.md) and doesn’t break anything else. hls is not affected by this, however, and we’ll soon make it default.
Author
Owner

@teddy171 commented on GitHub (Jan 11, 2025):

In my case, after using hls, the situation becomes better, but it still cannot download a complete video. Around 100MB, the download process stops.

<!-- gh-comment-id:2585254027 --> @teddy171 commented on GitHub (Jan 11, 2025): In my case, after using hls, the situation becomes better, but it still cannot download a complete video. Around 100MB, the download process stops.
Author
Owner

@wukko commented on GitHub (Jan 21, 2025):

try again, we fixed the underlying issue

<!-- gh-comment-id:2605009487 --> @wukko commented on GitHub (Jan 21, 2025): try again, we fixed the underlying issue
Sign in to join this conversation.