diff --git a/imgin/__init__.py b/imgin/__init__.py index 38ad481..614cd7c 100644 --- a/imgin/__init__.py +++ b/imgin/__init__.py @@ -60,7 +60,8 @@ def gallery(id=''): @route('/') def hello(img=''): - + if img.endswith("jpeg") and not img.endswith("jpg") and not img.endswith("png"): + img += ".jpg" if not path.exists(IMAGE_CACHE + img): get(img, IMAGE_CACHE) return static_file(img, root=IMAGE_CACHE) diff --git a/imgin/get.py b/imgin/get.py index 738ad44..03631f2 100644 --- a/imgin/get.py +++ b/imgin/get.py @@ -34,9 +34,6 @@ def get(url: str, write_dir: str, delete=True): album = True if not url.endswith("blog"): url += "/layout/blog" - else: - if url.endswith("jpeg") and not url.endswith("jpg") and not url.endswith("png"): - url += ".jpg" if not album: