don't fail if getsize fails on tmp file
This commit is contained in:
parent
4689af2050
commit
20b3831862
1 changed files with 4 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue