-
-
Save blha303/2a8e87d6cfd70d4e56169fc5ffd980e8 to your computer and use it in GitHub Desktop.
cubelabels = "fblrud" | |
levels = ["l"+i for i in range(1,8)] | |
skipped = 0 | |
for s in cubelabels: | |
for l in levels: | |
for v in range(1,999): | |
for h in range(1,999): | |
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) | |
if req.status_code == 200: | |
with open("{l}_{s}_{v}_{h}.jpg".format(s=s,l=l,v=v,h=h), "wb") as f: | |
for chunk in req: | |
_ = f.write(chunk) | |
print("Done {l}_{s}_{v}_{h}.jpg".format(s=s,l=l,v=v,h=h)) | |
else: | |
print("Skipping on {l}_{s}_{v}_{h}.jpg".format(s=s,l=l,v=v,h=h)) | |
skipped += 1 | |
break | |
if skipped >= 3: | |
skipped = 0 | |
break |
@FistfulOfStars All you need is
import requests
Up top.
Now I'm trying to figure out how to combine these into one image.
@parkerlreed did you figure it out? The outputs are hundreds of JPG (a few bytes)
@parkerlreed did you figure it out? The outputs are hundreds of JPG (a few bytes)
Not in particular. Obviously you could use some stitching software but that would be a bit overkill because they're already aligned perfectly they just need to be put together in the right order. Never figured out a way to do it
I can't seem to fix line 3 as current Python won't let you concatenate a string (the letter L) and a number.
Aha derp I got it
levels = ["l"+str(i) for i in range(1,8)]
Downloading now
Ironic that the original viewer doesn't even work anymore...
https://www.cnn.com/interactive/2017/01/politics/trump-inauguration-gigapixel/
Figured. The viewer and images don't work due to mixed HTTPS and HTTP
Mixed Content: The page at 'https://edition.cnn.com/interactive/2017/01/politics/trump-inauguration-gigapixel/' was loaded over HTTPS, but requested an insecure script 'http://a.visualrevenue.com/vrs.js'. This request has been blocked; the content must be served over HTTPS.```
Hey, thanks for writing this script.
I can't get this to run.. Not terribly familiar with scripting/python/etc, just a pleb trying to archive this.
If you could provide assistance with running it, it would be appreciated.
Traceback (most recent call last): File "krpanodl.py", line 2, in <module> levels = ["l"+i for i in range(1,8)] TypeError: cannot concatenate 'str' and 'int' objects
Edit:
I resolved that by changing:
"l"+i
on line 2 to:
"l"+str(i)
I am now getting:
Traceback (most recent call last): File "krpanodl.py", line 8, in <module> 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) NameError: name 'requests' is not defined