Ok, so I put your script in a youtube-dl.sh file, chmoded it to 700 (and
checked), though I replaced totem with vlc.
Then I created the lauchy.xml according to the link I've posted above. For
"type", I've put 1 for browser, though I don't understand it fully yet.
I restarted my browser, and the link appears properly.
I went on a youtube page, then I tried it.
But nothing happens. And tmptube I created is empty, so I'm sure of it.
But I don't know whether the script or my launchy config is faulty. I should
try to create an "open with gedit" entry and try.