localcast v0.13 http://noserose.net/e/localcast/ Copyright 2009, Ed Cashin Licensed under the GPL. See COPYING for details. This software depends on Mac OS X personal web sharing being active. You can activate it under "sharing" in the system preferences. The localcast system is loosely based on bashpodder, with ideas from "Re-Add Selected Tracks as Podcast" for iTunes written by Doug Adams. http://www.lincgeek.org/bashpodder/ http://dougscripts.com/itunes/scripts/ss.php?sp=readdaspodcast Why localcast? ------------- The motivation is that when I get ready for my commute, I download french podcasts that have aired while I slept, but if iTunes has any trouble, by the time I'm ready to sync my iPod, it's too late---Re-starting the download begins from byte zero. The wget tool is much smarter than iTunes in this respect. The problem is that iTunes can't use an external download program directly. The localcast system creates a local "child podcast" based on the remote "parent podcast," modifying the XML file describing the podcast so that all of the audio files appear locally, and when iTunes subscribes to this "localized" child podcast, it downloads the audio files from the self-same machine where iTunes is running. These audio files were downloaded previously using the more powerful wget tool. Using bashpodder all by itself didn't give me a way to integrate with iTunes. The "add podcasts to iTunes" mod to bashpodder looks like it might work with an older version of iTunes than the one I use. Even after modifying the applescript to complete, the added episodes did not appear as podcasts. Installing localcast ------- Extract localcast wherever you like, and place the edited localcast-podcasts file in the directory where you want the localized podcast to appear. It will be a directory accessible to iTunes via web sharing, under your ~/Sites directory. For example, you might put the podcast, "Le Sept Dix" in ~/Sites/localcast/le-7-10. You copy the localcast- podcasts file to that directory and edit its contents as needed. After that you can run "./update ~/Sites/localcast/le-7-10" to start downloading content. Quick Start ---------------- There is a script you can run to create an example configuration, consisting of a few french podcasts. Run ./create-example in the directory where you extracted localcast to create directories and "localcast-podcast" files under ~/Sites. Then you can run ./udpate-all to update the podcasts. The podcasts will show up in iTunes when downloading is complete. Using localcast ------------ The ~/Sites directory is the root of the personal web sharing and corresponds to a URL like, http://127.0.0.1/~ecashin ... where "ecashin" is the username. Your username is printed when you run, echo $LOGNAME ... at a shell prompt. You can have one or more localcast-podcasts files in the directories under ~/Sites, and each file can have one or more podcasts feeds listed, one per line, in the file. The part of the path, after ~/Sites, to the directory where the localcast-podcasts file resides gets appended to: http://127.0.0.1/~$LOGNAME/ ... to form the URL from which iTunes will get the localized podcast XML file and the audio files, but you don't need to worry about that, because localcast now tells iTunes to subscribe to the localized podcast automatically. It also tells iTunes to download the new episodes (via local web sharing). If you extracted localcast-0.6 into your home directory, and you have a localcast-podcasts file in ~/Sites/le-5-7, you can run, ~/localcast-0.6/update ~/Sites/le-5-7 ... to refresh the podcast, download any new content from the remote site using wget, and after successful download is complete, have iTunes incorporate the new episodes into its podcast playlist. The update script uses replace.py and the XML file downloaded from the web to generate a new, localized XML podcast feed file. It also downloads any new audio. It will resume previous downloads that were interrupted on a prior run. It uses osascript to tell iTunes to get the new content. If you are not using iTunes, you can disable the applescript with the "-I" option to the update script. There is an untested feature whereby any episode that has a local zero-byte file matching its name will be skipped. The idea is that if the feed contains many old episodes, you could save disk space by truncating older audio files. To download serially, you would have more than one line in "podcasts". To download in parallel, you would have separate localcast directories. If each podcast has its own localcast directory, you could update all your podcasts at the same time. The new "update-all" script can run update on every directory under ~/Sites where a localcast-podcasts file appears. This script provides a convenient way to update all your podcasts at once. Please note that at this time, interrupting update-all with control-C will not stop the downloads it caused. For now, just run "killall wget" afterwards if you must interrupt update-all. Without iTunes ------------- While localcast was designed for and tested with iTunes, there is no reason why it can't be a nice alternative to bashpodder, except for the embedded applescript that talks to iTunes. To disable this applescript, use the "-I" option to the update or update-all commands. Without Mac OS X ----------- Similarly, you don't need to use Mac web sharing to use localcast. You can listen to the mp3 files under ~/Sites, or you can run a lightweight web server like mini_httpd to make the localized podcasts available. Mailing list --------------- There is a low-traffic mailing list, localcast@googlegroups.com ... where localcast users can read announcements, ask questions, and share experiences. Please let me know how localcast works for you.