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
btdownloadheadless.py 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 btdownloadheadless.py 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 = "http://www.evilgeniuschronicles.org/audio/egc-2005-10-10.mp3.torrent"
save_dir  = /tmp
torrent = mytorrent(url,save_dir)
ret = torrent.run()
sys.exit(ret)

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

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

I then added a name == "__main__" section into btclient so that it can be used a simple bittorrent client.
btclient.py http://www.evilgeniuschronicles.org/audio/egc-2005-10-10.mp3.torrent /tmp
or to seed:
btclient.py http://www.evilgeniuschronicles.org/audio/egc-2005-10-10.mp3.torrent /tmp seed

btclient.py  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.

A Pythonic Podcatcher

A friend and I have been hacking on a replacement for bashpodder. It's
taken a while but it's now very usable. Any thoughts greatly
appreciated.

I present Peapod

(more…)