summaryrefslogtreecommitdiffstats
path: root/skripti/earhorn_m3u.sh
blob: 51f33c7e12eb030037fd380b78b91fc0eb0604c5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash
set -xeo pipefail
echo "#EXTM3U"
find 2* -type f | while read file
do
	date=`cut -d/ -f1,2,3 <<<$file | sed s,/,-,g`
	time=`cut -d/ -f4 <<<$file | cut -d. -f1`
	h=${time:0:2}
	m=${time:2:2}
	s=${time:4:2}
	echo "#EXTINF:`ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 $file  | cut -d. -f1`,Radijski arhiv"
	echo "#EXT-X-PROGRAM-DATE-TIME:${date}T$h:$m:${s}Z"
	echo $1$file
done