From ba8c38102f78aed8cfa8af7af7f213dd73758d33 Mon Sep 17 00:00:00 2001 From: Soothspider Date: Thu, 8 Feb 2024 22:52:31 -0800 Subject: [PATCH] Updating tooling to use shorter name. --- tools/twitch_generate_readme.sh | 3 ++- tools/twitch_move_vtt.sh | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/twitch_generate_readme.sh b/tools/twitch_generate_readme.sh index dc69336..f22618f 100755 --- a/tools/twitch_generate_readme.sh +++ b/tools/twitch_generate_readme.sh @@ -25,6 +25,7 @@ for ((i = 0; i < ${#folders[@]}; i++)); do id="$(cut -d' ' -f1 <<< "$base")" IFS=',' read -r -a ids <<< "${id}" stream="$(echo $base | cut -d' ' -f4- | cut -d'[' -f1 | sed 's:/*$::')" + suffix=" -- Gigaohm Biological High Resistance Low Noise Information Brief" printf "\n id: $id \n stream: $stream \n\n" @@ -34,7 +35,7 @@ for ((i = 0; i < ${#folders[@]}; i++)); do fi contents="" - printf -v contents "${contents}# $stream\n\n" + printf -v contents "${contents}# ${stream}${suffix}\n\n" printf -v contents "${contents}## Streams\n" for u in ${ids[@]}; do url="https://twitch.tv/videos/$u" diff --git a/tools/twitch_move_vtt.sh b/tools/twitch_move_vtt.sh index fd9df56..adca6f4 100755 --- a/tools/twitch_move_vtt.sh +++ b/tools/twitch_move_vtt.sh @@ -31,8 +31,13 @@ for ((i = 0; i < ${#files[@]}; i++)); do id="$(cut -d' ' -f1 <<< "$base")" date="$(echo $base | cut -d'[' -f2 | cut -d']' -f1 | cut -d' ' -f3)" + stream="$(echo $base | cut -d' ' -f3- | cut -d'[' -f1)" - stream="${stream/"Brief "/"Gigaohm Biological High Resistance Low Noise Information Brief"}" + # Strip unnecessary dettails. + stream="${stream/"-- Brief "/""}" + # Trim trailing spaces + stream="${stream%"${stream##*[![:space:]]}"}" + folder="${id} (${date}) - ${stream}" target="${folder}${suffix}.vtt"