n8n-nodes-kih-youtube-transcript
Version:
n8n community node to fetch YouTube video transcripts using KI-H API
161 lines (115 loc) • 3.03 kB
Markdown
This is an n8n community node that allows you to fetch transcripts from YouTube videos using the KI-H API.
The easiest way to install this node is through the n8n UI:
1. Go to **Settings** > **Community Nodes**
2. Click **Install**
3. Enter `n8n-nodes-kih-youtube-transcript`
4. Click **Install**
```bash
cd ~/.n8n
npm install n8n-nodes-kih-youtube-transcript
```
Then restart n8n.
1. Navigate to your n8n nodes directory:
```bash
cd ~/.n8n/nodes
```
2. Clone or download this repository:
```bash
git clone https://github.com/ki-h/n8n-nodes-kih-youtube-transcript
```
3. Install dependencies:
```bash
cd n8n-nodes-kih-youtube-transcript
npm install
```
4. Build the node:
```bash
npm run build
```
5. Restart n8n
The KIH YouTube Transcript node provides the following functionality:
Fetches the transcript/subtitles from a YouTube video.
- **YouTube URL**: The URL of the YouTube video (supports various formats)
- `https://www.youtube.com/watch?v=VIDEO_ID`
- `https://youtu.be/VIDEO_ID`
- `https://www.youtube.com/embed/VIDEO_ID`
#### Options
- **Output Format**:
- **Full Data**: Returns complete transcript with timestamps and metadata
- **Text Only**: Returns only the combined text without timestamps
- **Formatted**: Returns formatted text with timestamps
- **Language**: Language code for the transcript (e.g., 'en', 'de', 'fr')
#### Output
Depending on the selected output format:
**Full Data** format:
```json
{
"transcript": [
{
"text": "Hello world",
"start": 0,
"duration": 2.5
}
],
"fullText": "Hello world ...",
"videoId": "VIDEO_ID",
"url": "https://...",
"totalItems": 42
}
```
**Text Only** format:
```json
{
"text": "Hello world ...",
"videoId": "VIDEO_ID",
"url": "https://..."
}
```
**Formatted** format:
```json
{
"formattedText": "[0:00] Hello world\n[0:05] ...",
"videoId": "VIDEO_ID",
"url": "https://..."
}
```
The node will handle common errors such as:
- Invalid YouTube URL format
- Video not found
- Transcript not available for the video
- Network errors
When "Continue On Fail" is enabled, errors will be returned in the output instead of stopping the workflow.
```bash
npm install
npm run build
npm run dev
npm run lint
npm run clean
```
[](LICENSE)
This node uses the KI-H YouTube Transcript API service hosted at `https://api.ki-h.net/api/youtube-transcript`.
For issues and feature requests, please use the [GitHub issues](https://github.com/ki-h/n8n-nodes-kih-youtube-transcript/issues) page.
To publish this package to npm:
```bash
npm login
npm publish
```