Jump to content

Recommended Posts

Posted

Is there a way to download podcasts without itunes? We are wanting to do away with itunes off our images. Is there a) an alternative to download podcasts or b) a way of downloading a podcast on its own without software.

 

To be honest i dont really know the difference between a 'podcast' and just a regular music (mp3?) track.

Posted

You'll probably get a better definition, but a podcast is a recorded broadcast that you can download - often episodic.

 

The BBC provide them too, e.g. BBC - Podcasts - Friday Night Comedy from BBC Radio 4

 

A lot of folk use itunes as it's a good portal, but also provide similar content on their websites, or those like MySpace or YouTube (e.g. marillion.com | NEWS - Journal and Archive - 11 February 2009 | The Official Marillion Website).

 

It depends on where the content is available as to how you need to download it.

  • Thanks 1
Posted
Nice thing about iTunes in conjunction with iPod is that podcasts that have been listened to are automatically removed from the iPod and eventually deleted altogether. It's a very simple process.
Posted
Is there a way to download podcasts without itunes?

 

Sure:

# SynchPodcasts - A Python script to download audio files listed in an RSS feed and copy them on to a portable MP3 player device.
# See the readme.txt file for an overview of this script.
import os
import shutil
import urllib2
import feedparser
import subprocess

# An ordered list of locations to place podcasts, one generally being your harddrive and the other your MP3 player, although you have whatever number
# you wish. Items are downloaded to the first available location and then copied from there to the other locations listed, so the first location
# should probably be your harddrive.
dataLocations = ["N:\My Documents\My Podcasts", "E:\Music"]

# A list of feeds to get podcasts from. Each item is a 3-item list: Title (used as a folder name), URL, and number of files to store at a time.
feeds = [["StackOverflow","http://rss.conversationsnetwork.org/series/stackoverflow.xml",3],
	 ["EdTechRoundUp","http://feeds.feedburner.com/Edtechroundup",6],
	 ["PCProPodcast","http://feeds.feedburner.com/pcpropodcast",6],
	 ["Drabblecast","http://feeds.feedburner.com/TheDrabblecast",6],
	 ["EscapePod","http://feeds.escapepod.org/EscapePod",6],
	 ["StarShipSofa","http://www.starshipsofa.com/feed",6]]

# File format conversion.
conversions = {"m4a":["mp3", "\"C:\\Program Files\\Illustrate\\dBpoweramp\\CoreConverter.exe\" -infile=\"", "\" -outfile=\"", "\" -convert_to=\"mp3 (Lame)\" -silent"]}

# Characters forbidden in file names, along with their replacement strings.
forbiddenChars = {"  ":" ", "\\":"", "/":"", ":":"", "*":"", "?":"", "\"":"", "<":"", ">":"", "|":"", "#":""}

# Read a bunch of HTML in. We do simple search-and-replace on comment strings - old-fashioned, probably rather slow, but all that's needed here, we're
# only generating one static HTML page.
indexLines = file('index.html').readlines()
feedsLines = file('feed.html').readlines()
itemLineLines = file('itemLine.html').readlines()

completeFileList = {}
for feedDetails in feeds:
# For each RSS feed (Podcast) listed, use the FeedParser library to go and get and parse the details.
# We only keep the given number of entries for each feed, though.
print "Parsing feed: " + feedDetails[0]
entries = []
entryCount = 0
feed = feedparser.parse(feedDetails[1])
for entry in feed["entries"]:
	if entryCount < feedDetails[2]:
		entries.insert(0, entry)
	entryCount = entryCount + 1

# The files from each feed need to be downloaded once, then duplicated to each given data location. If a file has already been downloaded to an
# existing, available, data location then we copy it from there to any other locations missing a copy rather than downloading it again.
for dataLocation in dataLocations:
	# The data location given might not be available right at the moment - quietly skip it if that's the case.
	if os.path.exists(dataLocation):
		fileList = []
		# Make sure the folder for this particular feed exists, and make sure the files to support the HTML index file are copied there, too.
		if not os.path.exists(dataLocation + os.sep + feedDetails[0]):
			os.mkdir(dataLocation + os.sep + feedDetails[0])
		if not os.path.exists(dataLocation + os.sep + "player_mp3_maxi.swf"):
			shutil.copyfile("player_mp3_maxi.swf", dataLocation + os.sep + "player_mp3_maxi.swf")
		if not os.path.exists(dataLocation + os.sep + "jquery-1.3.2.min.js"):
			shutil.copyfile("jquery-1.3.2.min.js", dataLocation + os.sep + "jquery-1.3.2.min.js")
			
		# List the files that already exist.
		for fileName in os.listdir(dataLocation + os.sep + feedDetails[0]):
			fileList.insert(0, feedDetails[0] + os.sep + fileName)

		# Deal with each file we want to get from the feed. Remember, this list is only the files we want, not neccesarily the whole feed.
		for entry in entries:
			# Set up some variables to save a bit of typing later on.
			if "enclosures" in entry.keys():
				fileExtension = entry["enclosures"][0]["href"].split(".").pop()
				filePath = dataLocation + os.sep + feedDetails[0] + os.sep
				# We quietly skip any Unicode characters, Unicode filenames confuses the hell out of Windows XP.
				fileName = entry["title"].encode('ascii', 'ignore') + "."

				# If the file in question isn't in MP3 format then it'll need converting - we start by figuring out the file name for the converted MP3 file.
				if fileExtension in conversions.keys():
					fileName = fileName + conversions[fileExtension][0]
				else:
					fileName = fileName + fileExtension
				
				# Avoid Windows XP invalid filename characters, along with any characters that won't work from an HTML page, too.
				for forbiddenChar in forbiddenChars.keys():
					while not fileName.find(forbiddenChar) == -1:
						fileName = fileName.replace(forbiddenChar, forbiddenChars[forbiddenChar])

				# If the file already exists then skip it, we don't need to download it again.
				if not os.path.exists(filePath + fileName):
					# If the file doesn't exist here, first check all other data locations to see if we can copy it from there instead of
					# downloading it again.
					itemFound = False
					for otherDataLocation in dataLocations:
						if not otherDataLocation == dataLocation:
							if os.path.exists(otherDataLocation + os.sep + feedDetails[0] + os.sep + fileName):
								print "\tSynching: " + fileName
								# ---
								# Need some code here to check number of files in folder and remove last one if it's full.
								# ---
								shutil.copyfile(otherDataLocation + os.sep + feedDetails[0] + os.sep + fileName, filePath + fileName)
								itemFound = True
					if not itemFound:
						# Okay, the file wasn't found anywhere else, we'll need to download it.
						print "\tDownloading: " + fileName
						
						# Record the name of the file we're going to download. If that'll leave us with too many files in our list, pop the last one off the end of the
						# list and delete it.
						fileList.insert(0, feedDetails[0] + os.sep + fileName)
						if len(fileList) > feedDetails[2]:
							# When we delete a file, make sure we delete it from all the places it could be stored.
							fileToUnlink = fileList.pop()
							for otherDataLocation in dataLocations:
								if os.path.exists(otherDataLocation + os.sep + fileToUnlink):
									os.unlink(otherDataLocation + os.sep + fileToUnlink)
									
						# Download the audio file - if we'll need to convert it to MP3 later, give it a temporary filename for now.
						infile = urllib2.urlopen(entry["enclosures"][0]["href"])
						if fileExtension in conversions.keys():
							outfile = open(filePath + fileName + "." + fileExtension, "wb")
						else:
							outfile = open(filePath + fileName, "wb")
						fileData = "!"
						while not fileData == "":
							fileData = infile.read(4096)
							outfile.write(fileData)
						infile.close()
						outfile.close()

						# If we need to convert the file to MP3, convert from the temporary file to the proper MP3 file, deleting the temporary
						# file afterwards.
						if fileExtension in conversions.keys():
							batFile = open("runCommand.bat", "w")
							batFile.write("@echo off\n")
							batFile.write(conversions[fileExtension][1] + filePath + fileName + "." + fileExtension + conversions[fileExtension][2] + filePath + fileName + conversions[fileExtension][3] + " >NUL 2>NUL\n")
							batFile.close()
							os.system("runCommand.bat")
							os.unlink("runCommand.bat")
							os.unlink(filePath + fileName + "." + fileExtension)
			# Store the file list for writing to the HTML index page later on.
			completeFileList[feedDetails[0]] = fileList

