mirror of
				https://github.com/devine-dl/devine.git
				synced 2025-11-04 11:54:50 +00:00 
			
		
		
		
	Ensure output directory exists in requests downloader
This commit is contained in:
		
							parent
							
								
									95802d1e64
								
							
						
					
					
						commit
						e079febe79
					
				@ -60,6 +60,7 @@ def requests(
 | 
				
			|||||||
    last_speed_refresh = time.time()
 | 
					    last_speed_refresh = time.time()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for url, out_path in uri:
 | 
					    for url, out_path in uri:
 | 
				
			||||||
 | 
					        out_path.parent.mkdir(parents=True, exist_ok=True)
 | 
				
			||||||
        stream = session.get(url, stream=True)
 | 
					        stream = session.get(url, stream=True)
 | 
				
			||||||
        file_size = int(stream.headers["Content-Length"])
 | 
					        file_size = int(stream.headers["Content-Length"])
 | 
				
			||||||
        with open(out_path, "wb") as f:
 | 
					        with open(out_path, "wb") as f:
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user