Added --gui flag
parent
7b4ae288f7
commit
53a17d34ee
|
@ -14,13 +14,17 @@ ln -s /usr/local/src/gdead/gdead /usr/local/bin/gdead
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
```
|
```
|
||||||
gdead [-r|--rand|--random] [-a|--aud|--audience] [year [month [day]]]
|
gdead [-g|--gui] [-r|--rand|--random] [-a|--aud|--audience] [year [month [day]]]
|
||||||
```
|
```
|
||||||
|
|
||||||
Takes `year`, `month`, and `day` as arguments and plays the top-rated soundboard on [archive.org](https://archive.org/details/GratefulDead). Providing no unnamed parameters searches the entire vault.
|
Takes `year`, `month`, and `day` as arguments and plays the top-rated soundboard on [archive.org](https://archive.org/details/GratefulDead). Providing no unnamed parameters searches the entire vault.
|
||||||
|
|
||||||
**NOTE**: *The date parsing is still pretty primitive so don't be an edge case: use 4-digit years and 2-digit months/days.*
|
**NOTE**: *The date parsing is still pretty primitive so don't be an edge case: use 4-digit years and 2-digit months/days.*
|
||||||
|
|
||||||
|
### GUI or terminal
|
||||||
|
|
||||||
|
By default `gdead` will open your show with `nvlc`, which uses an ncurses-based terminal interface. To open the show as a playlist in vlc's GUI, use the `-g` flag.
|
||||||
|
|
||||||
### Audience recordings
|
### Audience recordings
|
||||||
|
|
||||||
By default, `gdead` only returns soundboards and matrices. To use audience-recordings too, use the `-a` flag
|
By default, `gdead` only returns soundboards and matrices. To use audience-recordings too, use the `-a` flag
|
||||||
|
|
20
gdead
20
gdead
|
@ -19,7 +19,6 @@
|
||||||
|
|
||||||
# Vars
|
# Vars
|
||||||
UA="gdead/curl/bash;https://gitea.gf4.pw/ki9/gdead"
|
UA="gdead/curl/bash;https://gitea.gf4.pw/ki9/gdead"
|
||||||
START="$(date +%s)" # unix timestamp
|
|
||||||
|
|
||||||
# Parse params
|
# Parse params
|
||||||
SHOW_DATE=""
|
SHOW_DATE=""
|
||||||
|
@ -31,6 +30,8 @@ while (( "$#" )); do
|
||||||
SBD=""; shift;;
|
SBD=""; shift;;
|
||||||
-r|--rand|--random)
|
-r|--rand|--random)
|
||||||
SORT="sort%5B%5D=random+asc"; shift;;
|
SORT="sort%5B%5D=random+asc"; shift;;
|
||||||
|
-g|--gui)
|
||||||
|
GUI='true'; shift;;
|
||||||
*)
|
*)
|
||||||
SHOW_DATE="$SHOW_DATE $1"; shift;;
|
SHOW_DATE="$SHOW_DATE $1"; shift;;
|
||||||
esac
|
esac
|
||||||
|
@ -66,11 +67,6 @@ URL="https://archive.org/advancedsearch.php?q=collection%3A%28GratefulDead%29$SB
|
||||||
&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"
|
||||||
|
|
||||||
# Prepare pipe
|
|
||||||
PIPE="/tmp/$START.gdead.fifo"
|
|
||||||
rm "$PIPE" 2>/dev/null
|
|
||||||
mkfifo "$PIPE"
|
|
||||||
|
|
||||||
# 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
|
||||||
|
@ -78,9 +74,6 @@ if [ "$res" == "" ]; then
|
||||||
exit 4
|
exit 4
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Remove pipe
|
|
||||||
rm $PIPE 2>/dev/null
|
|
||||||
|
|
||||||
if [ "$res" == "null" ]; then
|
if [ "$res" == "null" ]; then
|
||||||
echo "No shows found."
|
echo "No shows found."
|
||||||
exit 5
|
exit 5
|
||||||
|
@ -88,7 +81,8 @@ fi
|
||||||
|
|
||||||
# Stream it...
|
# Stream it...
|
||||||
stream="https://archive.org/download/$res/${res}_vbr.m3u"
|
stream="https://archive.org/download/$res/${res}_vbr.m3u"
|
||||||
# ...with VLC in the system tray
|
if [ "${GUI}" == "true" ]; then
|
||||||
#vlc --http-user-agent "$UA" --qt-system-tray --qt-start-minimized "$stream"
|
vlc --http-user-agent "$UA" --qt-system-tray "$stream"
|
||||||
# ...with ncurses VLC
|
else
|
||||||
nvlc --play-and-exit --http-user-agent "$UA" "$stream"
|
nvlc --play-and-exit --http-user-agent "$UA" "$stream"
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in New Issue