Linux, plaintext & minimalism
October 20, 2018

Automatically setting the relevant title for YouTube videos in mpv

I was annoyed with the static title “mpv” when I watch YouTube videos via mpv, so I made this little script that automatically sets the relevant title in mpv for me.


title=$(curl -Ss $1 | grep -oE "<title>.*</title>" | sed 's/<title>/img/;s/- YouTube<\/title>/img/')
mpv $1 --ytdl --title "mpv -- $title"

I named it p.sh and you call it with p.sh <url>.

Tags: mpv | YouTube


I don't have a commenting system simply because I haven't found a solution that I like. If you want to leave any feedback and/or have any questions feel free to contact me either via e-mail, the fediverse, by XMPP or by IRC (I'm Hund at freenode.net).