[utils] Recognize wav mimetype (closes #26463)
authorSergey M․ <dstftw@gmail.com>
Sun, 6 Sep 2020 04:19:53 +0000 (11:19 +0700)
committerSergey M․ <dstftw@gmail.com>
Sun, 6 Sep 2020 04:19:53 +0000 (11:19 +0700)
test/test_utils.py
youtube_dl/utils.py

index 0896f41506aa6d6cdb45b1c601203d6e717946d6..962fd8d753ffe5d2ffec4784112623fd870bf213 100644 (file)
@@ -803,6 +803,8 @@ class TestUtil(unittest.TestCase):
         self.assertEqual(mimetype2ext('text/vtt'), 'vtt')
         self.assertEqual(mimetype2ext('text/vtt;charset=utf-8'), 'vtt')
         self.assertEqual(mimetype2ext('text/html; charset=utf-8'), 'html')
+        self.assertEqual(mimetype2ext('audio/x-wav'), 'wav')
+        self.assertEqual(mimetype2ext('audio/x-wav;codec=pcm'), 'wav')
 
     def test_month_by_name(self):
         self.assertEqual(month_by_name(None), None)
index d1eca3760a66e89fbfc1673e70a2d526035776cf..01d9c0362141588cb6242f55e00a8025f8743ade 100644 (file)
@@ -4198,6 +4198,7 @@ def mimetype2ext(mt):
         'vnd.ms-sstr+xml': 'ism',
         'quicktime': 'mov',
         'mp2t': 'ts',
+        'x-wav': 'wav',
     }.get(res, res)