Introduction
Introduction Statistics Contact Development Disclaimer Help
tbrtv-generate-theme-channels.sh: pass hashtags.txt path as argument - bitreich…
git clone git://src.adamsgaard.dk/bitreich-tv
Log
Files
Refs
LICENSE
---
commit 7acbd53258bc1f755c39d9766706e4fd0df431bf
parent 42358e6a74041c43405b61d76660051707638803
Author: Anders Damsgaard <[email protected]>
Date: Mon, 2 Nov 2020 21:34:25 +0100
brtv-generate-theme-channels.sh: pass hashtags.txt path as argument
Diffstat:
M bin/brtv-generate-theme-channels.sh | 19 ++++++++++++++-----
M brtv-generate-playlists.sh | 2 +-
2 files changed, 15 insertions(+), 6 deletions(-)
---
diff --git a/bin/brtv-generate-theme-channels.sh b/bin/brtv-generate-theme-chan…
t@@ -1,9 +1,18 @@
#!/bin/sh
# generate channels where tags begin with a common word
-# pass hashtags.txt as stdin
-# optionally specify cutoff value as $1
+# specify hashtags.txt path as $1 and optionally specify cutoff value as $2
-awk -v cutoff="${1:-25}" '
+die()
+{
+ printf '%s: error: %s\n' "${0##*/}" "$1" >&2
+ exit 1
+}
+
+if [ $# -lt 1 ] || [ ! -r "$1" ]; then
+ die 'pass hashtags.txt path as first argument'
+fi
+
+awk -v cutoff="${2:-25}" '
/^#[A-z0-9]+-.* / {
split($1, tagwords, "-")
tags[tagwords[1]]++
t@@ -13,8 +22,8 @@ END {
if (tags[tag] >= cutoff)
print tag
}
-' | while read -r tag; do
- grep -E "^${tag}-" "${annna}/${tagfile}" | \
+' "${1}" | while read -r tag; do
+ grep -E "^${tag}" "${1}" | \
sort -R | \
bin/brtv-generate-playlist.sh | \
bin/brtv-playlist-to-m3u.sh > "${tag#\#}.m3u"
diff --git a/brtv-generate-playlists.sh b/brtv-generate-playlists.sh
t@@ -12,7 +12,7 @@ cd "$brtv"
./bin/brtv-imgs-to-video.sh < "${annna}/${tagfile}" >/dev/null
f="$(mktemp)"
-./bin/brtv-generate-theme-channels.sh < "${annna}/${tagfile}"
+./bin/brtv-generate-theme-channels.sh "${annna}/${tagfile}"
./bin/brtv-news.sh "${annna}" "${tagfile}" > news.m3u
sort -R "${annna}/${tagfile}" | \
You are viewing proxied material from mx1.adamsgaard.dk. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.