Skip to content

Instantly share code, notes, and snippets.

@yukunlin
Last active October 10, 2015 10:04
Show Gist options
  • Save yukunlin/22754e813aa685f6cc60 to your computer and use it in GitHub Desktop.
Save yukunlin/22754e813aa685f6cc60 to your computer and use it in GitHub Desktop.
Scrape Google Earth View web gallery for to download all images
import requests
import multiprocessing as mp
url = 'http://earthview.withgoogle.com/download/'
def download_image(n):
try:
f = '%0.4d' % n + '.jpg'
r = requests.get(url+f)
if len(r.content) > 50000:
with open(f, 'w') as image:
image.write(r.content)
except KeyboardInterrupt:
raise Exception
args = range(1000, 8000)
pool = mp.Pool(8)
pool.map(download_image, args)
pool.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment