summaryrefslogtreecommitdiff
path: root/templates/icecast2/mp3-to-ogg.sh.j2
diff options
context:
space:
mode:
authorheqnx <root@heqnx.com>2025-07-06 14:57:39 +0300
committerheqnx <root@heqnx.com>2025-07-06 14:57:39 +0300
commita064cbda2086b79b6cc04111cb308a6b2d770aa6 (patch)
tree9b2c6aa08775aaae76420f9ad8d6baaf728bbe24 /templates/icecast2/mp3-to-ogg.sh.j2
parent3559ca8a720086f080286e887a29b6fa68810fa9 (diff)
downloadansible-icecast2-a064cbda2086b79b6cc04111cb308a6b2d770aa6.tar.gz
ansible-icecast2-a064cbda2086b79b6cc04111cb308a6b2d770aa6.zip
replaced ices2 which only supports vorbis, with liquidsoap + creation of title metadata; reorganized templates
Diffstat (limited to 'templates/icecast2/mp3-to-ogg.sh.j2')
-rw-r--r--templates/icecast2/mp3-to-ogg.sh.j236
1 files changed, 0 insertions, 36 deletions
diff --git a/templates/icecast2/mp3-to-ogg.sh.j2 b/templates/icecast2/mp3-to-ogg.sh.j2
deleted file mode 100644
index f475d36..0000000
--- a/templates/icecast2/mp3-to-ogg.sh.j2
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/bash
-
-if ! command -v ffmpeg &>/dev/null; then
- printf "%s\n" "[err] ffmpeg not found"
- exit 1
-fi
-
-DIR="{{ radio_music_dir }}"
-
-shopt -s nullglob
-for mp3file in "${DIR}"/*.mp3; do
- oggfile="${mp3file%.mp3}.ogg"
- printf "%s\n" "[inf] converting ${mp3file} to ${oggfile} with ${title}"
-
- if ffmpeg -loglevel error -y -i "${mp3file}" -acodec libvorbis -q:a 5 -metadata title="${title}" "${oggfile}"; then
- printf "%s\n" "[inf] conversion successful, removing ${mp3file}"
- rm -f "${mp3file}"
- else
- printf "%s\n" "[err] conversion failed for ${mp3file}"
- fi
-done
-
-for oggfile in "${DIR}"/*.ogg; do
- title="$(basename "${oggfile}" .ogg)"
- vorbiscomment -w -t "TITLE=${title}" "${oggfile}"
-done
-
-ls "${DIR}"/*.ogg > "${DIR}/playlist.txt"
-printf "%s\n" "[inf] playlist generated at ${DIR}/playlist.txt"
-
-if id -u icecast2 >/dev/null 2>&1 && getent group icecast >/dev/null 2>&1; then
- chown -R icecast2:icecast "$DIR"
- printf "%s\n" "[inf] chowned ${DIR} with icecast2:icecast"
-else
- printf "%s\n" "[err] user or group icecast2:icecast does not exist, skipping chown"
-fi