cobalt icon indicating copy to clipboard operation
cobalt copied to clipboard

Does downloading videos in chunks help improve download success rates?

Open teddy171 opened this issue 1 year ago • 5 comments

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

teddy171 avatar Jan 11 '25 06:01 teddy171

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

wukko avatar Jan 11 '25 09:01 wukko

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?

teddy171 avatar Jan 11 '25 12:01 teddy171

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.

teddy171 avatar Jan 11 '25 12:01 teddy171

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.

wukko avatar Jan 11 '25 12:01 wukko

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

teddy171 avatar Jan 11 '25 12:01 teddy171

try again, we fixed the underlying issue

wukko avatar Jan 21 '25 15:01 wukko