Castget RSS Downloader

Castget is a simple, command-line based RSS enclosure downloader. It is primarily intended for automatic, unattended downloading of podcasts.
http://www.nongnu.org/castget/

This tutorial requires that you have Optware installed.

After you have installed Optware

  1. Log into your router with the web interface. Usaly http://192.168.1.1
  2. Then goto "Tools -> System"
  3. In the Command box put "ipkg update". This will update the package list so you download the latest version.
  4. Click [Execute]
  5. In the same Command box put "ipkg install castget". This will install Castget.
  6. Click [Execute]
  7. Then go to “Administration -> Scheduler” and add the code listed bellow to the "Command" field of Custom 1,2, or 3 just use one that's available. I recommend setting the time this runs to every 12 or 24 hours.

For the latest version of this script click here.

Command

# Castget Config Writer 2010/10/29 v2 By: Austin Saint Aubin
FlashDrvDIR=$(nvram get usb_disk_main)
ComDIR="Podcasts"
# ===============
PodsDIR="$FlashDrvDIR/$ComDIR"
logger -t Castget "Writing Castget Config File"

echo '
# -- Start of File --
# Global Settings
[*]
# This will set the ID3 tag "content type" to "Podcast" and use the directory /home/root/Podcasts for downloading enclosures.
id3contenttype=Podcast
spool='$PodsDIR'

[hack5]
url=http://revision3.com/hak5/feed/MP4-Small
spool='$PodsDIR'/Hack5
playlist='$PodsDIR'/Hack5/Hack5.m3u

[scamschool]
url=http://revision3.com/scamschool/feed/MP4-Small
spool='$PodsDIR'/ScamSchool
playlist='$PodsDIR'/ScamSchool/ScamSchool.m3u

[tekzilla]
url=http://revision3.com/tekzilla/feed/MP4-Small
spool='$PodsDIR'/TekZilla
playlist='$PodsDIR'/TekZilla/TekZilla.m3u

[tomstop5]
url=http://revision3.com/tomstop5/feed/MP4-Small
spool='$PodsDIR'/TomsTop5
playlist='$PodsDIR'/TomsTop5/TomsTop5.m3u

[radiolab]
url=http://feeds.wnyc.org/radiolab
spool='$PodsDIR'/RadioLab
playlist='$PodsDIR'/RadioLab/RadioLab.m3u
id3leadartist=WNYC'"'"'s Radio Lab
# -- End of File --
' > /tmp/home/root/.castgetrc

# Loading Functions for Castget Loader
logIt() { echo "$@"; logger -t Castget "$@"; }
checkFolder() { [ -d "$1" ] && logIt Exsits || logIt Making && mkdir -p "$1"; }

# Run Castget RSS Downloader & Check Dir's
if [ "$(ls -A /opt)" ]; then
    logIt "Checking Castget Podcast Folders"
    for FOLDER in $(cat /tmp/home/root/.castgetrc | grep spool | cut -f2 -d'='); do
        logIt $FOLDER
        checkFolder $FOLDER
    done

    # Run Castget RSS Downloader & Output Log
    if [ "$(pidof castget)" ]; then
        logIt "Castget Is Currently Running"
    elif [ "$(ls -A /opt)" ]; then
        logIt "Castget Is Not Currently Running"

        logIt "Running Castget"
        #castget -v -c -r | logger -t Castget "$@"
        castget -v | logger -t Castget "$@"
    fi
fi
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License