echo https://youtu.be/ > tmp1.txt
youtube-dl --get-id "ytsearch:$1" >> tmp1.txt
youtube-dl --get-title "ytsearch:$1" >> tmp1.txt
cat tmp1.txt |tr '\n' ' '|sed 's/ //' > tmp2.txt
cat tmp2.txt
mpv --vid=no "$(youtube-dl -g "ytsearch:$1" | tail -1)" < /dev/tty
rm tmp*.txt
Exemplo de código 2 Siga estas instruções: link
a=$(youtube-dl --get-id "ytsearch:$1")
b=$(youtube-dl --get-title "ytsearch:$1")
c="https://youtu.be/$a $b"
echo $c
t update "$c"
mpv --vid=no "$(youtube-dl -g "ytsearch:$1" | tail -1)" < /dev/tty