Heh he eh, totally with you. The following kind of snippets appear a lot in my command line history (for music):
youtube-dl -x --audio-format mp3 <mediaurl> youtube-dl -x --audio-format mp3 <mediaurl>Since lossy to lossy transcodes always cause some degradation due to the way perceptual codecs discard data, it's always best to use them as-is without converting.
AAC is widely compatible these days and is the broadcast industry (ITU / EBU) standard for distribution of end-user audio, the default recording format for most consumer and pro-sumer equipment, and also what Youtube's upload giudelines suggest. Therefore it's better just to get the `-f140 -x` for maximum compatibility, unless you know you can play the Opus audio and have reason to believe the upload was higher quality.
youtube-dl() {
if [ $# -eq 0 ]; then
if [ "${WAYLAND_DISPLAY}" != "" ]; then
env youtube-dl -f best "$(wl-paste --type text/plain)"
else
env youtube-dl -f best "$(xsel -b)"
fi
else
env youtube-dl "$@"
fi
}
(Replace "-f best" if you just want audio.)Source here if anyone's interested: https://github.com/liskin/dotfiles/blob/home/bin/youtube-dl-...