From 88fe018f1b92d261a680756968f6f60d7223a4dd Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 26 May 2022 12:50:25 +0100 Subject: [PATCH] Check that url contains slash --- inbox.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/inbox.py b/inbox.py index 8128c3620..1841f8f88 100644 --- a/inbox.py +++ b/inbox.py @@ -169,7 +169,10 @@ def _cache_svg_images(session, base_dir: str, http_prefix: str, continue if '://' + i2p_domain in url: continue - filename = url.split('/')[-1] + if '/' in filename: + filename = url.split('/')[-1] + else: + filename = url image_filename = \ base_dir + '/media/' + post_id + '_' + filename if not download_image(session, base_dir, url,