youtube.lua: open video format selection to "adaptive" streams
This:
- adds support for YouTube Shorts URLs
- disables throttling parameter descrambling for now, since it's broken
- cleans up some stuff
- introduces
&fmt={audio,video,hd}
URL parameters
For long now, YouTube has had two lists of stream formats in its configuration JSON, respectively labeled "formats" and "adaptiveFormats". The former is what we've traditionally been using, but has been on the decline (and maybe on the way out), in particular since it stopped offering 1080p or higher. The latter offers all formats and resolutions, but as audio-only or video-only elementary streams. The new URL parameters allow selecting those streams, either individually or combined using an input slave.
Note that this URL parameter isn't coming out of nowhere; so far you could always pass something such as &fmt=18
in the YouTube URL to force 360p resolution. There is no proper configuration mechanism for individual lua scripts, so overloading this parameter seems like a good solution.
Input-slave-based playback is experimental and not enabled by default. I believe that this offers a worse user experience at equal resolution than classic multiplexed streams, for example the end of videos doesn't play smoothly. Is it better to use video as main stream and audio as input slave, or the contrary? Is there an open ticket for input slave playback performance? This would be a good test case.
This also provides more ways to manually mitigate the data throttling issue.