Monday, March 12, 2012

Podcast Post-production in Python

As I've begun ramping up my podcast production a bit, I've also started running into some error-prone tedium associated with getting all the files and their associated incantations updated and distributed to all the right places. To help matters, I put together some Python code that automates some of the process. By design, the code doesn't push anything live at this point--although it would be fairly straightforward to extend it to do so.

The script:

  1. Gets information such as duration from MP3 file
  2. Creates an XML file for insertion into an iTunes podcast feed
  3. Uploads previously-created MP3 and OGG files to Amazon S3
  4. Creates a draft blog post on Blogger with a label (tag)

Given my workflow, I still need to:

  1. Update master iTunes podcast feed XML file
  2. Upload edited file to S3
  3. Make the newly uploaded XML and MP3/OGG files public
  4. Make Blogger post public

That may sound like a bit of manual work, but these are pretty quick and straightforward steps relative to the actions taken by the script. For example, the script gets the file size of the MP3 file and calculates the duration, which are needed for the iTunes feed.

You'll need to install boto (https://github.com/boto/boto.git) for S3 access and mpeg1audio   (https://github.com/Ciantic/mpeg1audio/) to extract the duration from the MP3 file. You'll also need to setup the appropriate accounts on Blogger and S3 and set a number of global variables before you can use the script.

Download code

Post a Comment