Hi,

I was looking for a good way to view youtube videos on my atom based netbook without flash (for obvious reasons...) and I actually used brad212's script for a while but it annoyed me that I still had to use flash to download the videos (for some reason flash can quite cpu intensive even when it's not actually playing a video). Therefore I wrote a small script which uses ngrep to search for youtube urls in my network traffic and youtube-dl to get the video urls for mplayer to playback. I've just been using it for a couple of hours but it actually seems to work surprisingly well So feel free to test it an report back if you find any bugs etc.

PKGBUILD: http://aur.archlinux.org/packages.php?ID=40172

Config:

- change INTERFACE in /usr/bin/ytmpd if you're not using eth0 (eg wlan0 if you're using wifi)

- by default, ytmp automatically downloads the best quality version of the video but with a max resolution of 480p. If you want to download the best version available (=HD), then simply remove (--max-quality=35 from /usr/bin/ytmpc in line 17). You can also customize the max-quality variable to your own liking (see here for available formats on youtube).

Usage:

- start the ngrep wrapper as root: /etc/rc.d/ytmpd start

- start the 'client' script as user: /usr/bin/ytmpc

- open any youtube video (url) in your browser

If you have zenity installed, it will display a small dialog when it detects a youtube url asking you if you want to view it with mplayer. If not, it will just start mplayer without confirmation. There will be a small delay before the video starts because youtube-dl needs a couple of seconds to detect the url and mplayer is caching 2mb of video data before starting playback.

Have fun

Last edited by honki (2010-08-23 19:17:08)