Ichapod: Headless Linux Download Podcatcher
#1
What Is It?
This is a small application designed to be run as a cron job on a headless Linux setup.

What's It Do?
It automatically downloads new audio podcasts, parses their details from the feed, and then does the filenames & tags so that the podcasts will look good in media players like XBMC.

Installation
This program runs as a bash script. You will need to install the prerequisites, but if you're running Ubuntu they are all in the default repositories and a single apt-get can get you where you need to be:

sudo apt-get install eyeD3 xsltproc wget mp3gain

After installing the pre-reqs, just download the files to whereever you want, edit the settings, give the main script executable rights, and you should be ready to run. I am running this hourly using the following item in crontab:

/home/patrick/Ichapod/ichapod.sh>>/var/www/logs/ichapod-runlog-`date +\%Y-\%m-\%d`.log

The first half is just the script's full address. I am piping the output to the /var/www/logs folder, which means I can go to my web server to check the log output. Obviously you don't HAVE to do this, you can send the logs anywhere. The filename portion of things is just auto-generating a log with today's date, like ichapod-runlog-2011-12-21.log.

I've got this project hosted on GitHub. The script itself is actually fairly well commented so between that and my documentation you should be able to get it working without too much effort.

History
This project got indirectly inspired by you folks in this forum. I ended up running a headless Linux box to host SABnzbd, Transmission, SickBeard, CouchPotato, etc. One of the types of media I didn't have a good "solution" for was podcasts.

My biggest beef was that I have a lot of nice media player solutions on various platforms (on the computer I use Songbird and XBMC, on my phone I run UberMusic and PlayerPro), and none of them had what I felt was a "good" way to do podcasts in a centralized way. My idea was to run something in my server alongside my other apps, which could then get the podcasts, process them so they work nicely in my media players, and then stick them where I can use them (into the appropriate Samba share, sync to phone, etc). Gpodder had pretty much all the options I wanted, BUT it currently has no headless option. Googling found me Bashpodder, which works, but puts out really unfriendly files. Surprisingly, most podcasts don't give you files with proper ID3 tags on them, their filenames are really inscrutable, and you can forget about artwork! Bashpodder was my original inspiration, though my code doesn't bear a lot of resemblance to it anymore Tongue.

I have gotten it to the point where it's working well for my everyday use, so its ready for beta status Smile
Catchy Signature Here
Reply
#2
Sample Log Output:
Code:
#################################################
############# ICHAPOD ## 12-21-2011 #############
#################################################

