Skip to content

Instantly share code, notes, and snippets.

@parthb102
Created December 2, 2015 00:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parthb102/e962f549ca59c66424dd to your computer and use it in GitHub Desktop.
Save parthb102/e962f549ca59c66424dd to your computer and use it in GitHub Desktop.
Script to automatically find links to the episodes of the podcast 'Code Breaker' (http://content.codebreaker.codes/)
import urllib2
ep_no=5 #enter episode number you want to download here
n=100
def findepno (n):
try:
for i in xrange(n,999):
urllib2.urlopen('http://download.publicradio.org/podcast/marketplace/codebreaker/2015/11/11/codebreaker_'+str(ep_no)+'_20151111_'+str(i)+'_64.mp3')
print "link to episode number "+str(ep_no)+" is: "+"http://download.publicradio.org/podcast/marketplace/codebreaker/2015/11/11/codebreaker_"+str(ep_no)+"_20151111_"+str(i)+"_64.mp3"
break;
except urllib2.HTTPError, e:
findepno(i+1)
except urllib2.URLError, e:
findepno(i+1)
findepno(n)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment