mirror of
				https://github.com/devine-dl/devine.git
				synced 2025-11-04 03:44:49 +00:00 
			
		
		
		
	feat(dl): Change --vcodec default to None, use any codec
This commit is contained in:
		
							parent
							
								
									1adc551926
								
							
						
					
					
						commit
						b7b88f66ce
					
				@ -70,8 +70,8 @@ class dl:
 | 
				
			|||||||
    @click.option("-q", "--quality", type=QUALITY_LIST, default=[],
 | 
					    @click.option("-q", "--quality", type=QUALITY_LIST, default=[],
 | 
				
			||||||
                  help="Download Resolution(s), defaults to the best available resolution.")
 | 
					                  help="Download Resolution(s), defaults to the best available resolution.")
 | 
				
			||||||
    @click.option("-v", "--vcodec", type=click.Choice(Video.Codec, case_sensitive=False),
 | 
					    @click.option("-v", "--vcodec", type=click.Choice(Video.Codec, case_sensitive=False),
 | 
				
			||||||
                  default=Video.Codec.AVC,
 | 
					                  default=None,
 | 
				
			||||||
                  help="Video Codec to download, defaults to H.264.")
 | 
					                  help="Video Codec to download, defaults to any codec.")
 | 
				
			||||||
    @click.option("-a", "--acodec", type=click.Choice(Audio.Codec, case_sensitive=False),
 | 
					    @click.option("-a", "--acodec", type=click.Choice(Audio.Codec, case_sensitive=False),
 | 
				
			||||||
                  default=None,
 | 
					                  default=None,
 | 
				
			||||||
                  help="Audio Codec to download, defaults to any codec.")
 | 
					                  help="Audio Codec to download, defaults to any codec.")
 | 
				
			||||||
@ -250,7 +250,7 @@ class dl:
 | 
				
			|||||||
        self,
 | 
					        self,
 | 
				
			||||||
        service: Service,
 | 
					        service: Service,
 | 
				
			||||||
        quality: list[int],
 | 
					        quality: list[int],
 | 
				
			||||||
        vcodec: Video.Codec,
 | 
					        vcodec: Optional[Video.Codec],
 | 
				
			||||||
        acodec: Optional[Audio.Codec],
 | 
					        acodec: Optional[Audio.Codec],
 | 
				
			||||||
        vbitrate: int,
 | 
					        vbitrate: int,
 | 
				
			||||||
        abitrate: int,
 | 
					        abitrate: int,
 | 
				
			||||||
@ -357,6 +357,7 @@ class dl:
 | 
				
			|||||||
            with console.status("Selecting tracks...", spinner="dots"):
 | 
					            with console.status("Selecting tracks...", spinner="dots"):
 | 
				
			||||||
                if isinstance(title, (Movie, Episode)):
 | 
					                if isinstance(title, (Movie, Episode)):
 | 
				
			||||||
                    # filter video tracks
 | 
					                    # filter video tracks
 | 
				
			||||||
 | 
					                    if vcodec:
 | 
				
			||||||
                        title.tracks.select_video(lambda x: x.codec == vcodec)
 | 
					                        title.tracks.select_video(lambda x: x.codec == vcodec)
 | 
				
			||||||
                        if not title.tracks.videos:
 | 
					                        if not title.tracks.videos:
 | 
				
			||||||
                            self.log.error(f"There's no {vcodec.name} Video Track...")
 | 
					                            self.log.error(f"There's no {vcodec.name} Video Track...")
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user