autocastr.py |
|
---|---|
Download your podcasts and separate them into CD-R sized folders to allow for quick burning |
|
why? Because I'm cheap -- now you can listen to podcasts in your car without aftermarket sound systems or crappy mp3 player docks, just use your CD player! |
|
External dependancy, too lazy to parse RSS feeds myself |
|
Settings are stored in an external JSON file |
|
Threshold for making a new folder |
|
How many old episodes per feed to retrieve |
|
Use a list comprehension to generate a list of feed URLs |
|
The feeds we want to track are stored in a text file |
|
Add any new feeds to settings |
|
Remove any feeds that we don't want to download anymore, notice that I make a copy of the list so I can operate on it while in the loop context |
|
Return the latest folder in the podcasts directory, based on the highest number |
|
Do some python-fu to get the max directory number |
|
Helper to clear out all old podcasts |
|
Who needs recursive directory walking when you have shutil! |
|
Strips filename of any strange characters so the OS won't complain when we try to save it |
|
Bad but w/e |
|
Writes the mp3 to the first available directory; if adding it to the lastest directory will cause the folder to exceed the size limit then a new folder is created and the file is stored there |
|
Make sure the folder exists on disk, if it doesn't create it |
|
Loop over the feeds |
|
some podcast feeds are dumb and don't put the newest episodes at the top... lambda to the rescue |
|
Make the time of the latest entry so we don't bother checking stuff multiple times |
|
I don't know why this was in the loop, probably doesn't need to be |
|