generalize playlist creation and autocreate channels for common tag themes - bi… | |
git clone git://bitreich.org/bitreich-tv git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfr… | |
Log | |
Files | |
Refs | |
Tags | |
LICENSE | |
--- | |
commit 42358e6a74041c43405b61d76660051707638803 | |
parent 6432f2d9498ec1bd3f401eb6629e86b5de9fda97 | |
Author: Anders Damsgaard <[email protected]> | |
Date: Mon, 2 Nov 2020 21:04:16 +0100 | |
generalize playlist creation and autocreate channels for common tag themes | |
Diffstat: | |
A bin/brtv-news.sh | 15 +++++++++++++++ | |
D brtv-all.sh | 11 ----------- | |
D brtv-bitreich.sh | 12 ------------ | |
D brtv-corona.sh | 12 ------------ | |
M brtv-generate-playlists.sh | 16 +++++++++++++--- | |
D brtv-gopher.sh | 12 ------------ | |
D brtv-news.sh | 17 ----------------- | |
D brtv-slav.sh | 12 ------------ | |
8 files changed, 28 insertions(+), 79 deletions(-) | |
--- | |
diff --git a/bin/brtv-news.sh b/bin/brtv-news.sh | |
@@ -0,0 +1,15 @@ | |
+#!/bin/sh | |
+# outputs m3u playlist of memes added to the memecache the last two days | |
+ | |
+annna="${1:-/home/ad/code/annna}" | |
+tagfile="${2:-modules/hashtags/hashtags.txt}" | |
+ | |
+(cd "${annna}" && | |
+ git log --all --pretty="%s" --date=relative --since="2 days ago") | \ | |
+grep 'Adding #' | sed 's/.* #/#/;s/ .*//' | \ | |
+while read -r tag; do | |
+ grep "$tag" "${annna}/${tagfile}" | head -1 | |
+done | \ | |
+sort -R | \ | |
+bin/brtv-generate-playlist.sh | \ | |
+bin/brtv-playlist-to-m3u.sh | |
diff --git a/brtv-all.sh b/brtv-all.sh | |
@@ -1,11 +0,0 @@ | |
-#!/bin/sh | |
-# outputs m3u playlist of all memes | |
- | |
-set -e | |
- | |
-annna="/home/ad/code/annna" | |
-tagfile="modules/hashtags/hashtags.txt" | |
- | |
-sort -R "${annna}/${tagfile}" | \ | |
-bin/brtv-generate-playlist.sh | \ | |
-bin/brtv-playlist-to-m3u.sh | |
diff --git a/brtv-bitreich.sh b/brtv-bitreich.sh | |
@@ -1,12 +0,0 @@ | |
-#!/bin/sh | |
-# outputs m3u playlist of memes containing 'bitreich' | |
- | |
-set -e | |
- | |
-annna="/home/ad/code/annna" | |
-tagfile="modules/hashtags/hashtags.txt" | |
- | |
-grep -E "^#[A-z0-9-]*bitreich[A-z0-9-]* " "${annna}/${tagfile}" | \ | |
-sort -R | \ | |
-bin/brtv-generate-playlist.sh | \ | |
-bin/brtv-playlist-to-m3u.sh | |
diff --git a/brtv-corona.sh b/brtv-corona.sh | |
@@ -1,12 +0,0 @@ | |
-#!/bin/sh | |
-# outputs m3u playlist of memes with 'corona-' prefix | |
- | |
-set -e | |
- | |
-annna="/home/ad/code/annna" | |
-tagfile="modules/hashtags/hashtags.txt" | |
- | |
-grep -E "^#corona-" "${annna}/${tagfile}" | \ | |
-sort -R | \ | |
-bin/brtv-generate-playlist.sh | \ | |
-bin/brtv-playlist-to-m3u.sh | |
diff --git a/brtv-generate-playlists.sh b/brtv-generate-playlists.sh | |
@@ -12,6 +12,16 @@ cd "$brtv" | |
./bin/brtv-imgs-to-video.sh < "${annna}/${tagfile}" >/dev/null | |
f="$(mktemp)" | |
-for channel in news bitreich gopher corona slav all; do | |
- ./"brtv-${channel}.sh" > "$f" && cp "$f" "/var/gopher/${channel}.m3u" | |
-done | |
+./bin/brtv-generate-theme-channels.sh < "${annna}/${tagfile}" | |
+./bin/brtv-news.sh "${annna}" "${tagfile}" > news.m3u | |
+ | |
+sort -R "${annna}/${tagfile}" | \ | |
+ bin/brtv-generate-playlist.sh | \ | |
+ bin/brtv-playlist-to-m3u.sh > all.m3u | |
+ | |
+grep -E "^#[A-z0-9-]*gopher[A-z0-9-]* " "${annna}/${tagfile}" | \ | |
+ sort -R | \ | |
+ bin/brtv-generate-playlist.sh | \ | |
+ bin/brtv-playlist-to-m3u.sh > gopher.m3u | |
+ | |
+mv *.m3u /var/gopher/ | |
diff --git a/brtv-gopher.sh b/brtv-gopher.sh | |
@@ -1,12 +0,0 @@ | |
-#!/bin/sh | |
-# outputs m3u playlist of memes containing 'gopher' | |
- | |
-set -e | |
- | |
-annna="/home/ad/code/annna" | |
-tagfile="modules/hashtags/hashtags.txt" | |
- | |
-grep -E "^#[A-z0-9-]*gopher[A-z0-9-]* " "${annna}/${tagfile}" | \ | |
-sort -R | \ | |
-bin/brtv-generate-playlist.sh | \ | |
-bin/brtv-playlist-to-m3u.sh | |
diff --git a/brtv-news.sh b/brtv-news.sh | |
@@ -1,17 +0,0 @@ | |
-#!/bin/sh | |
-# outputs m3u playlist of memes added to the memecache the last two days | |
- | |
-set -e | |
- | |
-annna="/home/ad/code/annna" | |
-tagfile="modules/hashtags/hashtags.txt" | |
- | |
-(cd "${annna}" && | |
- git log --all --pretty="%s" --date=relative --since="2 days ago") | \ | |
-grep 'Adding #' | sed 's/.* #/#/;s/ .*//' | \ | |
-while read -r tag; do | |
- grep "$tag" "${annna}/${tagfile}" | head -1 | |
-done | \ | |
-sort -R | \ | |
-bin/brtv-generate-playlist.sh | \ | |
-bin/brtv-playlist-to-m3u.sh | |
diff --git a/brtv-slav.sh b/brtv-slav.sh | |
@@ -1,12 +0,0 @@ | |
-#!/bin/sh | |
-# outputs m3u playlist of memes with 'slav-' prefix | |
- | |
-set -e | |
- | |
-annna="/home/ad/code/annna" | |
-tagfile="modules/hashtags/hashtags.txt" | |
- | |
-grep -E "^#slav-" "${annna}/${tagfile}" | \ | |
-sort -R | \ | |
-bin/brtv-generate-playlist.sh | \ | |
-bin/brtv-playlist-to-m3u.sh |