rss2email with podcast support

The other day I got really tired of bashpodder.shell. While it is a great and simple solution, it has quite a few limitations, namely podcasts were completely separate from my regular feeds.

I like automation, I particularly like automation that I can ignore. I have been using rss2email for a while. I even hacked it to post directly to one of my imap accounts instead of bothering to go through smtp. This has worked out exceptionally well.

My latest hack on rss2email is for it to recognize enclosures (the part of rss that makes it a ‘podcast’). Its quite simple right now. You specify the directory to download to, it makes a subdir based on the feed title, and uses a configured command to download it. Like I said, quick and dirty.

An example config.py

USE_IMAP=1
IMAP_USER=”username”
IMAP_HOST=”imap.example.com”
IMAP_PWD=”password”
IMAP_ROOT=”INBOX.feeds”
IMAP_DIRS=1
USE_PODCAST=1
PODCAST_DIR=”/home/user/podcasts”
PODCAST_DFLT_ARG=”-O %f %u”
PODCAST_DFLT_CMD=”wget”
PODCAST_DFLT_WAIT=False
#tuple is:
PODCAST_TYPES={‘application/x-bittorrent’: {‘default’:True,
‘m3u’:False,
‘m3uregex’: (“.torrent”,”"),
‘cmd’:”ctorrent”,
‘args’:” %u”,
‘wait’:True}}

The %f is replaced with the filetype part of the url. The %u is replaced with the url from the enclosure. The args are regex’d and then spawnpve is called. The WAIT variable will determine whether spawn will block or not.

An m3u file is generated at PODCAST_DIR/year-month-day.m3u .

One thing I would eventually like to do is make the config a bit more reasonable. Mainly the PODCAST_TYPES is hairy and not really functional. The m3u file is hardcoded, which should not be.

UPDATE:
Oh yeah… how about a link to the hacked rss2email? You can find it at http://blogs.openaether.org/data/rss2email.py

Comments (2)

  1. john wrote::

    I would like to be able to use this for .pdf’s, .epub’s, .mp3′s, .m4b’s, .m4a’s, and .zip’s …
    If only I could make sense out of PODCAST_TYPES …
    What’s the status on this? Is there a newer version available?

    Tuesday, July 5, 2011 at 8:42 pm #
  2. Justin Kirby wrote::

    The status is that I completely forgot about this until you reminded me of it. I no longer use this, instead I have settled on http://home.gna.org/feed2imap/. I listen to podcasts on my n900 and use gPodder for that. Since I never listen to them anywhere else I haven’t bothered trying to keep this up to date.

    Tuesday, November 8, 2011 at 11:03 am #