Files
tool__scripts/manage-music/print-embedded-youtube-source.sh
2026-07-09 01:05:56 +02:00

16 lines
391 B
Bash
Executable File

#!/usr/bin/env bash
library="$1"
for file in "$library"/*; do
[[ -f "$file" ]] || continue
comment=$(ffprobe -v quiet -show_entries format_tags=comment \
-of default=noprint_wrappers=1:nokey=1 "$file")
if echo "$comment" | grep -Eiq "(youtube\.com|youtu\.be)"; then
echo "$comment" | grep -Eo "https?://(www\.)?(youtube\.com|youtu\.be)[^ ]+"
fi
done