Skip to content

Instantly share code, notes, and snippets.

Created March 30, 2022 19:34
What would you like to do?
generate YAML header matter for MP3s attached to Jekyll posts
#!/usr/bin/env bash
if [ "$#" -ne 1 ]; then
echo "usage: rss-media-info path/to/attachment.mp3"
exit 1
read -r -d '' retv <<EOF
itunes_duration: '$(ffmpeg -i "$1" 2>&1 | grep "Duration:" | cut -d ' ' -f 4 | sed s/,//)'
episode_length: $(stat -f%z "$1")
media_url: $(basename "$1")
echo "$retv"
echo "$retv" | pbcopy
echo ""
echo "(copied)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment