python

Download all "The Social Engineer Podcast" episodes with one little script

I've used this script to download all the episodes from the amazing "Social Engineer Podcast" and thought of sharing it with you guys.

#!/usr/bin/env python
# Mp3 feed downloader snippet
# Modifications by facuman, original script by unutbu
 
from urllib2 import urlopen
import re
import os
import sys
# Uncomment the following line and comment the one below if you wish to type the source url
#url=sys.argv[1]
url="http://socialengineer.podbean.com/feed/"
print "Downloading from %s\n\n" % url
content=urlopen(url).read()
contents=content.split()
pat=re.compile('(http://.+?\.mp3)')
groups=(pat.search(line) for line in content.split())
tuples=(g.groups() for g in groups if g)
for mp3, in tuples: