mirror of
				https://github.com/devine-dl/devine.git
				synced 2025-11-04 11:54:50 +00:00 
			
		
		
		
	Silence at the log_buffer not the stdout in aria2c
This is so we can still obtain progress data while calling aria2c silently
This commit is contained in:
		
							parent
							
								
									9f04676b5c
								
							
						
					
					
						commit
						009a880371
					
				@ -119,7 +119,7 @@ async def aria2c(
 | 
				
			|||||||
            executable,
 | 
					            executable,
 | 
				
			||||||
            *arguments,
 | 
					            *arguments,
 | 
				
			||||||
            stdin=subprocess.PIPE,
 | 
					            stdin=subprocess.PIPE,
 | 
				
			||||||
            stdout=[subprocess.PIPE, subprocess.DEVNULL][silent]
 | 
					            stdout=subprocess.PIPE
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        p.stdin.write(url_file.encode())
 | 
					        p.stdin.write(url_file.encode())
 | 
				
			||||||
@ -165,7 +165,7 @@ async def aria2c(
 | 
				
			|||||||
                            continue
 | 
					                            continue
 | 
				
			||||||
                        log_buffer += f"{line.strip()}\n"
 | 
					                        log_buffer += f"{line.strip()}\n"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if log_buffer:
 | 
					            if log_buffer and not silent:
 | 
				
			||||||
                # wrap to console width - padding - '[Aria2c]: '
 | 
					                # wrap to console width - padding - '[Aria2c]: '
 | 
				
			||||||
                log_buffer = "\n          ".join(textwrap.wrap(
 | 
					                log_buffer = "\n          ".join(textwrap.wrap(
 | 
				
			||||||
                    log_buffer.rstrip(),
 | 
					                    log_buffer.rstrip(),
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user