fixed add

This commit is contained in:
2023-11-21 14:39:28 -07:00
parent d09c811bcc
commit b18ff53a8e

2
yt
View File

@@ -38,7 +38,7 @@ add() { # adds a video to a playlist file
while test -f "$YT_PL_DIR/$2.m3u"; do
file="$YT_PL_DIR/$2.m3u"
video="$(printf '%s\n' "$1" \
| sed -e 's/youtu\.be\//www.youtube\.com\/watch?q=/g' -e 's/\?[^q].*$//g')"
| sed -e 's/youtu\.be\//www.youtube\.com\/watch?v=/g' -e 's/\?[^v].*$//g')"
printf '%s\n' "$video"
if test -n "$(grep -e "$video" "$file")"