DISCOVER
X

Raspberry Pi: Playing YouTube Videos with Luakit and OMXPlayer

April 28, 2013 3:23 pm Leave your thoughts
Facebooktwittergoogle_plusredditpinterestlinkedinmailFacebooktwittergoogle_plusredditpinterestlinkedinmail

One of the shortcomings of the Raspberry Pi is its inability to play any HTML5 videos let alone flash videos on the browser. I think because nothing in Raspbian is accelerated except OMXPlayer itself. We can however, with a little bit of effort apply some workarounds to be able to  play YouTube videos. So that you can finally watch that video that you really-really want to watch.

The instructions below will be based on Luakit browser. So if you haven’t install it yet, follow my previous instructions on Luakit here.

Download the UserScript to Grab YouTube Videos

As usual start Luakit from the terminal.

Then go to the userscripts website to get the correct userscript. In this case we go to: https://userscripts.org/scripts/show/25105.

This is the YouTube mp4 downloader userscript.

Luakit, download YouTube MP4 User Scripts

 

When the page finished loading, simply click on the source code tab, then click on the previous version link to open the full js script directly.

Get UserScripts source code

 

Then select the install link next to the latest date to view the JS source code in the browser. This is what we want.

Get the latest version of userscript

 

Once the full source code loads. Press esc to return to neutral mode. Then run the UserScripts install command:

Install the userscript with Luakit Userscript install

You can also use the command :userscripts to list the scripts already installed.

After this, quit luakit (:q) and re-start it.

Open YouTube

This is obvious of course, navigate to YouTube and search for a video. By the way if you keep forgetting the commands, you can download a printable shortcut card here.

You’ll see an error where the video is suppose to be but don’t worry we are more interested with the download bar. It should be just below the video area.

Select the download quality

That’s it! Click on the download version and save it to any of your directory.

To see the status of your download you can use the command :downloads

Open the Video from the File Manager

Lastly, let’s open the video from the file manager. So open your file manager and go to the directory where you have downloaded the video.

Right-click on the file and select “Open with…“. You’ll be greeted with the program selection dialog box, click on “Custom Command Line

In the command line area, enter this following command:

Don’t forget to check “Set selected applications as default action for this file type” so that we only need to do this once.

Open file with omxplayer by default

Press okay and you video clip will start playing!

Play PacificRim trailer on RaspberryPi

So there you go, enjoy some YouTube videos :) Have fun!

Facebooktwittergoogle_plusredditpinterestlinkedinmailFacebooktwittergoogle_plusredditpinterestlinkedinmail
Tags: , ,

Categorised in: ,