mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-10-31 14:45:14 +00:00 
			
		
		
		
	Add all format filtering operators also to --match-filter
				
					
				
			PR: https://github.com/ytdl-org/youtube-dl/pull/27361 Authored by: max-te
This commit is contained in:
		| @@ -1207,7 +1207,6 @@ ffmpeg version 2.4.4 Copyright (c) 2000-2014 the FFmpeg ...'''), '2.4.4') | ||||
|             '9999 51') | ||||
|  | ||||
|     def test_match_str(self): | ||||
|         self.assertRaises(ValueError, match_str, 'xy>foobar', {}) | ||||
|         self.assertFalse(match_str('xy', {'x': 1200})) | ||||
|         self.assertTrue(match_str('!xy', {'x': 1200})) | ||||
|         self.assertTrue(match_str('x', {'x': 1200})) | ||||
| @@ -1224,6 +1223,17 @@ ffmpeg version 2.4.4 Copyright (c) 2000-2014 the FFmpeg ...'''), '2.4.4') | ||||
|         self.assertTrue(match_str('y=foobar42', {'y': 'foobar42'})) | ||||
|         self.assertFalse(match_str('y!=foobar42', {'y': 'foobar42'})) | ||||
|         self.assertTrue(match_str('y!=foobar2', {'y': 'foobar42'})) | ||||
|         self.assertTrue(match_str('y^=foo', {'y': 'foobar42'})) | ||||
|         self.assertFalse(match_str('y!^=foo', {'y': 'foobar42'})) | ||||
|         self.assertFalse(match_str('y^=bar', {'y': 'foobar42'})) | ||||
|         self.assertTrue(match_str('y!^=bar', {'y': 'foobar42'})) | ||||
|         self.assertRaises(ValueError, match_str, 'x^=42', {'x': 42}) | ||||
|         self.assertTrue(match_str('y*=bar', {'y': 'foobar42'})) | ||||
|         self.assertFalse(match_str('y!*=bar', {'y': 'foobar42'})) | ||||
|         self.assertFalse(match_str('y*=baz', {'y': 'foobar42'})) | ||||
|         self.assertTrue(match_str('y!*=baz', {'y': 'foobar42'})) | ||||
|         self.assertTrue(match_str('y$=42', {'y': 'foobar42'})) | ||||
|         self.assertFalse(match_str('y$=43', {'y': 'foobar42'})) | ||||
|         self.assertFalse(match_str( | ||||
|             'like_count > 100 & dislike_count <? 50 & description', | ||||
|             {'like_count': 90, 'description': 'foo'})) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Max Teegen
					Max Teegen