12-21-2324: Download Log missing, settings say it should be /var/www/logs/downloadedpodcasts.log.
12-21-2324: Now downloading NPR-Talk Of The Nation-2011-12-21-1000-Why Your Job Search Shouldn't Take A Holiday.mp3.
12-21-2324: Now downloading NPR-Talk Of The Nation-2011-12-21-1000-Brutal Incidents Shine Light On Band Hazing Culture.mp3.
12-21-2325: Now downloading NPR-Talk Of The Nation-2011-12-21-1000-Turkish Advisor Responds To Conflict With Syria.mp3.
12-21-2325: Now downloading NPR-Talk Of The Nation-2011-12-21-1000-The Politics Of The Keystone XL Pipeline Debate.mp3.
12-21-2326: Now downloading NPR-Talk Of The Nation-2011-12-20-1000-Finding Bright Spots In A Lackluster 2011.mp3.
12-21-2327: Now downloading NPR-Talk Of The Nation-2011-12-20-1000-Revisiting The First 'Tinker, Tailor, Soldier, Spy'.mp3.
12-21-2327: Now downloading NPR-Talk Of The Nation-2011-12-20-1000-Letters-Video Games And The High Cost Of College.mp3.
12-21-2327: Now downloading NPR-Talk Of The Nation-2011-12-20-1000-Autism Rates Have Spiked, But Why.mp3.
12-21-2328: Now downloading NPR-Talk Of The Nation-2011-12-20-1000-Jake Shimabukuro Gives Ukelele A Chance To Shine.mp3.
12-21-2328: Now downloading NPR-Talk Of The Nation-2011-12-19-1000-Future Uncertain For Reclusive North Korea.mp3.
12-21-2329: Now downloading NPR-Talk Of The Nation-2011-12-19-1000-In 'Fielding,' Baseball Meets The White Whale.mp3.
12-21-2330: Now downloading NPR-Talk Of The Nation-2011-12-19-1000-What Lessons Should Americans Draw From Iraq War.mp3.
12-21-2331: Now downloading NPR-Talk Of The Nation-2011-12-19-1000-Dorfman on Havel-One Playwright Remembers Another.mp3.
12-21-2331: Now downloading NPR-Talk Of The Nation-2011-12-16-1000-Treating Stress, Speech Disorders With Music.mp3.
12-21-2332: Now downloading NPR-Talk Of The Nation-2011-12-16-1000-Science Diction-The Origin Of The Petri Dish.mp3.
12-21-2332: Now downloading NPR-Talk Of The Nation-2011-12-16-1000-Physicists Find 'Hints' of Elusive Higgs Boson.mp3.
12-21-2332: Now downloading NPR-Talk Of The Nation-2011-12-16-1000-Exploring The Science Of Flying, From Your Window Seat.mp3.
12-21-2333: Now downloading NPR-Talk Of The Nation-2011-12-16-1000-What Makes Wings Work.mp3.
12-21-2333: Now downloading NPR-Talk Of The Nation-2011-12-15-1128-Life With 'Gabby,' Before And After The Shooting.mp3.
12-21-2334: Now downloading NPR-Talk Of The Nation-2011-12-15-1000-High-Profile Cases Fill Supreme Court's Docket.mp3.
12-21-2335: Now downloading NPR-Talk Of The Nation-2011-12-15-1000-What Was Gained, And Lost, In The Iraq War.mp3.
12-21-2335: Now downloading NPR-Talk Of The Nation-2011-12-15-1000-The Best Video Games For Your Holiday Gift List.mp3.
12-21-2335: Now downloading Spill.com-A Couple Of Cold Ones-2011-12-19-0832-A Couple of Cold Ones - December 19, 2011.mp3.
12-21-2337: Now downloading Spill.com-Let's Do This-2011-12-21-0925-Let's Do This!!! - December 20th, 2011.mp3.
12-21-2340: Now downloading Spill.com-Movie Reviews-2011-12-21-0757-The Adventures of Tintin - Audio Review.mp3.
12-21-2341: Now downloading Spill.com-Movie Reviews-2011-12-21-0440-The Girl with the Dragon Tattoo - Audio Review.mp3.
12-21-2341: Now downloading Spill.com-Movie Reviews-2011-12-20-1119-Young Adult - Audio Review.mp3.
12-21-2342: Now downloading Spill.com-Movie Reviews-2011-12-20-1109-Shame - Audio Review.mp3.
12-21-2343: Now downloading Spill.com-Movie Reviews-2011-12-16-0930-Mission-Impossible - Ghost Protocol - Audio Review.mp3.
12-21-2344: Now downloading Spill.com-Movie Reviews-2011-12-16-0612-Sherlock Holmes-A Game of Shadows - Audio Review.mp3.
12-21-2346: Now downloading Spill.com-Movie Reviews-2011-12-15-1519-Alvin and the Chipmunks-Chipwrecked - Audio Review.mp3.
12-21-2346: Now downloading BBC-Global News-2011-12-21-1938-GlobalNews-22 Dec 11 AM Pressure mounts on Syria.mp3.
12-21-2347: Now downloading BBC-Global News-2011-12-21-0903-GlobalNews-21 Dec 11 PM Turmoil in Iraqi government.mp3.
12-21-2348: Now downloading BBC-Global News-2011-12-20-2027-GlobalNews-21 Dec 11 AM Syria deaths, Bird flu, Sudanese rebel.mp3.
12-21-2349: Now downloading BBC-Global News-2011-12-20-0827-GlobalNews-20 Dec 11 PM New tensions within Iraq.mp3.
12-21-2349: Now downloading BBC-Global News-2011-12-19-2000-GlobalNews-20 Dec 11 AM-World watches North Korea.mp3.
12-21-2350: Now downloading BBC-Global News-2011-12-19-0914-GlobalNews-19 Dec 11 PM What now for North Korea.mp3.
12-21-2351: Now downloading BBC-Global News-2011-12-18-1959-GlobalNews-19 Dec 11 AM-Kim Jong Il has died.mp3.
12-21-2351: Now downloading BBC-Global News-2011-12-18-0659-GlobalNews-18 Dec 11 Vaclav Havel dies.mp3.
12-21-2352: Now downloading BBC-Global News-2011-12-17-0708-GlobalNews-17 Dec 11 Arab League consider Syria referral.mp3.
12-21-2353: Now downloading BBC-Global News-2011-12-16-0813-GlobalNews-16 Dec 11 PM European police discover child pornography ring.mp3.
12-21-2353: Now downloading BBC-Global News-2011-12-15-2001-GlobalNews 16 Dec 11 AM-Russian draft UN resolution on Syria.mp3.
12-21-2354: Now downloading BBC-Global News-2011-12-15-0753-GlobalNews-15 Dec 11 PM Withdrawal of US troops from Iraq.mp3.
12-21-2355: Downloading This American Life-2011-12-18-1700-#453-Nemeses.mp3.
12-21-2356: Now downloading NPR-Fresh Air-2011-12-21-1837-NPR-12-21-2011 Fresh Air.mp3.
12-21-2357: Now downloading NPR-Fresh Air-2011-12-20-1852-NPR-12-20-2011 Fresh Air.mp3.
12-21-2359: Now downloading NPR-Fresh Air-2011-12-19-1844-NPR-12-19-2011 Fresh Air.mp3.
12-22-0000: Now downloading NPR-Fresh Air-2011-12-16-1846-NPR-12-16-2011 Fresh Air.mp3.
12-22-0001: Now downloading NPR-Fresh Air-2011-12-15-1837-NPR-12-15-2011 Fresh Air.mp3.
12-22-0002: Now downloading NPR-Culturetopia-2011-12-21-0816-Culturetopia-Swearing And Songwriting Edition.mp3.
12-22-0002: Now downloading NPR-Culturetopia-2011-12-16-0727-Pop Culture Happy Hour-Our Fearless Predictions For 2012.mp3.

