Adds the ability to use multiple sources for opening youtube

An entry called best of both will now be in the list that will stream
the best audio and the best video

There is also now the ability to select a video only and an audio only
track and they will be combined
Jonathan Hodgson 5 years ago
parent 6f325dc8d4
commit 55ddbf26bc
  1. 10
      bin/.bin/dmenu/open-youtube

@ -13,7 +13,13 @@ if [ -z "$url" ]; then
url=$($DMENU 'URL') url=$($DMENU 'URL')
fi fi
code=$(youtube-dl "$url" -F | sed -n '/format code/,$ p' | tail -n +2 | $DMENU Quality | awk '{print $1}') code=$( ( youtube-dl "$url" -F; echo "bb Best of both") | sed -n '/format code/,$ p' | tail -n +2 | $DMENU "Quality " -m | awk '{print $1}')
mpv "$url" --ytdl-format="$code" code="$(echo "$code" | tr '\n' '+' | sed 's/+$//')"
notify-send "$code"
case "$code" in
"bb") mpv "$url" --ytdl-format="bestvideo+bestaudio" ;;
*) mpv "$url" --ytdl-format="$code"
esac

Loading…
Cancel
Save