From c2ff2dfbb1498a06a95473fb4a9a8bcc818daa0c Mon Sep 17 00:00:00 2001 From: Mike Lang Date: Thu, 31 Oct 2024 21:02:07 +0100 Subject: [PATCH] download_imgur_url: Clarify not handling i.imgur.com --- common/common/media.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/common/media.py b/common/common/media.py index 0118158..064e459 100644 --- a/common/common/media.py +++ b/common/common/media.py @@ -280,7 +280,6 @@ def download_imgur_url(output_dir, max_size, url): Handles URLs like the following: i.stack.imgur.com/ID.png imgur.com/ID - i.imgur.com/ID.EXT These map to actual media and are stored in the usual way. imgur.com/a/ID imgur.com/gallery/ID @@ -288,6 +287,9 @@ def download_imgur_url(output_dir, max_size, url): Under the original URL we store a json file that lists imgur.com/ID urls of the contents of the collection. Those urls are then downloaded and stored in the usual way. + Notably this function doesn't need to handle URLs like: + i.imgur.com/ID.EXT + as this is already a direct image link, so we can just use the normal handling. """ parsed = urllib.parse.urlparse(url) if parsed.hostname not in ("imgur.com", "i.stack.imgur.com"):