In my last post, I explained how to use youtube-dl script tool.
My goal was to use MPlayer to watch Youtube videos on top of all opened windows.
So, I found some sites on Google that explains how to do it. And you can use with youtube-dl script.
First of all, make sure you have MPlayer installed. Check this post of how install MPlayer.
Then, go to Terminal and type:
$ mplayer -ontop -cookies -cookies-file ./cookie.txt $(youtube-dl -gf 34 --cookies ./cookie.txt "https://www.youtube.com/watch?v=<VIDEO ID>")
Now, explaining mplayer. It's a powerful video player program. You can play, rip, convert,... Its arguments could be found here.
Then, youtube-dl. You can find in my last post, or google-it. For its parameters, you can find the explanation here. Basically, "-gf 34" means "using the URL, starts streaming H264 video in container at 360p".
Just take care about Youtube Video ID and Cookies file path. Both are very important to play the video.
Sometimes, Youtube changes any part of its code and youtube-dl could not be working. It's recommended to update it by using "youtube-dl --update"
If you do everything correct, you can work and watch some Youtube like me: