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