YouTube Upload Node Fails with "Media type 'application/mp4' is not supported" Error

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.

Environment

  • n8n version: 1.122.4 (Community Edition)
  • Database: SQLite (default)
  • Running n8n via: Docker
  • Operating system: Windows/Linux Host, Debian Container

Steps To Reproduce

  1. Create an n8n workflow that prepares an .mp4 video file for upload.
  2. Connect to a YouTube “Upload Video” node.
  3. Execute the workflow.
  4. 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.

  1. Access your container terminal: docker exec -it agents sh

  2. 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

  3. 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

  4. 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 = {
    // …

  5. 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

  6. Restart the n8n application (a full docker-compose down && up -d is required).

Hi @Etherops.net

Same issue here, I reported this weeks ago and opened an issue:

For now you can just ignore the application/mp4 and replace it with video/mp4 manually

1 Like