# Once we've downloaded or copied all the files we want from all the feeds, generate a handy HTML index file in each data location.
# We just use search-and-replace on text strings for value substitution, no fancy web framework stuff going on here.
for dataLocation in dataLocations:
# Again, just quietly skip any location not available.
if os.path.exists(dataLocation):
	outputFile = open(dataLocation+os.sep+"index.html", "w")
	for indexLine in indexLines:
		if not indexLine.find("") == -1:
			for feed in completeFileList.keys():
				for feedsLine in feedsLines:
					if not feedsLine.find("") == -1:
						outputFile.write(feedsLine.rstrip().replace("", feed)+"\n")
					elif not feedsLine.find("") == -1:
						for file in completeFileList[feed]:
							for itemLineLine in itemLineLines:
								if not itemLineLine.find("") == -1:
									outputFile.write(itemLineLine.rstrip().replace("", dataLocation + os.sep + file)+"\n")
								elif not itemLineLine.find("") == -1:
									outputFile.write(itemLineLine.rstrip().replace("", file.split(os.sep).pop())+"\n")
								else:
									outputFile.write(itemLineLine.rstrip()+"\n")
					else:
						outputFile.write(feedsLine.rstrip()+"\n")
		else:
			outputFile.write(indexLine.rstrip()+"\n")
	outputFile.close()

 

syncPodcasts.zip

 

--

David Hicks

  • Thanks 1
Posted
Sure:

# SynchPodcasts - A Python script to download audio files listed in an RSS feed and copy them on to a portable MP3 player device.
# See the readme.txt file for an overview of this script.
import os
import shutil
import urllib2
import feedparser
import subprocess

# An ordered list of locations to place podcasts, one generally being your harddrive and the other your MP3 player, although you have whatever number
# you wish. Items are downloaded to the first available location and then copied from there to the other locations listed, so the first location
# should probably be your harddrive.
dataLocations = ["N:\My Documents\My Podcasts", "E:\Music"]

# A list of feeds to get podcasts from. Each item is a 3-item list: Title (used as a folder name), URL, and number of files to store at a time.
feeds = [["StackOverflow","http://rss.conversationsnetwork.org/series/stackoverflow.xml",3],
	 ["EdTechRoundUp","http://feeds.feedburner.com/Edtechroundup",6],
	 ["PCProPodcast","http://feeds.feedburner.com/pcpropodcast",6],
	 ["Drabblecast","http://feeds.feedburner.com/TheDrabblecast",6],
	 ["EscapePod","http://feeds.escapepod.org/EscapePod",6],
	 ["StarShipSofa","http://www.starshipsofa.com/feed",6]]

# File format conversion.
conversions = {"m4a":["mp3", "\"C:\\Program Files\\Illustrate\\dBpoweramp\\CoreConverter.exe\" -infile=\"", "\" -outfile=\"", "\" -convert_to=\"mp3 (Lame)\" -silent"]}

# Characters forbidden in file names, along with their replacement strings.
forbiddenChars = {"  ":" ", "\\":"", "/":"", ":":"", "*":"", "?":"", "\"":"", "<":"", ">":"", "|":"", "#":""}

# Read a bunch of HTML in. We do simple search-and-replace on comment strings - old-fashioned, probably rather slow, but all that's needed here, we're
# only generating one static HTML page.
indexLines = file('index.html').readlines()
feedsLines = file('feed.html').readlines()
itemLineLines = file('itemLine.html').readlines()

