Podcatcher

From WebOS Internals

Revision as of 23:55, 21 July 2009 by Hopspitfire (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

A couple of scripts for podcatching, podcast management, and playlist creation

Motivation

I wanted an on-device method for downloading podcast episodes and generating playlists, and didn't want to have to rely on iTunes.

Scripts

I put all these scripts in /var/home/scripts, do with them as you please.

bashpodder.shell

First, I took [*http://lincgeek.org/bashpodder bashpodder] and modified it a bit. This isn't really related to webOS, but is more just general Linux scripting.

Download from gitorious

bp.conf

This is the config file that bashpodder uses. The bashpodder above allows a MAX parameter after the name of each feed to limit the number of episodes you get.

Example bp.conf

Download from gitorious

generatePlaylist.sh

The last line of bashpodder originally generated a .m3u playlist, but I wanted to move this out to a separate process (so I could remove episodes and regenerate the playlist).

As soon as luna sees the .m3u being created in /media/internal, it adds it to the com_palm_media_playlist table, but it doesn't parse it to fill out the playlist, so you never see your episodes. That's what generatePlaylist.sh fixes.

Again, if you want, you can remove episodes and rerun this script to regenerate the playlist with the updated list of episodes.

Download from gitorious

podcatcher.sh

Finally, you'll probably want all of this to be run from cron every few hours or so (preferably when you're on WiFi).

If you have not setup cron yet, refer to tracking.

Download from gitorious

And an associated cronjob:

0 */6 * * * /var/home/scripts/podcatcher.sh 2>&1 >> /var/home/scripts/podcatcher.log

Whenever the cronjob runs, the MAX most recent episodes of your podcasts will be downloaded (if they haven't been downloaded already), and the playlist will be updated.

Troubleshooting

If a download fails, you can force a re-download by removing the source address from podcast.log. (The re-downloaded podcast will not be in the correct order in the playlist.)

You can check podcatcher.log to see if any error messages are being thrown.

Make sure your executable scripts are chmod u+x:

chmod u+x bashpodder.shell
chmod u+x generatePlaylist.sh
chmod u+x podcatcher.sh

Caveats

  • If this deletes all your files, I'm sorry.
  • If you go over your 5gb cap, I'm sorry.
  • I have no idea what happens if you're using the media player when this script runs.
    • Actually, what seems to happen is it kicks you out of your playlist. That's... unfortunate, but acceptable.
  • I haven't tested to see what happens on address not found messages during wgets.

Use at your own risk.

Also, if future updates of WebOS properly handle .m3u files, then these scripts should be updated.

Personal tools
Google AdSense