Re:New youtube-dl release: v2020.11.01.1
by ivan_ah on Sunday November 01, 2020 @04:27PM
(#24962650)
Heh he eh, totally with you. The following kind of snippets appear a lot in my command line history (for music):
[ Parent
| on HN ]
Youtube only offer audio in either AAC (in a .m4a container) or Opus formats.
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.
Re:New youtube-dl release: v2020.11.01.1
by majewsky on Sunday November 01, 2020 @05:59PM
(#24963302)
I have this in my shellrc, so that `youtube-dl` without arguments takes the URL from the clipboard:
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.)
Re:New youtube-dl release: v2020.11.01.1
by Liskni_si on Sunday November 01, 2020 @07:27PM
(#24963820)
I took this "shell wrapper around youtube-dl" thing a bit further: I have a script that uses youtube-dl to download and enqueue music to mpd. I mainly use it to listen to bandcamp albums that I don't know yet so I can decide whether to buy them or stop listening to them. The script also automatically deletes stuff after a while so I don't accidentally keep listening to albums I haven't bought.
Source here if anyone's interested: https://github.com/liskin/dotfiles/blob/home/bin/youtube-dl-...