completeFileList = {}
for feedDetails in feeds:
# For each RSS feed (Podcast) listed, use the FeedParser library to go and get and parse the details.
# We only keep the given number of entries for each feed, though.
print "Parsing feed: " + feedDetails[0]
entries = []
entryCount = 0
feed = feedparser.parse(feedDetails[1])
for entry in feed["entries"]:
	if entryCount < feedDetails[2]:
		entries.insert(0, entry)
	entryCount = entryCount + 1

# The files from each feed need to be downloaded once, then duplicated to each given data location. If a file has already been downloaded to an
# existing, available, data location then we copy it from there to any other locations missing a copy rather than downloading it again.
for dataLocation in dataLocations:
	# The data location given might not be available right at the moment - quietly skip it if that's the case.
	if os.path.exists(dataLocation):
		fileList = []
		# Make sure the folder for this particular feed exists, and make sure the files to support the HTML index file are copied there, too.
		if not os.path.exists(dataLocation + os.sep + feedDetails[0]):
			os.mkdir(dataLocation + os.sep + feedDetails[0])
		if not os.path.exists(dataLocation + os.sep + "player_mp3_maxi.swf"):
			shutil.copyfile("player_mp3_maxi.swf", dataLocation + os.sep + "player_mp3_maxi.swf")
		if not os.path.exists(dataLocation + os.sep + "jquery-1.3.2.min.js"):
			shutil.copyfile("jquery-1.3.2.min.js", dataLocation + os.sep + "jquery-1.3.2.min.js")
			
		# List the files that already exist.
		for fileName in os.listdir(dataLocation + os.sep + feedDetails[0]):
			fileList.insert(0, feedDetails[0] + os.sep + fileName)

		# Deal with each file we want to get from the feed. Remember, this list is only the files we want, not neccesarily the whole feed.
		for entry in entries:
			# Set up some variables to save a bit of typing later on.
			if "enclosures" in entry.keys():
				fileExtension = entry["enclosures"][0]["href"].split(".").pop()
				filePath = dataLocation + os.sep + feedDetails[0] + os.sep
				# We quietly skip any Unicode characters, Unicode filenames confuses the hell out of Windows XP.
				fileName = entry["title"].encode('ascii', 'ignore') + "."

				# If the file in question isn't in MP3 format then it'll need converting - we start by figuring out the file name for the converted MP3 file.
				if fileExtension in conversions.keys():
					fileName = fileName + conversions[fileExtension][0]
				else:
					fileName = fileName + fileExtension
				
				# Avoid Windows XP invalid filename characters, along with any characters that won't work from an HTML page, too.
				for forbiddenChar in forbiddenChars.keys():
					while not fileName.find(forbiddenChar) == -1:
						fileName = fileName.replace(forbiddenChar, forbiddenChars[forbiddenChar])

				# If the file already exists then skip it, we don't need to download it again.
				if not os.path.exists(filePath + fileName):
					# If the file doesn't exist here, first check all other data locations to see if we can copy it from there instead of
					# downloading it again.
					itemFound = False
					for otherDataLocation in dataLocations:
						if not otherDataLocation == dataLocation:
							if os.path.exists(otherDataLocation + os.sep + feedDetails[0] + os.sep + fileName):
								print "\tSynching: " + fileName
								# ---
								# Need some code here to check number of files in folder and remove last one if it's full.
								# ---
								shutil.copyfile(otherDataLocation + os.sep + feedDetails[0] + os.sep + fileName, filePath + fileName)
								itemFound = True
					if not itemFound:
						# Okay, the file wasn't found anywhere else, we'll need to download it.
						print "\tDownloading: " + fileName
						
						# Record the name of the file we're going to download. If that'll leave us with too many files in our list, pop the last one off the end of the
						# list and delete it.
						fileList.insert(0, feedDetails[0] + os.sep + fileName)
						if len(fileList) > feedDetails[2]:
							# When we delete a file, make sure we delete it from all the places it could be stored.
							fileToUnlink = fileList.pop()
							for otherDataLocation in dataLocations:
								if os.path.exists(otherDataLocation + os.sep + fileToUnlink):
									os.unlink(otherDataLocation + os.sep + fileToUnlink)
									
						# Download the audio file - if we'll need to convert it to MP3 later, give it a temporary filename for now.
						infile = urllib2.urlopen(entry["enclosures"][0]["href"])
						if fileExtension in conversions.keys():
							outfile = open(filePath + fileName + "." + fileExtension, "wb")
						else:
							outfile = open(filePath + fileName, "wb")
						fileData = "!"
						while not fileData == "":
							fileData = infile.read(4096)
							outfile.write(fileData)
						infile.close()
						outfile.close()

						# If we need to convert the file to MP3, convert from the temporary file to the proper MP3 file, deleting the temporary
						# file afterwards.
						if fileExtension in conversions.keys():
							batFile = open("runCommand.bat", "w")
							batFile.write("@echo off\n")
							batFile.write(conversions[fileExtension][1] + filePath + fileName + "." + fileExtension + conversions[fileExtension][2] + filePath + fileName + conversions[fileExtension][3] + " >NUL 2>NUL\n")
							batFile.close()
							os.system("runCommand.bat")
							os.unlink("runCommand.bat")
							os.unlink(filePath + fileName + "." + fileExtension)
			# Store the file list for writing to the HTML index page later on.
			completeFileList[feedDetails[0]] = fileList

