bugfix url upload

This commit is contained in:
iou1name 2020-12-08 14:07:22 -05:00
parent 4d736eb913
commit 8025ce338c

View File

@ -3,6 +3,7 @@
A file hosting service similar to Pomf and Uguu but without the public nature. A file hosting service similar to Pomf and Uguu but without the public nature.
""" """
import os import os
import re
import time import time
import string import string
import random 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'): if r.headers.get('Content-Disposition'):
fname = re.search(r'filename="(.+)"', fname = re.search(r'filename="(.+)"',
r.headers['content-disposition']) r.headers['content-disposition']).group(1)
else: else:
fname = os.path.basename(url) fname = os.path.basename(url)
return (fname, temp) return (fname, temp)