dotfiles/.local/bin/ogg_add_cover
2020-11-18 00:51:00 +01:00

14 lines
382 B
Bash

#!/bin/bash
LINK="${1}"
FILE="${2}"
BASENAME="$(basename "${FILE}" .ogg)"
wget "${LINK}" -O "${BASENAME}.jpg" && \
ffmpeg -i "${FILE}" -f ffmetadata "${BASENAME}.meta" && \
ogg-cover-art "${BASENAME}.jpg" >> "${BASENAME}.meta" && \
ffmpeg -i "${BASENAME}.meta" -i "${FILE}" -map_metadata 0 -c:a copy "${BASENAME}-cover.ogg"
rm "${BASENAME}.meta"
rm "${BASENAME}.jpg"