Posts Tagged ‘python’

Podcasting the unix nerd way or Peapod for the win

Terminal
I cooked dinner for myself today and sat down at the table looking forward to streaming The Daily Show or The Colbert Report on Hulu since there’s no way I’m paying $65 a month for cable TV. As it turns out, there haven’t been any new episodes in awhile, and I like my fake news fresh off the wire, so I decided to catch up on my other fake news addiction; aggregated blog rss feeds.

I came across the TED talk for today, which is Michell Obama. Great speech by the way, check it out at: http://www.ted.com/talks/michelle_obama.html. The streaming video quality left something to be desired, so I looked around and found the HD podcast URL at podcasters.tv.

This works well with iTunes, and MediaLink is able to copy the movie file from my MacBook pro, but for some reason streaming the video usually quits part way through playback with an obscure error code.

I have my OpenSolaris, Intel Atom based file server running on a gigabit network connected up to the Playstation 3 and HDTV using MediaLink, so I decided to look for some unix tool to download the podcast which could easily be run from cron.

After some searching and research into different options, I downloaded Peapod, a wonderful python command line application, and gave it a whirl.

To my complete satisfaction, peapod runs from my home directory without requiring any piece of itself being installed into the system. The only missing dependency I ran into was urlgrabber for python 2.4. Luckily, I have easy_install installed so it was a simple matter of:
pfexec /usr/bin/easy_install-2.4 urlgrabber
Once urlgrabber was installed, setup of the podcast client was a breeze:

jmccune@rain:~$ cd ~/bin
jmccune@rain:~/bin/$ ln -s ../apps/peapod/peapod.py peapod
jmccune@rain:~/bin/$ cd ~
jmccune@rain:~$ peapod
Creating user directory: /home/jmccune/.peapod
Created a default configuration file in :
/home/jmccune/.peapod/peapod.xml
Please edit this file to contain your feeds and options.

I commented out the sample podcast and added TED in HD.
(Note: I found the feed URL by doing a “Get Info”, or clicking on the little i next to the podcast title in the podcast section of iTunes.)
Podcast Get Info Image

For the title I made it “TED Talks (HD)” and for the URL, I used http://feeds.feedburner.com/TedtalksHD.

Finally, running peapod simply works.

jmccune@rain:~$ peapod
...Spawning thread 0 for feed url http://feeds.feedburner.com/TedtalksHD
Fetching feed for TED Talks (HD)
Downloading TED Talks (HD) -- http://video.ted.com/talks/podcast/MichelleObama_2009P_480.mp4
Trackname MichelleObama_2009P_480.mp4
Savename /export/dozer/podcasts/jmccune/TED Talks (HD)/MichelleObama_2009P_480.mp4
Mime-type video/mp4

This will be added to cron to run every day a few hours before I get home from work, and MediaTomb should pickup the new content.

And now to figure out how to manually kick off a MediaTomb scan of the folder once downloading is complete.

Here are some decent feeds I’ve found so far:

peapod --addnew=http://www.hbo.com/podcasts/billmaher/podcast.xml --title="Bill Maher"

Please post more video feed URL’s, especially 720p and higher, in the comments if you have some good video podcasts worth watching on my TV.

 

Python 2.5.2 RedHat Enterprise Linux 5 RPM’s

In order to support the same version of python across all of our servers, I’ve also build Python 2.5.2 RPM’s for RedHat Enterprise Linux 5 (Tikanga).

This build is far more straightforward than the build for RHEL4, as the system X11 libraries link without patching Setup.dist and RHEL5 comes with a supported version of expat so statically linking  the library into the pyexpat module isn’t required.

The SRPM: python25-2.5.2-1.el5.src.rpm

Build command:

rpmbuild –define ‘__python_ver 25′ –define ‘dist .el5′ -ba ~/redhat/SPECS/python.spec

This package will not conflict with the system python package.  Scripts should use #!/usr/bin/env python25 to make sure the proper python is being used.

 

Python 2.5.2 RedHat Enterprise Linux 4 RPM’s

I’ve successfully built Python 2.5.2 RPM’s for RedHat Enterprise Linux 4 (Nahant).  The package is named python25 as not to conflict with the system’s python package.

Other than some minor tweaks to the patch process to account for the location of X11 libraries and db4.2, the only major change is that the pyexpat module is statically linked against libexpat.a since expat version 1.95.8 is required and not available in RHEL4.  If you build my SRPM, you’ll need to download an SRPM for expat-1.95.8 then build and install expat-devel-1.95.8 or greater.  Once present, the python25 SRPM will statically link in the correct version of the library.

The SRPM: python25-2.5.2-1.el4.src.rpm