From: Jaime Marquínez Ferrándiz Date: Sat, 20 Feb 2016 18:55:10 +0000 (+0100) Subject: [utils] mimetype2ext: return 'm4a' for 'audio/mp4' (fixes #8620) X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=commitdiff_plain;h=765ac263dbf17442f41715a1cfce13fc61a4b315;p=youtube-dl.git [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). --- diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index 7ce661b09..a2c6780ca 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 {