Improve robustness in case of bad packets.
This commit is contained in:
11
panasonic.py
11
panasonic.py
@@ -277,11 +277,12 @@ def downloadMovie(url, outputFileName):
|
||||
output.write(chunk)
|
||||
if nbiters == 1000:
|
||||
lastTS = getLastTSFromFD(outputFD)
|
||||
delta = lastTS-initialTS
|
||||
ratio = delta/total
|
||||
length = fstat(outputFD).st_size
|
||||
estimatedLength = ceil(length/ratio)
|
||||
pb.total = estimatedLength
|
||||
if lastTS != None:
|
||||
delta = lastTS-initialTS
|
||||
ratio = delta/total
|
||||
length = fstat(outputFD).st_size
|
||||
estimatedLength = ceil(length/ratio)
|
||||
pb.total = estimatedLength
|
||||
lseek(outputFD, 0, SEEK_END)
|
||||
nbiters = 0
|
||||
pb.update(len(chunk))
|
||||
|
||||
Reference in New Issue
Block a user