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
master
Jonathan Hodgson 4 years ago
parent 318c959d57
commit ffcb63d5a5
  1. 10
      bin/.bin/dmenu/open-youtube

@ -13,7 +13,13 @@ if [ -z "$url" ]; then
url=$($DMENU 'URL')
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