2021-07-05 18:45:21 -06:00
|
|
|
#!/bin/bash
|
|
|
|
# gdead
|
|
|
|
|
|
|
|
# Get shows from archive.org
|
|
|
|
|
|
|
|
# Vars
|
2021-07-05 19:28:26 -06:00
|
|
|
UA="gdead/curl/bash;https://gitea.gf4.pw/ki9/gdead"
|
2021-07-05 18:45:21 -06:00
|
|
|
START="$(date +%s)" # unix timestamp
|
|
|
|
|
|
|
|
# Args
|
|
|
|
YYYY=$1
|
|
|
|
MM=$2
|
|
|
|
DD=$3
|
|
|
|
|
2021-07-05 20:00:03 -06:00
|
|
|
# Initial output
|
|
|
|
echo " gdead Copyright (C) 2021 Keith Irwin (www.ki9.us)"
|
|
|
|
echo " This program comes with ABSOLUTELY NO WARRANTY; for details"
|
|
|
|
echo " see the LICENSE.md that came with it"
|
|
|
|
echo " This is free software, and you are welcome to redistribute it"
|
|
|
|
echo " under certain conditions"
|
|
|
|
echo
|
|
|
|
|
2021-07-05 18:45:21 -06:00
|
|
|
# Metadata search URL
|
|
|
|
URL="https://archive.org/advancedsearch.php?q=collection%3A%28GratefulDead%29+\
|
|
|
|
AND+subject%3A%28soundboard%29+\
|
|
|
|
AND+date%3A%5B$YYYY-$MM-$DD+TO+$YYYY-$MM-$DD%5D\
|
|
|
|
&fl%5B%5D=avg_rating&fl%5B%5D=downloads&fl%5B%5D=identifier&fl%5B%5D=source&fl%5B%5D=title\
|
|
|
|
&sort%5B%5D=num_favorites+asc&sort%5B%5D=avg_rating+asc&sort%5B%5D=num_reviews+asc\
|
|
|
|
&rows=10&page=1&output=json&callback=c&save=yes#raw"
|
|
|
|
|
|
|
|
# Prepare pipe
|
|
|
|
PIPE="/tmp/$START.gdead.fifo"
|
|
|
|
rm "$PIPE" 2>/dev/null
|
|
|
|
mkfifo "$PIPE"
|
|
|
|
|
|
|
|
# Metadata search
|
|
|
|
first_res=$(curl --user-agent "$UA" --silent "$URL" | cut -c 3- | head -c-2 | jq -r '.response.docs[0].identifier')
|
|
|
|
|
|
|
|
# Remove pipe
|
|
|
|
rm $PIPE 2>/dev/null
|
|
|
|
|
|
|
|
# Stream it
|
|
|
|
#vlc --http-user-agent "$UA" --qt-system-tray --qt-start-minimized \
|
|
|
|
nvlc --http-user-agent "$UA" \
|
|
|
|
"https://archive.org/download/$first_res/${first_res}_vbr.m3u"
|