Command dl opus to download highest quality audio as or into an opus file through yt-dlp.

Add to config.nu:

# Download highest quality Opus audio as/into .opus file
def "dl opus" [url: string] {
    yt-dlp --extract-audio --audio-quality 0 --audio-format opus $"($url)"
}

Usage:

dl opus <url>

I have set up dl as an alias for yt-dlp via alias dl = yt-dlp. The def above adds an overlaying sub-command.