Added curly braces
parent
53a17d34ee
commit
9699596be8
36
gdead
36
gdead
|
@ -38,18 +38,18 @@ while (( "$#" )); do
|
||||||
done
|
done
|
||||||
|
|
||||||
# Parse show date
|
# Parse show date
|
||||||
YYYY="$(echo $SHOW_DATE | awk '{print $1}')"
|
YYYY="$(echo ${SHOW_DATE} | awk '{print $1}')"
|
||||||
MM="$(echo $SHOW_DATE | awk '{print $2}')"
|
MM="$(echo ${SHOW_DATE} | awk '{print $2}')"
|
||||||
DD="$(echo $SHOW_DATE | awk '{print $3}')"
|
DD="$(echo ${SHOW_DATE} | awk '{print $3}')"
|
||||||
YYYY1="1900"; YYYY2="2020"
|
YYYY1="1900"; YYYY2="2020"
|
||||||
MM1="01"; MM2="12"
|
MM1="01"; MM2="12"
|
||||||
DD1="01"; DD2="31"
|
DD1="01"; DD2="31"
|
||||||
if [ "$YYYY" != "" ]; then
|
if [ "${YYYY}" != "" ]; then
|
||||||
YYYY1="$YYYY"; YYYY2="$YYYY"
|
YYYY1="${YYYY}"; YYYY2="${YYYY}"
|
||||||
if [ "$MM" != "" ]; then
|
if [ "${MM}" != "" ]; then
|
||||||
MM1="$MM"; MM2="$MM"
|
MM1="${MM}"; MM2="${MM}"
|
||||||
if [ "$DD" != "" ]; then
|
if [ "${DD}" != "" ]; then
|
||||||
DD1="$DD"; DD2="$DD"
|
DD1="${DD}"; DD2="${DD}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -62,27 +62,27 @@ echo " This is free software, and you are welcome to redistribute it"
|
||||||
echo " under certain conditions"
|
echo " under certain conditions"
|
||||||
|
|
||||||
# Metadata search URL
|
# Metadata search URL
|
||||||
URL="https://archive.org/advancedsearch.php?q=collection%3A%28GratefulDead%29$SBD\
|
URL="https://archive.org/advancedsearch.php?q=collection%3A%28GratefulDead%29${SBD}\
|
||||||
+AND+date%3A%5B$YYYY1-$MM1-$DD1+TO+$YYYY1-$MM2-$DD2%5D\
|
+AND+date%3A%5B${YYYY1}-${MM1}-${DD1}+TO+${YYYY1}-${MM2}-${DD2}%5D\
|
||||||
&fl%5B%5D=identifier\
|
&fl%5B%5D=identifier\
|
||||||
&$SORT&rows=1&page=1&output=json&callback=c&save=yes#raw"
|
&${SORT}&rows=1&page=1&output=json&callback=c&save=yes#raw"
|
||||||
|
|
||||||
# Metadata search
|
# Metadata search
|
||||||
res=$(curl --user-agent "$UA" --silent "$URL" | cut -c 3- | head -c-2 | jq -r '.response.docs[0].identifier')
|
res=$(curl --user-agent "${UA}" --silent "${URL}" | cut -c 3- | head -c-2 | jq -r '.response.docs[0].identifier')
|
||||||
if [ "$res" == "" ]; then
|
if [ "${res}" == "" ]; then
|
||||||
echo "FATAL: Could not connect to archive.org"
|
echo "FATAL: Could not connect to archive.org"
|
||||||
exit 4
|
exit 4
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$res" == "null" ]; then
|
if [ "${res}" == "null" ]; then
|
||||||
echo "No shows found."
|
echo "No shows found."
|
||||||
exit 5
|
exit 5
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Stream it...
|
# Stream it...
|
||||||
stream="https://archive.org/download/$res/${res}_vbr.m3u"
|
stream="https://archive.org/download/${res}/${res}_vbr.m3u"
|
||||||
if [ "${GUI}" == "true" ]; then
|
if [ "${GUI}" == "true" ]; then
|
||||||
vlc --http-user-agent "$UA" --qt-system-tray "$stream"
|
vlc --http-user-agent "${UA}" --qt-system-tray "${stream}"
|
||||||
else
|
else
|
||||||
nvlc --play-and-exit --http-user-agent "$UA" "$stream"
|
nvlc --play-and-exit --http-user-agent "${UA}" "${stream}"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue