Here's an example of the code. I'd like to know what ctx is here. It's not passed anywhere to a function and i can't use get('formats')[::-1] without this function. How does it work and called?
import yt_dlp URLS = ['https://www.youtube.com/watch?v=BaW_jenozKc'] def format_selector(ctx): formats = ctx.get('formats')[::-1] ..... ydl_opts = { 'format': format_selector, } with yt_dlp.YoutubeDL(ydl_opts) as ydl: ydl.download(URLS)