diff --git a/src/pix360_krpano/modules.py b/src/pix360_krpano/modules.py index 2a78dc5..d828552 100644 --- a/src/pix360_krpano/modules.py +++ b/src/pix360_krpano/modules.py @@ -17,7 +17,8 @@ class KRPanoDownloader(DownloaderModule): self.logger = logging.getLogger("pix360") REGEX_FULL: List[Tuple[str, int, Dict[str, str]]] = [ - (r"\d+/\d+/\d+_\d+\.jpg", DownloaderModule.CERTAINTY_PROBABLE, {}), + (r"\d+/\d+/\d+_\d+\.jpg", DownloaderModule.CERTAINTY_PROBABLE, {}), + (r"[frblud]/\d+/\d+_\d+\.jpg", DownloaderModule.CERTAINTY_PROBABLE, {}), ] REGEX_SIMPLE: List[Tuple[str, int, Dict[str, str]]] = [ @@ -94,7 +95,11 @@ class KRPanoConverter: assert "_" in parts[-1] parts[-1] = "%i_%i.jpg" parts[-2] = "%i" - parts[-3] = parts[-3].rstrip("0123456789") + "%i" + + if not parts[-3].isnumeric(): + parts[-3] = parts[-3].rstrip("frblud") + "%s" + else: + parts[-3] = parts[-3].rstrip("0123456789") + "%i" return "/".join(parts) @@ -148,7 +153,12 @@ class KRPanoConverter: while True: try: - res = HTTPRequest(schema % (tile, maxzoom, y, x)).open() + if "%s" in schema.split("/")[-3]: + tile_char = "frblud"[tile] + else: + tile_char = tile + + res = HTTPRequest(schema % (tile_char, maxzoom, y, x)).open() assert res.getcode() == 200 content = res.read() fo = ContentFile(content, name=f"{tile}_{maxzoom}_{y}_{x}.jpg")