I have cleaned up the main output so by default it reports only what "needs" to be there, meaning "hey I downloaded this" and "hey I have an error" type stuff.

I am considering adding an optional secondary log that contains more verbose output from the last time Ichapod ran. That way to check on it you just pull up your log, and if you're like "WTF happened??" you can pull up the last error log, sort of like xbmc's logging system.
Catchy Signature Here
Reply
#3
Image

I am still playing with the formatting and ID3 tags somewhat. I need to change my output folder naming conventions slightly to facilitate artist level thumbnail and artwork being set correctly in XBMC.

At the moment, artist-level tags appear to be working properly, as well as album-level artwork.

One issue I need to solve: how to make the episodes within a feed sort correctly by publish date. I was trying out sorting by track title and then just sticking the publish date on the front of the track name, but its pretty ugly and also doesn't work in many media players. However, I'm not sure what format to use for the track #s that could be derived from the date and also not break things in media players that just expect some numbers in that field.

Any suggestions guys?
Catchy Signature Here
Reply
#4
Just a little update, everything is now pretty much done on this project. It outputs podcasts in into artist and feed level folders which will work properly with XBMC's automatic importer, so you can set artist level fanart, thumbnail, and feed level cover art as well. Big Grin

You can make this script tell XBMC to run a Music Library update by throwing in this line at the end:

curl "http://USERNAME:PASSWORD@IPADDRESS:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn(UpdateLibrary(music))"

Where USERNAME and PASSWORD are your XBMC's web interface username & password (leave them out if you don't have anything set), and IPADDRESS is the LAN IP address for your XBMC machine.
Catchy Signature Here
Reply

Logout Mark Read Team Forum Stats Members Help
Ichapod: Headless Linux Download Podcatcher0