From 765ac263dbf17442f41715a1cfce13fc61a4b315 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Marqui=CC=81nez=20Ferra=CC=81ndiz?= Date: Sat, 20 Feb 2016 19:55:10 +0100 Subject: [PATCH] [utils] mimetype2ext: return 'm4a' for 'audio/mp4' (fixes #8620) The youtube extractor was using 'mp4' for them, therefore filters like 'bestaudio[ext=m4a]' stopped working (94278f720272c5ad2cd5900f59f8e71f31d46633 broke it). --- youtube_dl/utils.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index 7ce661b09e..a2c6780ca3 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -1836,6 +1836,12 @@ def error_to_compat_str(err): def mimetype2ext(mt): + ext = { + 'audio/mp4': 'm4a', + }.get(mt) + if ext is not None: + return ext + _, _, res = mt.rpartition('/') return {