added configurable picker
This commit is contained in:
parent
b1d3c252b8
commit
c4918d16da
8
yt
8
yt
@ -103,7 +103,7 @@ pick() { # Pick a video to play from a list of videos
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
chosen="$(printf '%s\n' "$list" | fzf | sed -e 's/.*\[//g' -e 's/\]//g')"
|
chosen="$(printf '%s\n' "$list" | $YTPICK | sed -e 's/.*\[//g' -e 's/\]//g')"
|
||||||
test -n "$chosen" && mpv "$chosen"
|
test -n "$chosen" && mpv "$chosen"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -172,13 +172,17 @@ cachefile="$XDG_CACHE_HOME/yt.cache"
|
|||||||
FMT='%(title)s – %(channel)s (%(duration>%H:%M:%S)s) [%(webpage_url)s]'
|
FMT='%(title)s – %(channel)s (%(duration>%H:%M:%S)s) [%(webpage_url)s]'
|
||||||
WBAPI='https://archive.org/wayback/available?url='
|
WBAPI='https://archive.org/wayback/available?url='
|
||||||
|
|
||||||
|
if test -z "$YTPICK"; then
|
||||||
|
printf "%s: \$YTPICK unset." 1>&2
|
||||||
|
exit 78 # sysexits.h(3) EX_CONFIG
|
||||||
|
fi
|
||||||
|
|
||||||
if test -n "$DEBUG"; then
|
if test -n "$DEBUG"; then
|
||||||
set -x
|
set -x
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for dep in \
|
for dep in \
|
||||||
curl \
|
curl \
|
||||||
fzf \
|
|
||||||
jq \
|
jq \
|
||||||
mpv \
|
mpv \
|
||||||
yt-dlp
|
yt-dlp
|
||||||
|
Loading…
Reference in New Issue
Block a user