mirror of
https://github.com/THIS-IS-NOT-A-BACKUP/zspotify.git
synced 2024-11-26 09:53:17 +01:00
Downloads entire track at once now
This commit is contained in:
parent
16872e08ec
commit
3feb7fda0f
@ -449,12 +449,9 @@ def download_track(track_id_str: str, extra_paths=""):
|
||||
os.makedirs(ROOT_PATH + extra_paths)
|
||||
|
||||
with open(filename, 'wb') as file:
|
||||
while True:
|
||||
# Try's to read exactly 128kb at a time to be more efficient now
|
||||
byte = stream.input_stream.stream().read(1024 * 128)
|
||||
if byte == b'':
|
||||
break
|
||||
file.write(byte)
|
||||
# Try's to download the entire track at once now to be more efficient.
|
||||
byte = stream.input_stream.stream().read(-1)
|
||||
file.write(byte)
|
||||
if not RAW_AUDIO_AS_IS:
|
||||
try:
|
||||
convert_audio_format(filename)
|
||||
|
Loading…
Reference in New Issue
Block a user