Open 4strodev opened 2 months ago
Not all streams have audio. Are you sure you are downloading one that has audio?
Yes I tried with three different videos all of them with audio. I don't know if the bug is something replicable or not, but I just cloned the repo and executed the CLI, giving them a YouTube link. The video downloaded successfully but without audio.
same happened to me as well.
I have the same issue. I kinda solved it, but i don't get the best quality, i always get either 360p or something lower even though the video has multiple options for quality.
var format *youtube.Format
for _, f := range video.Formats {
if f.AudioChannels > 0 && f.QualityLabel != "" { // Ensure it has both video and audio
if format == nil || f.Height > format.Height {
format = &f // Select the format with the highest resolution
}
}
}
indeed, i share the low quality issue with you. thanks for sharing the code.
I tried it with different videos and all has the same problem. Maybe it's a failure that only happens on Linux. I found this similar issue #279, but the provided advice doesn't work.