Search notes:

Script: yt2mp3

#!/bin/sh

if [ $# -lt 1 ]; then
  echo Specify title
  exit 1
fi

if ! command -v xclip >/dev/null 2>&1; then
  echo xclip is not available
  exit 1
fi

if ! command -v ffmpeg >/dev/null 2>&1; then
  echo ffmpeg is not available
  exit 1
fi

if [ ! -d ~/mp3 ]; then
   mkdir ~/mp3
fi
  

url=$(xclip -o)
title="$1"

yt-dlp -x --audio-format mp3 $url -o ~/mp3/$title.mp3
Github repository scripts-and-utilities, path: /yt2mp3

See also

The PowerShell script yt2mp3.ps1
Scripts

Index