Bug Report: YouTube Upload Node Fails with “Media type ‘application/mp4’ is not supported” Error
Summary
The n8n YouTube node consistently fails when uploading standard .mp4 video files. It returns a HTTP 400 Bad Request error because it sends the incorrect, generic MIME type application/mp4, whereas YouTube’s API strictly requires video/mp4.
This bug persists despite all attempts to manually override the MIME type using standard n8n configuration nodes (“Set”, “Read Files Options”) or environment variables (N8N_BINARY_DATA_MODE=filesystem). The issue appears to be a hardcoded default within the node’s execution logic.
Create an n8n workflow that prepares an .mp4 video file for upload.
Connect to a YouTube “Upload Video” node.
Execute the workflow.
The workflow fails with: Media type ‘application/mp4’ is not supported.
Expected Behavior
The YouTube node should prioritize the correct video/mp4 MIME type (either via detection or user override) and successfully upload the video.
Actual Behavior
The node ignores all configuration overrides and sends application/mp4 in the X-Upload-Content-Type header, causing API rejection.
{
“error”: {
“code”: 400,
“message”: "Media type ‘application/mp4’ is not supported. ",
“errors”: [
{
“message”: "Media type ‘application/mp4’ is not supported. ",
“domain”: “global”,
“reason”: “badRequest”
}
],
“status”: “INVALID_ARGUMENT”
}
}
Confirmed Workaround: Direct Source Code Patch
Standard forum fixes involving environment variables (N8N_BINARY_DATA_MODE=filesystem) were attempted but did not resolve this specific issue.
The only verified solution for n8n version 1.122.4 is to manually patch the source code directly within the Docker container.
Note: Changes made this way are not permanent and will be lost if the container is rebuilt or replaced.
Access your container terminal: docker exec -it agents sh
Locate the target file. The exact path for version 1.122.4 is: /usr/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Google/YouTube/YouTube.node.js
Move the file to a shared location for editing (e.g., your /workflows volume mount) to edit it using your local machine’s editor: mv /usr/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Google/YouTube/YouTube.node.js /workflows/YouTube.node.js.patch
Edit the file locally using your Windows editor. Add the override line using spaces for indentation (no tabs):
// … (after the if/else block that sets mimeType)
mimeType = binaryData.mimeType;
}
// PATCH: Force the correct MIME type for YouTube
mimeType = ‘video/mp4’;
const payload = {
// …
Move the patched file back to its original location within the container: mv /workflows/YouTube.node.js.patch /usr/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Google/YouTube/YouTube.node.js
Restart the n8n application (a full docker-compose down && up -d is required).