Feb-26-2024, 12:45 PM
Obviously the
format_selector()
function is called either by YoutubeDL(ydl_opts)
or by ydl.download(URLS)
. The ctx
argument is created internally by the yt_dlp
module. You can find the type of this object and see where it is called by replacing the function bydef format_selector(ctx): raise RuntimeError(ctx)
« We can solve any problem by introducing an extra level of indirection »