Proper fix for incomplete downloads
This commit is contained in:
parent
7bc02bd3d0
commit
7c315da6f4
|
@ -1,5 +1,8 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## v0.6.5
|
||||||
|
- Implemented more stable fix for bug still persisting after v0.6.4
|
||||||
|
|
||||||
## v0.6.4
|
## v0.6.4
|
||||||
- Fixed upstream bug causing tracks to not download fully
|
- Fixed upstream bug causing tracks to not download fully
|
||||||
|
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -12,7 +12,7 @@ README = (HERE / "README.md").read_text()
|
||||||
# This call to setup() does all the work
|
# This call to setup() does all the work
|
||||||
setup(
|
setup(
|
||||||
name="zotify",
|
name="zotify",
|
||||||
version="0.6.4",
|
version="0.6.5",
|
||||||
author="Zotify Contributors",
|
author="Zotify Contributors",
|
||||||
description="A music and podcast downloader.",
|
description="A music and podcast downloader.",
|
||||||
long_description=README,
|
long_description=README,
|
||||||
|
|
|
@ -118,10 +118,13 @@ def download_episode(episode_id) -> None:
|
||||||
unit_divisor=1024
|
unit_divisor=1024
|
||||||
) as p_bar:
|
) as p_bar:
|
||||||
prepare_download_loader.stop()
|
prepare_download_loader.stop()
|
||||||
for _ in range(int(total_size / Zotify.CONFIG.get_chunk_size()) + 2):
|
while True:
|
||||||
|
#for _ in range(int(total_size / Zotify.CONFIG.get_chunk_size()) + 2):
|
||||||
data = stream.input_stream.stream().read(Zotify.CONFIG.get_chunk_size())
|
data = stream.input_stream.stream().read(Zotify.CONFIG.get_chunk_size())
|
||||||
p_bar.update(file.write(data))
|
p_bar.update(file.write(data))
|
||||||
downloaded += len(data)
|
downloaded += len(data)
|
||||||
|
if data == b'':
|
||||||
|
break
|
||||||
if Zotify.CONFIG.get_download_real_time():
|
if Zotify.CONFIG.get_download_real_time():
|
||||||
delta_real = time.time() - time_start
|
delta_real = time.time() - time_start
|
||||||
delta_want = (downloaded / total_size) * (duration_ms/1000)
|
delta_want = (downloaded / total_size) * (duration_ms/1000)
|
||||||
|
|
|
@ -221,10 +221,13 @@ def download_track(mode: str, track_id: str, extra_keys=None, disable_progressba
|
||||||
unit_divisor=1024,
|
unit_divisor=1024,
|
||||||
disable=disable_progressbar
|
disable=disable_progressbar
|
||||||
) as p_bar:
|
) as p_bar:
|
||||||
for _ in range(int(total_size / Zotify.CONFIG.get_chunk_size()) + 2):
|
while True:
|
||||||
|
#for _ in range(int(total_size / Zotify.CONFIG.get_chunk_size()) + 2):
|
||||||
data = stream.input_stream.stream().read(Zotify.CONFIG.get_chunk_size())
|
data = stream.input_stream.stream().read(Zotify.CONFIG.get_chunk_size())
|
||||||
p_bar.update(file.write(data))
|
p_bar.update(file.write(data))
|
||||||
downloaded += len(data)
|
downloaded += len(data)
|
||||||
|
if data == b'':
|
||||||
|
break
|
||||||
if Zotify.CONFIG.get_download_real_time():
|
if Zotify.CONFIG.get_download_real_time():
|
||||||
delta_real = time.time() - time_start
|
delta_real = time.time() - time_start
|
||||||
delta_want = (downloaded / total_size) * (duration_ms/1000)
|
delta_want = (downloaded / total_size) * (duration_ms/1000)
|
||||||
|
|
Loading…
Reference in New Issue