Skip to content

Instantly share code, notes, and snippets.

@manjaroman2
manjaroman2 / sampdl.sh
Created October 15, 2023 00:10
Sample downloading bash script (yt-dlp)
#!/usr/bin/bash
sample_dir="~/music/sampledl"
yt_dlp_path="/usr/local/bin/yt-dlp"
audio_format="mp3"
regex='(https?|ftp|file)://[-[:alnum:]\+&@#/%?=~_|!:,.;]*[-[:alnum:]\+&@#/%=~_|]'
if [ -n "$1" ]; then
URL="$1"
else
URL=$(xsel -o)