Created
December 2, 2015 00:38
-
-
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/)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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