Skip to content

Over 1M Microsoft eBooks Given Away in 2 Days

blogs.msdn.com
20 pointsnewsreader1 comment
On HN

Comments

This may be weird... but this downloads all the books (just find and extract out all the links to a file) import urllib2 import urllib

f = open('file.txt') CHUNK = 16 * 1024 for line in f: req = urllib2.urlopen(line) file = req.geturl().split('/')[-1] file = urllib.unquote(file) if '.pdf' in file[len(file)-4:]: with open(file, 'wb') as fp: while True: chunk = req.read(CHUNK) if not chunk: break fp.write(chunk)

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.