kkdai / youtube

Download Youtube Video in Golang
MIT License
3.37k stars 433 forks source link

Trying to get the size of a video #246

Closed eyalgolan closed 2 years ago

eyalgolan commented 2 years ago

Hey,

I'm trying to use youtube.Client's GetStream function to get the the stream and size of the video I want to download, like so:

formats := video.Formats.WithAudioChannels() // only get videos with audio
stream, size, err := client.GetStream(video, &formats[0])

However, the returned size is always 0. How can I get the video's size?

Thanks

corny commented 2 years ago

Thanks for reporting, I've just written a fix.