From 8025ce338c572d875af0b0d87de74109b123a1db Mon Sep 17 00:00:00 2001 From: iou1name Date: Tue, 8 Dec 2020 14:07:22 -0500 Subject: [PATCH] bugfix url upload --- saddle.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/saddle.py b/saddle.py index 8e95db1..d81e9c7 100644 --- a/saddle.py +++ b/saddle.py @@ -3,6 +3,7 @@ A file hosting service similar to Pomf and Uguu but without the public nature. """ import os +import re import time import string import random @@ -197,7 +198,7 @@ def download_file(url, timeout=10, max_file_size=config.client_max_size): if r.headers.get('Content-Disposition'): fname = re.search(r'filename="(.+)"', - r.headers['content-disposition']) + r.headers['content-disposition']).group(1) else: fname = os.path.basename(url) return (fname, temp)