From 004e3ffbf8c4eb15197a13997d32903d0c1ef49d Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Mon, 31 Jan 2022 11:16:04 +0100 Subject: [PATCH] bin: add delbig and extend ffmeta --- .local/bin/scripts/delbig | 3 +++ .local/bin/scripts/ffmeta | 10 +++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100755 .local/bin/scripts/delbig diff --git a/.local/bin/scripts/delbig b/.local/bin/scripts/delbig new file mode 100755 index 0000000..ca5abb8 --- /dev/null +++ b/.local/bin/scripts/delbig @@ -0,0 +1,3 @@ +#!/bin/sh +# Find and remove sizeable files +find -size +5M -print -exec rm -I {} + diff --git a/.local/bin/scripts/ffmeta b/.local/bin/scripts/ffmeta index b45f62e..6841f82 100755 --- a/.local/bin/scripts/ffmeta +++ b/.local/bin/scripts/ffmeta @@ -1,6 +1,10 @@ #!/bin/sh -# Extract song metadata with ffprobe -while read f; do +# View song metadata using ffprobe +# Accepts filenames from args or stdin (one file per line) +if test "$#" -eq 0 +then cat +else printf '%s\n' "$@" +fi | while read f; do highlight "$f" - ffprobe "$f" 2>&1 | grep -A90 'Metadata:' + find "$f" -type f -exec ffprobe -hide_banner {} 2>&1 \; #| grep -A90 'Metadata:' done | less