Add numeric image indices for krpanosteal

This commit is contained in:
Kumi 2023-10-21 09:10:12 +02:00
parent db1762ddd5
commit 7868cf301d
Signed by: kumi
GPG key ID: ECBCC9082395383F
2 changed files with 5 additions and 2 deletions

View file

@ -18,6 +18,7 @@ regs = {
"c\d_l\d_\d_\d.jpg": "pindorasteal",
"/[frblud]/l\d/\d/l\d_[frblud]_\d_\d.jpg": "eyerevolutionsteal",
"(pos|neg)[xyz]\.jpg": "xvrsteal",
r"\d.jpg": "krpanosteal",
}

View file

@ -95,7 +95,7 @@ def krpano_export(schema):
return output
def krpano_export_simple(url):
def krpano_export_simple(url, tiles="frblud"):
'''
Exports krpano panoramas which only consist of six complete tiles. Takes
the URL of one of these images and returns a list of PIL.Image objects
@ -106,7 +106,7 @@ def krpano_export_simple(url):
output = []
for i in "frblud":
for i in tiles:
cur = url[:-5] + i + url[-4:]
res = urllib.request.urlopen(cur)
assert res.getcode() == 200
@ -130,6 +130,8 @@ def krpano_make_tiles(url):
try:
if re.search(r"\_[frblud].jpg", parts[-1]):
return krpano_export_simple(url)
elif re.search(r"\d.jpg", parts[-1]):
return krpano_export_simple(url, "012345")
else:
schema = krpano_normalize(url)
images = krpano_export(schema)