imputnet / cobalt

best way to save what you love
https://cobalt.tools
GNU Affero General Public License v3.0
14.82k stars 1.21k forks source link

Ability to fetch all the available qualities from the API #571

Open yodaluca23 opened 3 months ago

yodaluca23 commented 3 months ago

describe the feature you'd like to see Right now, if one tries to build any sort of automated downloader for a site, they have to somehow manually extract the qualities of a video, and even then sometimes Cobalt refuses to accept them when they're available. Take YouTube, I have a user script that scrapes the YouTube HTML for the available qualities, and tries to request them from Cobalt, but for some reason sometimes Cobalt doesn't have them (though this may just be because I am not specifying the right codec, the feature request still stands either way), and it defaults back to the highest possible. It's especially hard when videos have special codecs like this one that gives even more unsupported qualities. A simple way to request from the API all the qualities Cobalt supports (and formats would also be useful) for a video would be much appreciated.

describe alternatives you've considered An initial request to the /api/json endpoint without specifying certain parameters could return a list of available formats and quality options, instead of the most standard download response.