This one nearly works for downloading:
cd ~/
mkdir -p ~/tmptube
cd ~/tmptube
xdotool key ctrl+l
youtube-dl $(xclip -o)
vlc *.webm || vlc *.*
rm ~/tmptube/*.*
rmdir ~/tmptube
What changed is the -g option that is supposed to simulate and print the URL.
with the -g option, it gets one URL (probably the video source), while xclip
-o gets the URL displayed in the browser. Clearly the first (very long) URL
fails to play in vlc. The other one works.
The two in a row work as well.
But I don't get why the "youtube-dl -g " is needed. Why did you make such a
choice, andermetalsh?
Anyway, it just works when it wants. I noticed that it fails when the URL
isn't highlighted, for some reason.
So I need to find out why it highlights it only once in a while. It doesn't
seem to be a window focus issue.
The last thing I want to try is to make it prefer webm. the format forcing
aside, I see youtube-dl has an option about prefering free formats. I'll try
both.