Category Archives: Peapod


Or should that be vague plans?

  • Attend FOSDEM. I’ve been incredibly lazy the last few years and haven’t attended.
  • Try to prevent the PET Centre from eating my life. This is probably more of a vain hope than a resolution.
  • Buy a flat or learn to drive. Because unless I make it an either/or I will do neither.
  • Attend the spring UKUUG meeting. Understanding kerberos is probably a worthwhile endeavour even if I never use it.
  • Skate more. Assuming we actually get a summer this year it shouldn’t be to hard to top the dismal amount of skating I did last year.
  • Attend at least one observing night of the Cardiff Astronomical Society to remember what the night sky is supposed to look like.
  • Migrate Peapod to a sensible modern XML library to fix some of its more annoying bugs
  • Make an effort to visit friends. Which is just code for be less of a social hermit.

Peapod 0.7

A long weekend is always a good time for a new release. So without further ado I give you Peapod 0.7

Notable bug-fixes include improved syncing with ipods and some clean-up of the verbose output so that it makes more sense.

For those of you who don’t know: peapod is a command-line podcast downloader written in python.

Making a Minimalist Bittorrent Client

I spent the weekend sorting out bittorrent support in Peapod so that it
wasn't quite such a mess. Previously I had hacked a version of so that it would exit when the download
completed. I was then shelling out to this from within Peapod.
Obviously this is a less than ideal situation partly because it meant I had to escape URLs from the shell. So I hacked away at until I had a simple class I could call to do the bittorrent download. It gives almost no feedback
except a return code upon completion of the download.

from btclient import mytorrent
url = ""
save_dir  = /tmp
torrent = mytorrent(url,save_dir)
ret =

If you wanted to carry on seeding rather than exiting on completion you could do:

torrent = mytorrent(url,save_dir,selfish=0)

I then added a name == "__main__" section into btclient so that it can be used a simple bittorrent client. /tmp
or to seed: /tmp seed  can be downloaded from here or alternatively see our subversion repository where the latest version can always be found.

Hopefully someone will find this useful.