mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-10-31 06:35:12 +00:00 
			
		
		
		
	[YoutubeDL] format spec: correctly handle dashes and other unused operators
'mp4-baseline-16x9' must be handled as a single string, but the '-' was treated as an operator.
This commit is contained in:
		| @@ -105,6 +105,7 @@ class TestFormatSelection(unittest.TestCase): | ||||
|     def test_format_selection(self): | ||||
|         formats = [ | ||||
|             {'format_id': '35', 'ext': 'mp4', 'preference': 1, 'url': TEST_URL}, | ||||
|             {'format_id': 'example-with-dashes', 'ext': 'webm', 'preference': 1, 'url': TEST_URL}, | ||||
|             {'format_id': '45', 'ext': 'webm', 'preference': 2, 'url': TEST_URL}, | ||||
|             {'format_id': '47', 'ext': 'webm', 'preference': 3, 'url': TEST_URL}, | ||||
|             {'format_id': '2', 'ext': 'flv', 'preference': 4, 'url': TEST_URL}, | ||||
| @@ -136,6 +137,11 @@ class TestFormatSelection(unittest.TestCase): | ||||
|         downloaded = ydl.downloaded_info_dicts[0] | ||||
|         self.assertEqual(downloaded['format_id'], '35') | ||||
|  | ||||
|         ydl = YDL({'format': 'example-with-dashes'}) | ||||
|         ydl.process_ie_result(info_dict.copy()) | ||||
|         downloaded = ydl.downloaded_info_dicts[0] | ||||
|         self.assertEqual(downloaded['format_id'], 'example-with-dashes') | ||||
|  | ||||
|     def test_format_selection_audio(self): | ||||
|         formats = [ | ||||
|             {'format_id': 'audio-low', 'ext': 'webm', 'preference': 1, 'vcodec': 'none', 'url': TEST_URL}, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Jaime Marquínez Ferrándiz
					Jaime Marquínez Ferrándiz