Overview
The Youtube Download node allows you to download videos from YouTube (or other supported platforms) using the youtube-dl
tool. It fetches the video file and attaches it as binary data to your workflow, along with metadata about the downloaded video. This node is useful for automating video downloads, archiving content, or processing video files within n8n workflows.
Common scenarios:
- Automatically downloading YouTube videos for offline analysis or archiving.
- Integrating video downloads into media processing pipelines.
- Extracting video metadata for cataloging or reporting purposes.
Example use cases:
- Download a YouTube tutorial and send it via email.
- Archive a playlist of videos to cloud storage.
- Analyze video metadata for content management.
Properties
Name | Type | Meaning |
---|---|---|
Url | String | URL of the video to download. Example: https://www.youtube.com/watch?v=... |
Property Name | String | Name of the binary property where the downloaded video file will be stored in the output. |
Output
- json: Contains the original input JSON plus an added
metadata
field with details about the downloaded video (such as id, ext, title, etc.). - binary: Contains the downloaded video file under the property name specified by "Property Name". The binary data can be used in subsequent nodes for further processing or storage.
Example output structure:
{
"json": {
// Original input fields...
"metadata": {
"id": "video_id",
"ext": "mp4",
"title": "Video Title",
// ...other youtube-dl metadata fields
}
},
"binary": {
"data": {
"data": "<Buffer ...>", // The actual video file as binary data
"fileName": "video_id.mp4",
"mimeType": "video/mp4"
}
}
}
- If a different "Property Name" is provided, the binary property key will match that value.
Dependencies
- External Service: Requires internet access to download videos from YouTube or other supported sites.
- npm Package: Uses
youtube-dl-exec
for downloading and extracting metadata. - File System Access: Temporarily writes the downloaded file to
/tmp/
. - n8n Configuration: No special environment variables required, but the node must have permission to write to
/tmp/
.
Troubleshooting
Common issues:
File Not Found Error:
- Error message:
The file "/tmp/<id>.<ext>" could not be found.
- Cause: The expected video file was not created or was deleted before reading.
- Solution: Ensure the node has write permissions to
/tmp/
and sufficient disk space.
- Error message:
Invalid URL or Video Unavailable:
- Error from
youtube-dl
: May throw if the URL is invalid or the video is restricted/unavailable. - Solution: Double-check the video URL and ensure it's accessible.
- Error from
Binary Data Not Attached:
- If the "Property Name" is misspelled or reused incorrectly, the binary data may not appear as expected.
API Rate Limiting or Captcha:
- Some videos may require additional headers or cookies; this node sets common headers, but some edge cases may still fail.