From 4fa1cc7fde83855b5bda3c070d4f01ab120cac27 Mon Sep 17 00:00:00 2001 From: emma Date: Tue, 21 Nov 2023 22:43:59 -0700 Subject: [PATCH] removed mpv dependency --- yt | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/yt b/yt index fa3a9c9..297a272 100755 --- a/yt +++ b/yt @@ -167,18 +167,30 @@ pick() { # Pick a video to play from a playlist of videos test -z "$chosen" \ || printf "%s: %s: Playing stream.\n" "$argv0" "$chosen" 1>&2 \ - && mpv "$chosen" + && play "$chosen" fi } play() { # play a video after caching its title + if test -z "$PLAYER"; then + printf "%s: Please set \$PLAYER to your preferred video player." \ + "$argv0" 1>&2 + exit 78 # sysexits.h(3) EX_CONFIG + fi + cache "$@" - mpv "$@" + "$PLAYER" "$@" } queue() { + if test -z "$PLAYER"; then + printf "%s: Please set \$PLAYER to your preferred video player." \ + "$argv0" 1>&2 + exit 78 # sysexits.h(3) EX_CONFIG + fi + while test -f "$YT_PL_DIR/$1.m3u"; do - mpv "$YT_PL_DIR/$1.m3u" + "$PLAYER" "$YT_PL_DIR/$1.m3u" shift done } @@ -268,7 +280,6 @@ verify() { # replaces videos with archived versions if they are not available for dep in \ curl \ jq \ - mpv \ yt-dlp do if ! command -v "$dep" >/dev/null