# Once we've downloaded or copied all the files we want from all the feeds, generate a handy HTML index file in each data location.
# We just use search-and-replace on text strings for value substitution, no fancy web framework stuff going on here.
for dataLocation in dataLocations:
# Again, just quietly skip any location not available.
if os.path.exists(dataLocation):
	outputFile = open(dataLocation+os.sep+"index.html", "w")
	for indexLine in indexLines:
		if not indexLine.find("") == -1:
			for feed in completeFileList.keys():
				for feedsLine in feedsLines:
					if not feedsLine.find("") == -1:
						outputFile.write(feedsLine.rstrip().replace("", feed)+"\n")
					elif not feedsLine.find("") == -1:
						for file in completeFileList[feed]:
							for itemLineLine in itemLineLines:
								if not itemLineLine.find("") == -1:
									outputFile.write(itemLineLine.rstrip().replace("", dataLocation + os.sep + file)+"\n")
								elif not itemLineLine.find("") == -1:
									outputFile.write(itemLineLine.rstrip().replace("", file.split(os.sep).pop())+"\n")
								else:
									outputFile.write(itemLineLine.rstrip()+"\n")
					else:
						outputFile.write(feedsLine.rstrip()+"\n")
		else:
			outputFile.write(indexLine.rstrip()+"\n")
	outputFile.close()

 

[ATTACH]5147[/ATTACH]

 

--

David Hicks

 

Thanks, but I dont quite think emailling the staff a python script will go down to well :p

 

Will keep it for reference though, I might have use for it in the future (although, all the 'podcasts' I use have a direct mp3 link download anyway)

 

ajbritton: this is just for PC+Podcast, no ipods involved

 

(PS: Id be pis$ed if i had an ipod, and listened to a podcast, and it deleted itself!!)

Posted
Thanks, but I dont quite think emailling the staff a python script will go down to well

 

No, you print it out and get them to type it in themselves, like the good old days. Fun!

 

The above script and associated data files are attached in that link to a ZIP file. If you just want to play MP3 files from a PC then the above script also generates an HTML file with an embedded Flash MP3 player for each podcast, so you could run the script on a central server and simply point people at the appropriate web page to go listen to podcasts. It will also use an external program, if available, to convert other formats to MP3.

 

--

David Hicks

Posted (edited)
You'll probably get a better definition, but a podcast is a recorded broadcast that you can download - often episodic.

 

The defining feature of a podcast (vs a bunch of mp3 files sat on a website) is that there is an RSS feed which forms an index to the mp3 files, with each mp3 as an enclosure.

 

Software like iTunes, juice downloader, castget (a simple command line linux app) poll the RSS feed periodically and download new mp3 files.

 

To answer an earlier question - yes, juice is good. You can also try subscribing to the RSS feed in your browser - that should give you facilities to download the enclosure (mp3) but software like juice can do it on a more automatic basis.

Edited by SteveBentley

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...