don't fail if getsize fails on tmp file

This commit is contained in:
j 2021-03-29 11:03:12 +02:00
parent 4689af2050
commit 20b3831862

View file

@ -1030,7 +1030,10 @@ def download(request, id, resolution=None, format='webm', part=None):
return HttpResponseForbidden()
elif r is True:
response = HttpResponse(FileWrapper(video), content_type=content_type)
try:
response['Content-Length'] = os.path.getsize(video.name)
except:
pass
else:
response = HttpFileResponse(r, content_type=content_type)
else: