youtube-mp3: add ability to use a different yt-dl executable

Useful for using e.g. yt-dlp
This commit is contained in:
joachimschmidt557 2022-07-24 18:43:26 +02:00
parent a49711b6b8
commit ce17ee4c49
No known key found for this signature in database
GPG key ID: E0B575BE2884ACC5

View file

@ -1,4 +1,8 @@
#!/bin/sh
#!/usr/bin/env sh
if [ -z "$YOUTUBE_DL" ] ; then
YOUTUBE_DL=youtube-dl
fi
usage() {
cat <<EOF
@ -12,7 +16,7 @@ EOF
}
# Check for youtube-dl in path
if ! (command -v youtube-dl) ; then
if ! (command -v "$YOUTUBE_DL") ; then
echo "No youtube-dl found in path"
exit 1
fi
@ -29,6 +33,6 @@ case "$@" in
exit 1
;;
*)
youtube-dl --format bestaudio -x --audio-format mp3 --audio-quality 192K -k "$@"
"$YOUTUBE_DL" --format bestaudio -x --audio-format mp3 --audio-quality 192K -k "$@"
;;
esac