forked from 0x2620/pandora
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()
|
return HttpResponseForbidden()
|
||||||
elif r is True:
|
elif r is True:
|
||||||
response = HttpResponse(FileWrapper(video), content_type=content_type)
|
response = HttpResponse(FileWrapper(video), content_type=content_type)
|
||||||
response['Content-Length'] = os.path.getsize(video.name)
|
try:
|
||||||
|
response['Content-Length'] = os.path.getsize(video.name)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
else:
|
else:
|
||||||
response = HttpFileResponse(r, content_type=content_type)
|
response = HttpFileResponse(r, content_type=content_type)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue