Youtube-Viewer

Hey all,

As you saw in my previous post / video, I was running Youtube videos in fullscreen on my little display.  I was using an application (really just a 2000+ line perl script) that does this for me.  The program is called youtube-viewer (github)

Gcala posted a nice guide on how to set it up and has given me permission to also repost it here.  I’m making some modifications as I had to do a couple changes, but it works.

  1. sudo apt-get install gcc-4.7
  2. export CC=gcc-4.7
  3. export CXX=g++-4.7
  4. sudo apt-get install libwww-perl
  5. sudo cpan -i XML::Fast
  6. sudo wget https://github.com/downloads/ssilverm/youtube-viewer/youtube-viewer -O /usr/bin/youtube-viewer
  7. sudo chmod +x /usr/bin/youtube-viewer

Now just type youtube-viewer on the command line and you are good to go 🙂

List of Commands
all               : play all the results in order
next              : go to the next page (same as <ENTER>)
back              : return to the previous page
login             : will prompt you for login
logout            : will delete the authentication key
[integer]         : play the corresponding video
i, info [i]       : show more informations about one video
c, comments [i]   : show video comments (e.g.: c 19)
r, related [i]    : show related videos (e.g.: r 6)
v, videos [i]     : show author's latest videos
p, playlists [i]  : show author's latest playlists
subscribe [i]     : subscribe to author's channel
like, dislike [i] : like or dislike a video
fav, favorite [i] : favorite a video (e.g.: fav 3)
[keywords]        : search for youtube videos
3-8, 3..8         : same as 3 4 5 6 7 8
8 2 12 4 6 5 1    : play the videos in your order
-argv -argv2=v    : set some arguments (e.g.: -u=google)
e, edit-config    : edit and apply the configuration
load-config       : (re)load the configuration file
/my?[regex]*$/    : play videos matched by a regex (/i)
reset, reload     : restart the application
q, quit, exit     : close the application

Let me know if you have any issues or questions!

-Shea

10 thoughts on “Youtube-Viewer

  1. I’ve some problems. Everything works, but I can’t force audio hdmi output and I have only composite-analog audio all the time.
    I’ve already set this settings on /boot/config.txt:
    hdmi_group=1
    hdmi_mode=31
    hdmi_drive=2
    hdmi_force_edid_audio=1
    and hdmi audio is already working on other apps such as Quake3.
    What can I do?

    • I’m getting this same issue. I only just switched to HDMI. I’ve been using composite out since I got it, and sound works great through the headphone jack.

      I’ll look into it.

    • I’m sorry, I replied to the wrong post 😉

      About youtube, I fixed it passing -o hdmi to omxplayer with a little script, as explained in the Gcala post you linked 😉
      Now it works fine 🙂

  2. Hey. Thanks for the tutorial. I followed everything (appears to be successful) however after I run youtube-viewer, locate and choose the video I want, it seems to get the video but never launches the player. It just dumps back to the search results. Thoughts? Thanks!

  3. Same as Brian. I had youtube-viewer working perfectly, but then one day it just stopped. It loads great, does a search. When I type a number in for the video I want to play it sends it to omxplayer which just gives ‘have a nice day :)’ and then the search is relisted (as if the video has successfully played).

    I’ve done the basics. Tried reinstalling everything, and got all my updates, but nothing. Even configured yt-player but that seems to fail at the same point.

    If anyone has any ideas, I’d really appreciate it. My wife and I have been using youtube player as practically our only source of entertainment on the telly.
    Thanks

      • It’s really strange. I just got a new SD card and installed the latest version of Raspbian on it, and ran all the updates and then followed the instructions you provided, and I still have the same problem. I wonder if this is anything to do with where I am situated? I’m in Australia btw…

      • I have the same problem, youtube-viewer will display the video information and then omxplayer prints “Have a nice day” and then the search results are displayed again.

  4. Hi Ssilver2k2, can you confirm that the youtube player still works for you. Sorry to be a pain. I’m really struggling to get to the bottom of it.

Leave a Reply to Jack Cancel reply

Your email address will not be published. Required fields are marked *