Getcast - podcast repository manager
dlbeer@gmail.com
24 Jan 2012
This script is a simple tool for managing podcast subscriptions. It doesn’t use any global configuration or database. Instead, each subscribed podcast is kept in its own directory, which contains the downloaded media files. This is referred to as a podcast repository.
Each repository also contains a .getcast/
subdirectory, which may contain:
- a configuration file, called “config”
- a copy of the latest RSS feed, called “rss.xml”
- a list of blocked episodes, called “done.list”
The config file contains a series of “
rss: The URL of the podcast’s RSS feed (required). rss-poll: The maximum age, in seconds, of a previously downloaded RSS feed before it is considered obsolete (optional). The default value is 7200 (2 hours).
You shouldn’t need to edit the config file by hand though. To create a new podcast subscription, just do:
getcast init /home/me/My_Podcast http://www.example.com/rss-feed.rss
This will create the directory “My_Podcast” with the necessary metadata directory and configuration. Then, every time you want to fetch the latest media files, do this:
getcast fetch /home/me/My_Podcast
That’s all there is to it – the latest RSS will be downloaded, along with any new media files. If you want to mark the podcast repository as being up-to-date without actually fetching any media files, use the --catch-up
option:
getcast fetch --catch-up /home/me/My_Podcast
There’s also a simple channel guide, which uses ID3 tags to show you descriptions of the latest media files:
getcast guide /home/me/My_Podcast | less -r
Note that all commands, with the exception of “init”, allow multiple podcast repositories to be specified on the command-line. So, if you keep all your podcast repositories together in one large directory, you can easily update them all at once:
getcast fetch /home/me/podcasts/*
Download and installation
Fetch the script here:
The following are also prerequisites:
- Python 2.4 or higher
- curl
- mutagen (Python library from ID3 tag reading)
Install it in /usr/local/bin
, or any other location in your PATH
, as getcast
:
cp getcast-20120122.py /usr/local/bin/getcast
chmod 755 /usr/local/bin/getcast
If you keep a group of podcast repositories in a single directory (for example /usr/local/podcasts
) you may find it useful to add a few alias definitions to your .bashrc
:
alias podfetch='getcast fetch /usr/local/podcasts/*'
alias podguide='getcast guide /usr/local/podcasts/* | less -ir'
License
Copyright (C) 2012 Daniel Beer <dlbeer@gmail.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.