From de884b1df9900eb943cf37220c0a70c9cc0d229a Mon Sep 17 00:00:00 2001 From: kageru Date: Tue, 21 Aug 2018 17:57:04 +0200 Subject: [PATCH] fixed a bug when uploading non-images and using preview --- pyshare.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pyshare.py b/pyshare.py index 523b6d1..6eb5f7f 100755 --- a/pyshare.py +++ b/pyshare.py @@ -51,7 +51,11 @@ def upload_local_file(path: str) -> None: url = config.url_template.format(filename) else: url = curl_upload(path) - notify_user(url, path) + # Only pass the path when uploading an image + if re.search(r'\.(png|jpe?g|bmp)$', path): + notify_user(url, path) + else: + notify_user(url) def prepare_file(ext: str) -> str: