[download]

local/bin/abook

   1 #!/bin/bash
   2 
   3 [[ $1 != https://* ]] && exec mpv --profile=audio "$@"
   4 f=$(youtube-dl -xo ~/Books/'%(title)s.%(ext)s' --get-filename "$1") || exit
   5 
   6 (
   7     [[ -f $f ]] || sleep 10
   8     mpv --profile=audio --no-terminal "$f"
   9 ) &
  10 
  11 exec youtube-dl -ixo "$f" --add-metadata --no-part --console-title "$1"