felo-ai 0.2.7 → 0.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,59 +1,59 @@
1
- # Felo YouTube Subtitling Skill
2
-
3
- Fetch YouTube video subtitles/captions using the [Felo YouTube Subtitling API](https://openapi.felo.ai/docs/api-reference/v2/youtube-subtitling.html).
4
-
5
- ## Features
6
-
7
- - Get subtitles by **YouTube video URL** or **video ID** (e.g. `https://youtube.com/watch?v=ID` or `dQw4w9WgXcQ`)
8
- - Optional **language** (e.g. `en`, `zh-CN`)
9
- - Optional **timestamps** (`--with-time`) for each segment
10
- - Same `FELO_API_KEY` as other Felo skills
11
-
12
- ## Quick Start
13
-
14
- ### 1) Configure API key
15
-
16
- At [felo.ai](https://felo.ai) -> Settings -> API Keys, create a key, then:
17
-
18
- ```bash
19
- # Linux/macOS
20
- export FELO_API_KEY="your-api-key-here"
21
- ```
22
-
23
- ```powershell
24
- # Windows PowerShell
25
- $env:FELO_API_KEY="your-api-key-here"
26
- ```
27
-
28
- ### 2) Run
29
-
30
- ```bash
31
- # From repo: script (URL or video ID)
32
- node felo-youtube-subtitling/scripts/run_youtube_subtitling.mjs --video-code "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
33
-
34
- # After npm install -g felo-ai: CLI
35
- felo youtube-subtitling -v "https://youtu.be/dQw4w9WgXcQ"
36
- felo youtube-subtitling -v "dQw4w9WgXcQ"
37
- ```
38
-
39
- ## All parameters
40
-
41
- | Parameter | Option | Example |
42
- |-----------|--------|---------|
43
- | Video URL or ID (required) | `-v`, `--video-code` | `--video-code "https://youtube.com/watch?v=ID"` or `"dQw4w9WgXcQ"` |
44
- | Language | `-l`, `--language` | `--language zh-CN` |
45
- | Include timestamps | `--with-time` | `--with-time` |
46
- | Full JSON response | `-j`, `--json` | `-j` |
47
-
48
- **Examples**
49
-
50
- ```bash
51
- felo youtube-subtitling -v "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
52
- felo youtube-subtitling -v "dQw4w9WgXcQ" --language en --with-time -j
53
- ```
54
-
55
- ## When to use (Agent)
56
-
57
- Trigger keywords: YouTube subtitles, get captions, video transcript, extract subtitles, `/felo-youtube-subtitling`.
58
-
59
- See [SKILL.md](SKILL.md) for full agent instructions and API parameters.
1
+ # Felo YouTube Subtitling Skill
2
+
3
+ Fetch YouTube video subtitles/captions using the [Felo YouTube Subtitling API](https://openapi.felo.ai/docs/api-reference/v2/youtube-subtitling.html).
4
+
5
+ ## Features
6
+
7
+ - Get subtitles by **YouTube video URL** or **video ID** (e.g. `https://youtube.com/watch?v=ID` or `dQw4w9WgXcQ`)
8
+ - Optional **language** (e.g. `en`, `zh-CN`)
9
+ - Optional **timestamps** (`--with-time`) for each segment
10
+ - Same `FELO_API_KEY` as other Felo skills
11
+
12
+ ## Quick Start
13
+
14
+ ### 1) Configure API key
15
+
16
+ At [felo.ai](https://felo.ai) -> Settings -> API Keys, create a key, then:
17
+
18
+ ```bash
19
+ # Linux/macOS
20
+ export FELO_API_KEY="your-api-key-here"
21
+ ```
22
+
23
+ ```powershell
24
+ # Windows PowerShell
25
+ $env:FELO_API_KEY="your-api-key-here"
26
+ ```
27
+
28
+ ### 2) Run
29
+
30
+ ```bash
31
+ # From repo: script (URL or video ID)
32
+ node felo-youtube-subtitling/scripts/run_youtube_subtitling.mjs --video-code "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
33
+
34
+ # After npm install -g felo-ai: CLI
35
+ felo youtube-subtitling -v "https://youtu.be/dQw4w9WgXcQ"
36
+ felo youtube-subtitling -v "dQw4w9WgXcQ"
37
+ ```
38
+
39
+ ## All parameters
40
+
41
+ | Parameter | Option | Example |
42
+ |-----------|--------|---------|
43
+ | Video URL or ID (required) | `-v`, `--video-code` | `--video-code "https://youtube.com/watch?v=ID"` or `"dQw4w9WgXcQ"` |
44
+ | Language | `-l`, `--language` | `--language zh-CN` |
45
+ | Include timestamps | `--with-time` | `--with-time` |
46
+ | Full JSON response | `-j`, `--json` | `-j` |
47
+
48
+ **Examples**
49
+
50
+ ```bash
51
+ felo youtube-subtitling -v "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
52
+ felo youtube-subtitling -v "dQw4w9WgXcQ" --language en --with-time -j
53
+ ```
54
+
55
+ ## When to use (Agent)
56
+
57
+ Trigger keywords: YouTube subtitles, get captions, video transcript, extract subtitles, `/felo-youtube-subtitling`.
58
+
59
+ See [SKILL.md](SKILL.md) for full agent instructions and API parameters.
@@ -1,161 +1,161 @@
1
- ---
2
- name: felo-youtube-subtitling
3
- description: "Fetch YouTube video subtitles/captions using Felo YouTube Subtitling API. Use when users ask to get YouTube subtitles, extract captions from a video, fetch transcript by video ID or URL, or when explicit commands like /felo-youtube-subtitling are used. Supports language and optional timestamps."
4
- ---
5
-
6
- # Felo YouTube Subtitling Skill
7
-
8
- ## When to Use
9
-
10
- Trigger this skill when the user wants to:
11
-
12
- - Get subtitles or captions from a YouTube video
13
- - Extract transcript by video ID or video URL
14
- - Fetch subtitles in a specific language (e.g. en, zh-CN)
15
- - Get subtitles with timestamps for analysis or translation
16
-
17
- Trigger keywords (examples):
18
-
19
- - YouTube subtitles, get captions, video transcript, extract subtitles, YouTube 字幕
20
- - Explicit: `/felo-youtube-subtitling`, "use felo youtube subtitling"
21
-
22
- Do NOT use for:
23
-
24
- - Real-time search (use `felo-search`)
25
- - Web page content (use `felo-web-fetch`)
26
- - Generating slides (use `felo-slides`)
27
-
28
- ## Setup
29
-
30
- ### 1. Get API key
31
-
32
- 1. Visit [felo.ai](https://felo.ai)
33
- 2. Open Settings -> API Keys
34
- 3. Create and copy your API key
35
-
36
- ### 2. Configure environment variable
37
-
38
- Linux/macOS:
39
-
40
- ```bash
41
- export FELO_API_KEY="your-api-key-here"
42
- ```
43
-
44
- Windows PowerShell:
45
-
46
- ```powershell
47
- $env:FELO_API_KEY="your-api-key-here"
48
- ```
49
-
50
- ## How to Execute
51
-
52
- ### Option A: Use the bundled script or packaged CLI
53
-
54
- **Script** (from repo):
55
-
56
- ```bash
57
- node felo-youtube-subtitling/scripts/run_youtube_subtitling.mjs --video-code "dQw4w9WgXcQ" [options]
58
- ```
59
-
60
- **Packaged CLI** (after `npm install -g felo-ai`):
61
-
62
- ```bash
63
- felo youtube-subtitling -v "dQw4w9WgXcQ" [options]
64
- # Short forms: -v (video-code), -l (language), -j (json)
65
- ```
66
-
67
- Options:
68
-
69
- | Option | Default | Description |
70
- |--------|---------|-------------|
71
- | `--video-code` / `-v` | (required) | YouTube **video URL** or **video ID** (e.g. `https://youtube.com/watch?v=ID` or `dQw4w9WgXcQ`) |
72
- | `--language` / `-l` | - | Subtitle language code (e.g. `en`, `zh-CN`) |
73
- | `--with-time` | false | Include start/duration timestamps in each segment |
74
- | `--json` / `-j` | false | Print full API response as JSON |
75
-
76
- You can pass either a **full YouTube link** or the **11-character video ID**:
77
-
78
- - Supported URLs: `https://www.youtube.com/watch?v=ID`, `https://youtu.be/ID`, `https://youtube.com/embed/ID`
79
- - Or plain ID: `dQw4w9WgXcQ`
80
-
81
- Examples:
82
-
83
- ```bash
84
- # With video URL
85
- node felo-youtube-subtitling/scripts/run_youtube_subtitling.mjs --video-code "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
86
- felo youtube-subtitling -v "https://youtu.be/dQw4w9WgXcQ"
87
-
88
- # With video ID
89
- node felo-youtube-subtitling/scripts/run_youtube_subtitling.mjs -v "dQw4w9WgXcQ" --language zh-CN
90
-
91
- # With timestamps
92
- node felo-youtube-subtitling/scripts/run_youtube_subtitling.mjs -v "dQw4w9WgXcQ" --with-time --json
93
- ```
94
-
95
- ### Option B: Call API with curl
96
-
97
- ```bash
98
- curl -X GET "https://openapi.felo.ai/v2/youtube/subtitling?video_code=dQw4w9WgXcQ" \
99
- -H "Authorization: Bearer $FELO_API_KEY"
100
- ```
101
-
102
- ## API Reference (summary)
103
-
104
- - **Endpoint**: `GET /v2/youtube/subtitling`
105
- - **Base URL**: `https://openapi.felo.ai`. Override with `FELO_API_BASE` env if needed.
106
- - **Auth**: `Authorization: Bearer YOUR_API_KEY`
107
-
108
- ### Query parameters
109
-
110
- | Parameter | Type | Required | Default | Description |
111
- |-----------|------|----------|---------|-------------|
112
- | video_code | string | Yes | - | YouTube video ID (e.g. dQw4w9WgXcQ) |
113
- | language | string | No | - | Language code (e.g. en, zh-CN) |
114
- | with_time | boolean | No | false | Include start/duration per segment |
115
-
116
- ### Response (200)
117
-
118
- ```json
119
- {
120
- "code": 0,
121
- "message": "success",
122
- "data": {
123
- "title": "Video title",
124
- "contents": [
125
- { "start": 0.32, "duration": 14.26, "text": "Subtitle text" }
126
- ]
127
- }
128
- }
129
- ```
130
-
131
- With `with_time=false`, `start`/`duration` may be absent or zero. `contents[].text` is always present.
132
-
133
- ### Error codes
134
-
135
- | HTTP | Code | Description |
136
- |------|------|-------------|
137
- | 400 | - | Parameter validation failed (e.g. missing video_code) |
138
- | 401 | INVALID_API_KEY | API key invalid or revoked |
139
- | 500/502 | YOUTUBE_SUBTITLING_FAILED | Service error or subtitles unavailable for video |
140
-
141
- ## Output Format
142
-
143
- - Without `--json`: print title and then each segment's text (one per line or concatenated). If `--with-time`, output includes timestamps.
144
- - With `--json`: print full API response.
145
-
146
- On failure (no subtitles, API error): stderr message and exit 1. Example:
147
-
148
- ```
149
- YouTube subtitling failed for video dQw4w9WgXcQ: YOUTUBE_SUBTITLING_FAILED
150
- ```
151
-
152
- ## Important Notes
153
-
154
- - Not all videos have subtitles; the API may return an error for some videos.
155
- - Language code must match a subtitle track available for the video.
156
- - Same `FELO_API_KEY` as other Felo skills.
157
-
158
- ## References
159
-
160
- - [Felo YouTube Subtitling API](https://openapi.felo.ai/docs/api-reference/v2/youtube-subtitling.html)
161
- - [Felo Open Platform](https://openapi.felo.ai/docs/)
1
+ ---
2
+ name: felo-youtube-subtitling
3
+ description: "Fetch YouTube video subtitles/captions using Felo YouTube Subtitling API. Use when users ask to get YouTube subtitles, extract captions from a video, fetch transcript by video ID or URL, or when explicit commands like /felo-youtube-subtitling are used. Supports language and optional timestamps."
4
+ ---
5
+
6
+ # Felo YouTube Subtitling Skill
7
+
8
+ ## When to Use
9
+
10
+ Trigger this skill when the user wants to:
11
+
12
+ - Get subtitles or captions from a YouTube video
13
+ - Extract transcript by video ID or video URL
14
+ - Fetch subtitles in a specific language (e.g. en, zh-CN)
15
+ - Get subtitles with timestamps for analysis or translation
16
+
17
+ Trigger keywords (examples):
18
+
19
+ - YouTube subtitles, get captions, video transcript, extract subtitles, YouTube 字幕
20
+ - Explicit: `/felo-youtube-subtitling`, "use felo youtube subtitling"
21
+
22
+ Do NOT use for:
23
+
24
+ - Real-time search (use `felo-search`)
25
+ - Web page content (use `felo-web-fetch`)
26
+ - Generating slides (use `felo-slides`)
27
+
28
+ ## Setup
29
+
30
+ ### 1. Get API key
31
+
32
+ 1. Visit [felo.ai](https://felo.ai)
33
+ 2. Open Settings -> API Keys
34
+ 3. Create and copy your API key
35
+
36
+ ### 2. Configure environment variable
37
+
38
+ Linux/macOS:
39
+
40
+ ```bash
41
+ export FELO_API_KEY="your-api-key-here"
42
+ ```
43
+
44
+ Windows PowerShell:
45
+
46
+ ```powershell
47
+ $env:FELO_API_KEY="your-api-key-here"
48
+ ```
49
+
50
+ ## How to Execute
51
+
52
+ ### Option A: Use the bundled script or packaged CLI
53
+
54
+ **Script** (from repo):
55
+
56
+ ```bash
57
+ node felo-youtube-subtitling/scripts/run_youtube_subtitling.mjs --video-code "dQw4w9WgXcQ" [options]
58
+ ```
59
+
60
+ **Packaged CLI** (after `npm install -g felo-ai`):
61
+
62
+ ```bash
63
+ felo youtube-subtitling -v "dQw4w9WgXcQ" [options]
64
+ # Short forms: -v (video-code), -l (language), -j (json)
65
+ ```
66
+
67
+ Options:
68
+
69
+ | Option | Default | Description |
70
+ |--------|---------|-------------|
71
+ | `--video-code` / `-v` | (required) | YouTube **video URL** or **video ID** (e.g. `https://youtube.com/watch?v=ID` or `dQw4w9WgXcQ`) |
72
+ | `--language` / `-l` | - | Subtitle language code (e.g. `en`, `zh-CN`) |
73
+ | `--with-time` | false | Include start/duration timestamps in each segment |
74
+ | `--json` / `-j` | false | Print full API response as JSON |
75
+
76
+ You can pass either a **full YouTube link** or the **11-character video ID**:
77
+
78
+ - Supported URLs: `https://www.youtube.com/watch?v=ID`, `https://youtu.be/ID`, `https://youtube.com/embed/ID`
79
+ - Or plain ID: `dQw4w9WgXcQ`
80
+
81
+ Examples:
82
+
83
+ ```bash
84
+ # With video URL
85
+ node felo-youtube-subtitling/scripts/run_youtube_subtitling.mjs --video-code "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
86
+ felo youtube-subtitling -v "https://youtu.be/dQw4w9WgXcQ"
87
+
88
+ # With video ID
89
+ node felo-youtube-subtitling/scripts/run_youtube_subtitling.mjs -v "dQw4w9WgXcQ" --language zh-CN
90
+
91
+ # With timestamps
92
+ node felo-youtube-subtitling/scripts/run_youtube_subtitling.mjs -v "dQw4w9WgXcQ" --with-time --json
93
+ ```
94
+
95
+ ### Option B: Call API with curl
96
+
97
+ ```bash
98
+ curl -X GET "https://openapi.felo.ai/v2/youtube/subtitling?video_code=dQw4w9WgXcQ" \
99
+ -H "Authorization: Bearer $FELO_API_KEY"
100
+ ```
101
+
102
+ ## API Reference (summary)
103
+
104
+ - **Endpoint**: `GET /v2/youtube/subtitling`
105
+ - **Base URL**: `https://openapi.felo.ai`. Override with `FELO_API_BASE` env if needed.
106
+ - **Auth**: `Authorization: Bearer YOUR_API_KEY`
107
+
108
+ ### Query parameters
109
+
110
+ | Parameter | Type | Required | Default | Description |
111
+ |-----------|------|----------|---------|-------------|
112
+ | video_code | string | Yes | - | YouTube video ID (e.g. dQw4w9WgXcQ) |
113
+ | language | string | No | - | Language code (e.g. en, zh-CN) |
114
+ | with_time | boolean | No | false | Include start/duration per segment |
115
+
116
+ ### Response (200)
117
+
118
+ ```json
119
+ {
120
+ "code": 0,
121
+ "message": "success",
122
+ "data": {
123
+ "title": "Video title",
124
+ "contents": [
125
+ { "start": 0.32, "duration": 14.26, "text": "Subtitle text" }
126
+ ]
127
+ }
128
+ }
129
+ ```
130
+
131
+ With `with_time=false`, `start`/`duration` may be absent or zero. `contents[].text` is always present.
132
+
133
+ ### Error codes
134
+
135
+ | HTTP | Code | Description |
136
+ |------|------|-------------|
137
+ | 400 | - | Parameter validation failed (e.g. missing video_code) |
138
+ | 401 | INVALID_API_KEY | API key invalid or revoked |
139
+ | 500/502 | YOUTUBE_SUBTITLING_FAILED | Service error or subtitles unavailable for video |
140
+
141
+ ## Output Format
142
+
143
+ - Without `--json`: print title and then each segment's text (one per line or concatenated). If `--with-time`, output includes timestamps.
144
+ - With `--json`: print full API response.
145
+
146
+ On failure (no subtitles, API error): stderr message and exit 1. Example:
147
+
148
+ ```
149
+ YouTube subtitling failed for video dQw4w9WgXcQ: YOUTUBE_SUBTITLING_FAILED
150
+ ```
151
+
152
+ ## Important Notes
153
+
154
+ - Not all videos have subtitles; the API may return an error for some videos.
155
+ - Language code must match a subtitle track available for the video.
156
+ - Same `FELO_API_KEY` as other Felo skills.
157
+
158
+ ## References
159
+
160
+ - [Felo YouTube Subtitling API](https://openapi.felo.ai/docs/api-reference/v2/youtube-subtitling.html)
161
+ - [Felo Open Platform](https://openapi.felo.ai/docs/)