Skip to content

Instantly share code, notes, and snippets.

@madjoe
madjoe / getmusic.sh
Last active Oct 6, 2020
Download a YouTube Playlist, extract audio in best quality with youtube-dl and normalize volume with r128gain (ReplayGain 2.0)
View getmusic.sh
#!/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//\"}