Last active 1667395845

A script to download images from a krpano. Made for the CNN gigapixel panorama of Trump's inauguration

Steven Smith revised this gist 1485074414. Go to revision

1 file changed, 20 insertions

krpanodl.py(file created)

@@ -0,0 +1,20 @@
1 + cubelabels = "fblrud"
2 + levels = ["l"+i for i in range(1,8)]
3 + skipped = 0
4 + for s in cubelabels:
5 + for l in levels:
6 + for v in range(1,999):
7 + for h in range(1,999):
8 + req = requests.get("http://europe.tiles.fanpic.co/749-2017-cnn/mres_{s}/{l}/{v}/{l}_{s}_{v}_{h}.jpg".format(s=s,l=l,v=v,h=h), stream=True)
9 + if req.status_code == 200:
10 + with open("{l}_{s}_{v}_{h}.jpg".format(s=s,l=l,v=v,h=h), "wb") as f:
11 + for chunk in req:
12 + _ = f.write(chunk)
13 + print("Done {l}_{s}_{v}_{h}.jpg".format(s=s,l=l,v=v,h=h))
14 + else:
15 + print("Skipping on {l}_{s}_{v}_{h}.jpg".format(s=s,l=l,v=v,h=h))
16 + skipped += 1
17 + break
18 + if skipped >= 3:
19 + skipped = 0
20 + break
Newer Older