Skip to content

Instantly share code, notes, and snippets.

@jazz-it
jazz-it / getmusic.sh
Last active October 23, 2021 17:30
Download a YouTube Playlist, extract audio in best quality with youtube-dl and normalize volume with r128gain (ReplayGain 2.0)
#!/bin/bash
# helper function parameters: 0 or empty = print only, 1 = rename files!
renamemp3() {
local s="${1:-0}"
for f in *.mp3; do
if [[ "$f" == *[\"\`]* ]]
then
filename=${f%.*}
filename=${filename//\"}