fix broken video codec

exclude audio codecs that don't work on mobile
This commit is contained in:
Niko Storni 2021-05-25 21:08:12 +02:00
parent 21e6603a26
commit 087f20c133

View file

@ -277,7 +277,7 @@ func (v *YoutubeVideo) download() error {
for i := 0; i < len(qualities); i++ { for i := 0; i < len(qualities); i++ {
quality := qualities[i] quality := qualities[i]
argsWithFilters := append(ytdlArgs, "-fbestvideo[ext=mp4][height<="+quality+"]+bestaudio[ext!=webm]") argsWithFilters := append(ytdlArgs, "-fbestvideo[ext=mp4][vcodec!*=av01][height<="+quality+"]+bestaudio[ext!=webm][format_id!=258][format_id!=251][format_id!=256][format_id!=327]")
argsWithFilters = append(argsWithFilters, userAgent...) argsWithFilters = append(argsWithFilters, userAgent...)
cmd := exec.Command("youtube-dl", argsWithFilters...) cmd := exec.Command("youtube-dl", argsWithFilters...)
log.Printf("Running command youtube-dl %s", strings.Join(argsWithFilters, " ")) log.Printf("Running command youtube-dl %s", strings.Join(argsWithFilters, " "))