fent / node-ytdl-core

YouTube video downloader in javascript.
MIT License
4.48k stars 791 forks source link

format 'highest' doesn't always return both video and audio #836

Open redbrain opened 3 years ago

redbrain commented 3 years ago

ytdl() chooses the format 'highest' by default, which according to the README prefers both video and audio. The selector for highest currently just chooses formats[0]. Normally, this is itag 18, so it's fine. However, for some videos, it's itag 303 (1080p HFR video with no audio), seemingly not what 'highest' should select. One such video with this behavior is https://www.youtube.com/watch?v=5LJcTyMpQhY. For other videos, the itag may vary in a different way; I haven't yet done extended testing of videos. This appears to be unexpected behavior; is that the case? If so, should it be patched in some way?

fent commented 3 years ago

yep, hat does seem misleading. hopefully when https://www.youtube.com/watch?v=5LJcTyMpQhY is fixed, this changes too. they'd both be breaking changes.

redbrain commented 3 years ago

It happens with the following video as well: https://www.youtube.com/watch?v=OEtyScs6djU Until we can figure out why this is happening, we could set 'highest' to always return itag 18.

redbrain commented 3 years ago

And this video it seems: https://www.youtube.com/watch?v=9UM96ULtLv0 Basically some select videos with HFR (60p) option. Again, we could set 'highest' to always return itag 18 as a temporary fix.

TimeForANinja commented 3 years ago

Don't mind me - just linking this to #770 😉

redbrain commented 3 years ago

Is this a dupe of #770? If so It should be closed