From e4f2a2a13bcec1cc222f6265bfa6abe39f38aa55 Mon Sep 17 00:00:00 2001 From: Kumi Date: Sat, 21 Oct 2023 09:21:14 +0200 Subject: [PATCH] Fix regex for krpano numeric indices --- krpanosteal/__init__.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/krpanosteal/__init__.py b/krpanosteal/__init__.py index 395a759..c1d4549 100644 --- a/krpanosteal/__init__.py +++ b/krpanosteal/__init__.py @@ -130,15 +130,14 @@ 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]): + elif re.search(r"^\d.jpg", parts[-1]): return krpano_export_simple(url, "012345") else: schema = krpano_normalize(url) images = krpano_export(schema) return multistitch(images) - except: - raise + except Exception as e: raise ValueError("%s does not seem to be a valid krpano URL." % url)