Fix download bug
parent
96864eb4ae
commit
fd2808e887
|
@ -109,14 +109,12 @@ class BaseEpisode:
|
||||||
|
|
||||||
logging.debug(path)
|
logging.debug(path)
|
||||||
|
|
||||||
if os.path.exists(path) and not force:
|
if os.path.exists(path):
|
||||||
if os.stat(path).st_size == total_size:
|
if os.stat(path).st_size == total_size and not force:
|
||||||
logging.warning('File already downloaded. Skipping download.')
|
logging.warning('File already downloaded. Skipping download.')
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
os.remove(path)
|
os.remove(path)
|
||||||
else:
|
|
||||||
os.remove(path)
|
|
||||||
|
|
||||||
if r.status_code == 200:
|
if r.status_code == 200:
|
||||||
with open(path, 'wb') as f:
|
with open(path, 'wb') as f:
|
||||||
|
|
Loading…
Reference in New Issue