mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-11-04 08:35:12 +00:00 
			
		
		
		
	Fix -f mp4 behaving differently from youtube-dl
				
					
				
			This commit is contained in:
		@@ -1944,9 +1944,14 @@ class YoutubeDL(object):
 | 
				
			|||||||
                        filter_f = lambda f: _filter_f(f) and (
 | 
					                        filter_f = lambda f: _filter_f(f) and (
 | 
				
			||||||
                            f.get('vcodec') != 'none' or f.get('acodec') != 'none')
 | 
					                            f.get('vcodec') != 'none' or f.get('acodec') != 'none')
 | 
				
			||||||
                    else:
 | 
					                    else:
 | 
				
			||||||
                        filter_f = ((lambda f: f.get('ext') == format_spec)
 | 
					                        if format_spec in ('m4a', 'mp3', 'ogg', 'aac'):  # audio extension
 | 
				
			||||||
                                    if format_spec in ['mp4', 'flv', 'webm', '3gp', 'm4a', 'mp3', 'ogg', 'aac', 'wav']  # extension
 | 
					                            filter_f = lambda f: f.get('ext') == format_spec and f.get('acodec') != 'none'
 | 
				
			||||||
                                    else (lambda f: f.get('format_id') == format_spec))  # id
 | 
					                        elif format_spec in ('mp4', 'flv', 'webm', '3gp'):  # video extension
 | 
				
			||||||
 | 
					                            filter_f = lambda f: f.get('ext') == format_spec and f.get('acodec') != 'none' and f.get('vcodec') != 'none'
 | 
				
			||||||
 | 
					                        elif format_spec in ('mhtml', ):  # storyboards extension
 | 
				
			||||||
 | 
					                            filter_f = lambda f: f.get('ext') == format_spec and f.get('acodec') == 'none' and f.get('vcodec') == 'none'
 | 
				
			||||||
 | 
					                        else:
 | 
				
			||||||
 | 
					                            filter_f = (lambda f: f.get('format_id') == format_spec)  # id
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    def selector_function(ctx):
 | 
					                    def selector_function(ctx):
 | 
				
			||||||
                        formats = list(ctx['formats'])
 | 
					                        formats = list(ctx['formats'])
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user