Skip to content

A feature-rich command-line audio/video downloader

[utils] mimetype2ext: return 'm4a' for 'audio/mp4' (fixes #8620)

Jaime Marquínez Ferrándiz765ac263dbf1
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 {