How to use curl + youtube-dl + mplayer to stream youtube video


Some months ago, I could not play Youtube videos as I explained in my old post (How to use youtube-dl + mplayer to stream youtube video).

I was searching on the Internet why I could not watch any video... Yes! It's very said! Since any browser consumes extra resources even I am just watching a single video in a simple tab!!!!!! :'(

So, I found out that MPlayer cannot play videos using HTTPS protocol. All Youtube URLs are using HTTPS. That's why this error is shown:

$ mplayer -cookies -cookies-file /tmp/ytcookie.txt $(youtube-dl -g --cookies=/tmp/ytcookie.txt "")
Warning unknown option ass-font-color at line 4
MPlayer 1.1-4.2.1 (C) 2000-2012 MPlayer Team

No stream found to handle url

Exiting... (End of file)

Thanks to this post that I found:

They gave a good way to play. Now you need an additional application called CURL installed in your operating system.

So, type the following command on Terminal:

$ curl --ciphers RC4-SHA "$(youtube-dl -g<VIDEO ID>)" | mplayer -

And be happy! Until Google or anyone else block us again... :'(

See you!


  1. It works but some way to have a direct link from the browser to the video, should be good.

  2. Is there a way to hear only the sound and not show the video? It works great on my notebook, but it doesn't works great on my Raspberry Pi. I need only the sound and not the video. Please help, Thanks.
    Sorry for my bad english :D
    email to:

  3. Have you tried the following parameter for mplayer?

    $ mplayer -vo null something.mpg


    $ mplayer -novideo something.mpg



Post a Comment