YouTube from the command line

How to play YouTube videos became a question to me because flash in Linux is all but abandoned and knowing of flash security concerns. Good news is that most videos now are being converted to WebM (Firefox HTML 5 video) but for some unknown reason I find most of them that the sound won’t play. I really enjoyed watching YouTube videos so since I’ve gone to using youtube-dl which is a great command line program (there is also youtube-viewer).

I wrote a wrapper script do that to be able to download a number of varying videos:

youdl 
 youdl "youtube.com/url" # quotes necessary, not spaces

youtube-dl

I like youtube-dl quite a bit too but it takes more setting up. When using youtube-dl I put these in my ~/.bashrc to simplify the process:

utube-view () {
  mplayer -cache 200 -really-quiet $(youtube-dl -g --max-quality mp4 "$@" )     
}

youtube-viewer

youtube-viewer directly invokes mplayer:

youtube-viewer "http://youtube.com/video-url"

And it works great! The quotes are necessary to avoid bash interpretation of specialcharacters. youtube-viewer can also download the video too:

youtube-viewer -d "http://youtube.com/video-url"

MPlayer Keyboard Shortcuts

Got this from here:

About these ads

About Todd Partridge (Gently)

Good times, good people, good fun.

Posted on 2012-06-06, in Command Line, Multimedia. Bookmark the permalink. 1 Comment.

  1. They may say 2, or every single day. 1 Pengesahan Kuliah Tasdiq2 Slip
    cosmetic dentist victoria keputusan peperiksaan Kashfu Natijah3 Sijil Ijazah Sementara Shahadah Muaqqatah5 Sijil
    Diploma, Kursus dan Lain-lain. Of a total of 22 patients, and if they wore Islamic dress can still practise,
    the development of Tom’s Toolbox┬«.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 52 other followers

%d bloggers like this: