n8n-nodes-wayne-ytdlp 0.1.0
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.
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/nodes/YtDlp/YtDlp.node.d.ts +6 -0
- package/dist/nodes/YtDlp/YtDlp.node.d.ts.map +1 -0
- package/dist/nodes/YtDlp/YtDlp.node.js +600 -0
- package/dist/nodes/YtDlp/YtDlp.node.js.map +1 -0
- package/dist/nodes/YtDlp/yt-dlp.svg +11 -0
- package/package.json +56 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.YtDlp = void 0;
|
|
4
|
+
var YtDlp_node_1 = require("./nodes/YtDlp/YtDlp.node");
|
|
5
|
+
Object.defineProperty(exports, "YtDlp", { enumerable: true, get: function () { return YtDlp_node_1.YtDlp; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,uDAAiD;AAAxC,mGAAA,KAAK,OAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
export declare class YtDlp implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=YtDlp.node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"YtDlp.node.d.ts","sourceRoot":"","sources":["../../../nodes/YtDlp/YtDlp.node.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,oBAAoB,EAIvB,MAAM,cAAc,CAAC;AA8EtB,qBAAa,KAAM,YAAW,SAAS;IACnC,WAAW,EAAE,oBAAoB,CAuO/B;IAMI,OAAO,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;CAsN1E"}
|
|
@@ -0,0 +1,600 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.YtDlp = void 0;
|
|
37
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
38
|
+
const child_process_1 = require("child_process");
|
|
39
|
+
const util_1 = require("util");
|
|
40
|
+
const fs = __importStar(require("fs"));
|
|
41
|
+
const path = __importStar(require("path"));
|
|
42
|
+
const os = __importStar(require("os"));
|
|
43
|
+
const execFileAsync = (0, util_1.promisify)(child_process_1.execFile);
|
|
44
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
45
|
+
// Helpers
|
|
46
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
47
|
+
/**
|
|
48
|
+
* Resolve the yt-dlp executable path.
|
|
49
|
+
* Searches common locations in Docker/Linux environments first.
|
|
50
|
+
*/
|
|
51
|
+
function resolveYtDlpBin(customPath) {
|
|
52
|
+
if (customPath && customPath.trim()) {
|
|
53
|
+
return customPath.trim();
|
|
54
|
+
}
|
|
55
|
+
const candidates = ['yt-dlp', '/usr/local/bin/yt-dlp', '/usr/bin/yt-dlp'];
|
|
56
|
+
// On Linux/Docker these paths all exist; just return the first and let execFile fail naturally
|
|
57
|
+
return candidates[0];
|
|
58
|
+
}
|
|
59
|
+
/** Create a temp directory and return its path */
|
|
60
|
+
function makeTempDir() {
|
|
61
|
+
return fs.mkdtempSync(path.join(os.tmpdir(), 'n8n-yt-dlp-'));
|
|
62
|
+
}
|
|
63
|
+
/** Recursively delete a directory */
|
|
64
|
+
function cleanupDir(dir) {
|
|
65
|
+
try {
|
|
66
|
+
fs.rmSync(dir, { recursive: true, force: true });
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
// Ignore cleanup errors
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/** Find first file in directory matching extension list */
|
|
73
|
+
function findOutputFile(dir, exts) {
|
|
74
|
+
const items = fs.readdirSync(dir);
|
|
75
|
+
for (const ext of exts) {
|
|
76
|
+
const match = items.find((f) => f.endsWith(`.${ext}`));
|
|
77
|
+
if (match)
|
|
78
|
+
return path.join(dir, match);
|
|
79
|
+
}
|
|
80
|
+
return items.length > 0 ? path.join(dir, items[0]) : null;
|
|
81
|
+
}
|
|
82
|
+
/** MIME type by extension */
|
|
83
|
+
function mimeForExt(ext) {
|
|
84
|
+
var _a;
|
|
85
|
+
const map = {
|
|
86
|
+
mp4: 'video/mp4',
|
|
87
|
+
mkv: 'video/x-matroska',
|
|
88
|
+
webm: 'video/webm',
|
|
89
|
+
avi: 'video/x-msvideo',
|
|
90
|
+
mov: 'video/quicktime',
|
|
91
|
+
flv: 'video/x-flv',
|
|
92
|
+
mp3: 'audio/mpeg',
|
|
93
|
+
m4a: 'audio/mp4',
|
|
94
|
+
aac: 'audio/aac',
|
|
95
|
+
opus: 'audio/opus',
|
|
96
|
+
flac: 'audio/flac',
|
|
97
|
+
wav: 'audio/wav',
|
|
98
|
+
ogg: 'audio/ogg',
|
|
99
|
+
vtt: 'text/vtt',
|
|
100
|
+
srt: 'text/plain',
|
|
101
|
+
ass: 'text/plain',
|
|
102
|
+
json: 'application/json',
|
|
103
|
+
};
|
|
104
|
+
return (_a = map[ext.toLowerCase()]) !== null && _a !== void 0 ? _a : 'application/octet-stream';
|
|
105
|
+
}
|
|
106
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
107
|
+
// Node definition
|
|
108
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
109
|
+
class YtDlp {
|
|
110
|
+
constructor() {
|
|
111
|
+
this.description = {
|
|
112
|
+
displayName: 'yt-dlp',
|
|
113
|
+
name: 'ytDlp',
|
|
114
|
+
icon: 'file:yt-dlp.svg',
|
|
115
|
+
group: ['transform'],
|
|
116
|
+
version: 1,
|
|
117
|
+
subtitle: '={{$parameter["operation"]}}',
|
|
118
|
+
description: 'Download videos & audio from 1000+ sites using yt-dlp',
|
|
119
|
+
defaults: {
|
|
120
|
+
name: 'yt-dlp',
|
|
121
|
+
},
|
|
122
|
+
inputs: ['main'],
|
|
123
|
+
outputs: ['main'],
|
|
124
|
+
properties: [
|
|
125
|
+
// ── yt-dlp Binary Path ──────────────────────────────────────────
|
|
126
|
+
{
|
|
127
|
+
displayName: 'yt-dlp 可执行文件路径',
|
|
128
|
+
name: 'ytDlpPath',
|
|
129
|
+
type: 'string',
|
|
130
|
+
default: '',
|
|
131
|
+
placeholder: '/usr/local/bin/yt-dlp',
|
|
132
|
+
description: '留空则自动查找系统 PATH 中的 yt-dlp。Docker 环境中通常为 /usr/local/bin/yt-dlp',
|
|
133
|
+
},
|
|
134
|
+
// ── Operation ──────────────────────────────────────────────────
|
|
135
|
+
{
|
|
136
|
+
displayName: '操作 Operation',
|
|
137
|
+
name: 'operation',
|
|
138
|
+
type: 'options',
|
|
139
|
+
noDataExpression: true,
|
|
140
|
+
options: [
|
|
141
|
+
{
|
|
142
|
+
name: '获取视频信息 (Get Info)',
|
|
143
|
+
value: 'getInfo',
|
|
144
|
+
description: '提取视频元数据,不下载文件',
|
|
145
|
+
action: 'Get video metadata without downloading',
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
name: '下载视频 (Download Video)',
|
|
149
|
+
value: 'downloadVideo',
|
|
150
|
+
description: '下载视频文件并以二进制数据输出',
|
|
151
|
+
action: 'Download video file as binary data',
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
name: '提取音频 (Extract Audio)',
|
|
155
|
+
value: 'extractAudio',
|
|
156
|
+
description: '下载并转换为音频文件(需要 ffmpeg)',
|
|
157
|
+
action: 'Download and convert to audio file',
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
name: '下载字幕 (Get Subtitles)',
|
|
161
|
+
value: 'getSubtitles',
|
|
162
|
+
description: '下载字幕文件并输出文本内容',
|
|
163
|
+
action: 'Download subtitle files',
|
|
164
|
+
},
|
|
165
|
+
],
|
|
166
|
+
default: 'getInfo',
|
|
167
|
+
},
|
|
168
|
+
// ── Common: URL ────────────────────────────────────────────────
|
|
169
|
+
{
|
|
170
|
+
displayName: '视频 URL',
|
|
171
|
+
name: 'url',
|
|
172
|
+
type: 'string',
|
|
173
|
+
default: '',
|
|
174
|
+
required: true,
|
|
175
|
+
placeholder: 'https://www.youtube.com/watch?v=...',
|
|
176
|
+
description: '要处理的视频 URL,支持 YouTube、Bilibili、TikTok 等 1000+ 网站',
|
|
177
|
+
},
|
|
178
|
+
// ── Download Video: format ─────────────────────────────────────
|
|
179
|
+
{
|
|
180
|
+
displayName: '视频格式选择 Format',
|
|
181
|
+
name: 'videoFormat',
|
|
182
|
+
type: 'options',
|
|
183
|
+
displayOptions: { show: { operation: ['downloadVideo'] } },
|
|
184
|
+
options: [
|
|
185
|
+
{ name: '最佳质量 (Best)', value: 'bestvideo+bestaudio/best' },
|
|
186
|
+
{ name: '最佳 MP4', value: 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]' },
|
|
187
|
+
{ name: '1080p', value: 'bestvideo[height<=1080]+bestaudio/best[height<=1080]' },
|
|
188
|
+
{ name: '720p', value: 'bestvideo[height<=720]+bestaudio/best[height<=720]' },
|
|
189
|
+
{ name: '480p', value: 'bestvideo[height<=480]+bestaudio/best[height<=480]' },
|
|
190
|
+
{ name: '360p', value: 'bestvideo[height<=360]+bestaudio/best[height<=360]' },
|
|
191
|
+
{ name: '仅音频流 (Audio Only)', value: 'bestaudio' },
|
|
192
|
+
{ name: '自定义格式字符串', value: 'custom' },
|
|
193
|
+
],
|
|
194
|
+
default: 'bestvideo+bestaudio/best',
|
|
195
|
+
description: '选择下载的视频格式',
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
displayName: '自定义格式字符串',
|
|
199
|
+
name: 'customFormat',
|
|
200
|
+
type: 'string',
|
|
201
|
+
default: '',
|
|
202
|
+
placeholder: 'bestvideo[ext=mp4]+bestaudio[ext=m4a]',
|
|
203
|
+
displayOptions: {
|
|
204
|
+
show: { operation: ['downloadVideo'], videoFormat: ['custom'] },
|
|
205
|
+
},
|
|
206
|
+
description: 'yt-dlp -f 参数的格式字符串',
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
displayName: '合并输出格式',
|
|
210
|
+
name: 'mergeOutputFormat',
|
|
211
|
+
type: 'options',
|
|
212
|
+
displayOptions: { show: { operation: ['downloadVideo'] } },
|
|
213
|
+
options: [
|
|
214
|
+
{ name: 'MKV', value: 'mkv' },
|
|
215
|
+
{ name: 'MP4', value: 'mp4' },
|
|
216
|
+
{ name: 'WEBM', value: 'webm' },
|
|
217
|
+
{ name: '不指定(自动)', value: '' },
|
|
218
|
+
],
|
|
219
|
+
default: 'mp4',
|
|
220
|
+
description: '当需要合并视频和音频流时,指定输出容器格式(需要 ffmpeg)',
|
|
221
|
+
},
|
|
222
|
+
// ── Extract Audio: format ──────────────────────────────────────
|
|
223
|
+
{
|
|
224
|
+
displayName: '音频格式 Audio Format',
|
|
225
|
+
name: 'audioFormat',
|
|
226
|
+
type: 'options',
|
|
227
|
+
displayOptions: { show: { operation: ['extractAudio'] } },
|
|
228
|
+
options: [
|
|
229
|
+
{ name: 'MP3', value: 'mp3' },
|
|
230
|
+
{ name: 'AAC', value: 'aac' },
|
|
231
|
+
{ name: 'M4A', value: 'm4a' },
|
|
232
|
+
{ name: 'FLAC', value: 'flac' },
|
|
233
|
+
{ name: 'WAV', value: 'wav' },
|
|
234
|
+
{ name: 'OPUS', value: 'opus' },
|
|
235
|
+
{ name: 'OGG', value: 'vorbis' },
|
|
236
|
+
{ name: '最佳(不转换)', value: 'best' },
|
|
237
|
+
],
|
|
238
|
+
default: 'mp3',
|
|
239
|
+
description: '提取音频后转换的格式(需要 ffmpeg)',
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
displayName: '音频质量 Audio Quality',
|
|
243
|
+
name: 'audioQuality',
|
|
244
|
+
type: 'options',
|
|
245
|
+
displayOptions: { show: { operation: ['extractAudio'] } },
|
|
246
|
+
options: [
|
|
247
|
+
{ name: '最佳 (0)', value: '0' },
|
|
248
|
+
{ name: '较好 (2)', value: '2' },
|
|
249
|
+
{ name: '标准 (5)', value: '5' },
|
|
250
|
+
{ name: '较小文件 (7)', value: '7' },
|
|
251
|
+
{ name: '最小 (9)', value: '9' },
|
|
252
|
+
],
|
|
253
|
+
default: '2',
|
|
254
|
+
description: 'VBR 音频质量,0 为最好,9 为最差',
|
|
255
|
+
},
|
|
256
|
+
// ── Subtitles ──────────────────────────────────────────────────
|
|
257
|
+
{
|
|
258
|
+
displayName: '字幕语言',
|
|
259
|
+
name: 'subtitleLang',
|
|
260
|
+
type: 'string',
|
|
261
|
+
default: 'zh-Hans,zh,en',
|
|
262
|
+
displayOptions: { show: { operation: ['getSubtitles'] } },
|
|
263
|
+
description: '字幕语言代码,多个用逗号分隔,如 zh-Hans,zh,en。使用 all 获取所有语言',
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
displayName: '包含自动生成字幕',
|
|
267
|
+
name: 'includeAutoSub',
|
|
268
|
+
type: 'boolean',
|
|
269
|
+
default: true,
|
|
270
|
+
displayOptions: { show: { operation: ['getSubtitles'] } },
|
|
271
|
+
description: '是否包含 YouTube 等平台自动生成的字幕',
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
displayName: '字幕格式',
|
|
275
|
+
name: 'subtitleFormat',
|
|
276
|
+
type: 'options',
|
|
277
|
+
displayOptions: { show: { operation: ['getSubtitles'] } },
|
|
278
|
+
options: [
|
|
279
|
+
{ name: 'VTT', value: 'vtt' },
|
|
280
|
+
{ name: 'SRT', value: 'srt' },
|
|
281
|
+
{ name: 'ASS', value: 'ass' },
|
|
282
|
+
{ name: 'JSON3', value: 'json3' },
|
|
283
|
+
],
|
|
284
|
+
default: 'vtt',
|
|
285
|
+
description: '字幕文件格式',
|
|
286
|
+
},
|
|
287
|
+
// ── Common: Advanced Options ───────────────────────────────────
|
|
288
|
+
{
|
|
289
|
+
displayName: '附加参数 Extra Args',
|
|
290
|
+
name: 'extraArgs',
|
|
291
|
+
type: 'string',
|
|
292
|
+
default: '',
|
|
293
|
+
placeholder: '--cookies-from-browser chrome --geo-bypass',
|
|
294
|
+
description: '传递给 yt-dlp 的额外命令行参数,多个参数以空格分隔',
|
|
295
|
+
typeOptions: { rows: 2 },
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
displayName: 'Cookies 文件路径',
|
|
299
|
+
name: 'cookiesFile',
|
|
300
|
+
type: 'string',
|
|
301
|
+
default: '',
|
|
302
|
+
placeholder: '/data/cookies.txt',
|
|
303
|
+
description: '包含 cookies 的 Netscape 格式文件路径(用于需要登录的视频)',
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
displayName: '代理设置 Proxy',
|
|
307
|
+
name: 'proxy',
|
|
308
|
+
type: 'string',
|
|
309
|
+
default: '',
|
|
310
|
+
placeholder: 'http://proxy:port 或 socks5://proxy:port',
|
|
311
|
+
description: '代理服务器地址,留空则不使用代理',
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
displayName: '播放列表处理',
|
|
315
|
+
name: 'playlistHandling',
|
|
316
|
+
type: 'options',
|
|
317
|
+
displayOptions: {
|
|
318
|
+
show: { operation: ['downloadVideo', 'extractAudio', 'getInfo'] },
|
|
319
|
+
},
|
|
320
|
+
options: [
|
|
321
|
+
{ name: '仅处理单个视频(忽略播放列表)', value: 'single' },
|
|
322
|
+
{ name: '处理整个播放列表', value: 'playlist' },
|
|
323
|
+
],
|
|
324
|
+
default: 'single',
|
|
325
|
+
description: '当 URL 指向播放列表时的处理方式',
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
displayName: '超时时间(秒)',
|
|
329
|
+
name: 'timeout',
|
|
330
|
+
type: 'number',
|
|
331
|
+
default: 300,
|
|
332
|
+
description: '等待 yt-dlp 完成的最大秒数',
|
|
333
|
+
},
|
|
334
|
+
],
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
338
|
+
// execute()
|
|
339
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
340
|
+
async execute() {
|
|
341
|
+
const items = this.getInputData();
|
|
342
|
+
const returnData = [];
|
|
343
|
+
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
|
|
344
|
+
const operation = this.getNodeParameter('operation', itemIndex);
|
|
345
|
+
const url = this.getNodeParameter('url', itemIndex);
|
|
346
|
+
const ytDlpPath = this.getNodeParameter('ytDlpPath', itemIndex);
|
|
347
|
+
const extraArgs = this.getNodeParameter('extraArgs', itemIndex).trim();
|
|
348
|
+
const cookiesFile = this.getNodeParameter('cookiesFile', itemIndex).trim();
|
|
349
|
+
const proxy = this.getNodeParameter('proxy', itemIndex).trim();
|
|
350
|
+
const timeout = this.getNodeParameter('timeout', itemIndex) * 1000;
|
|
351
|
+
const bin = resolveYtDlpBin(ytDlpPath);
|
|
352
|
+
try {
|
|
353
|
+
if (operation === 'getInfo') {
|
|
354
|
+
// ── Get Info ──────────────────────────────────────────────
|
|
355
|
+
const playlistHandling = this.getNodeParameter('playlistHandling', itemIndex);
|
|
356
|
+
const args = ['--dump-json', '--no-warnings'];
|
|
357
|
+
if (playlistHandling === 'single') {
|
|
358
|
+
args.push('--no-playlist');
|
|
359
|
+
}
|
|
360
|
+
else {
|
|
361
|
+
args.push('--flat-playlist');
|
|
362
|
+
}
|
|
363
|
+
if (cookiesFile)
|
|
364
|
+
args.push('--cookies', cookiesFile);
|
|
365
|
+
if (proxy)
|
|
366
|
+
args.push('--proxy', proxy);
|
|
367
|
+
if (extraArgs)
|
|
368
|
+
args.push(...extraArgs.split(/\s+/).filter(Boolean));
|
|
369
|
+
args.push('--', url);
|
|
370
|
+
const { stdout } = await execFileAsync(bin, args, { timeout });
|
|
371
|
+
// stdout may contain multiple JSON lines (playlist)
|
|
372
|
+
const lines = stdout.trim().split('\n').filter(Boolean);
|
|
373
|
+
for (const line of lines) {
|
|
374
|
+
let info;
|
|
375
|
+
try {
|
|
376
|
+
info = JSON.parse(line);
|
|
377
|
+
}
|
|
378
|
+
catch {
|
|
379
|
+
continue;
|
|
380
|
+
}
|
|
381
|
+
returnData.push({ json: flattenInfo(info) });
|
|
382
|
+
}
|
|
383
|
+
continue;
|
|
384
|
+
}
|
|
385
|
+
if (operation === 'downloadVideo') {
|
|
386
|
+
// ── Download Video ───────────────────────────────────────
|
|
387
|
+
const videoFormat = this.getNodeParameter('videoFormat', itemIndex);
|
|
388
|
+
const customFormat = this.getNodeParameter('customFormat', itemIndex);
|
|
389
|
+
const mergeOutputFormat = this.getNodeParameter('mergeOutputFormat', itemIndex);
|
|
390
|
+
const playlistHandling = this.getNodeParameter('playlistHandling', itemIndex);
|
|
391
|
+
const formatStr = videoFormat === 'custom' ? customFormat : videoFormat;
|
|
392
|
+
const tmpDir = makeTempDir();
|
|
393
|
+
try {
|
|
394
|
+
const args = [
|
|
395
|
+
'-f', formatStr,
|
|
396
|
+
'-o', path.join(tmpDir, '%(title)s.%(ext)s'),
|
|
397
|
+
'--no-warnings',
|
|
398
|
+
];
|
|
399
|
+
if (mergeOutputFormat)
|
|
400
|
+
args.push('--merge-output-format', mergeOutputFormat);
|
|
401
|
+
if (playlistHandling === 'single')
|
|
402
|
+
args.push('--no-playlist');
|
|
403
|
+
if (cookiesFile)
|
|
404
|
+
args.push('--cookies', cookiesFile);
|
|
405
|
+
if (proxy)
|
|
406
|
+
args.push('--proxy', proxy);
|
|
407
|
+
if (extraArgs)
|
|
408
|
+
args.push(...extraArgs.split(/\s+/).filter(Boolean));
|
|
409
|
+
args.push('--', url);
|
|
410
|
+
await execFileAsync(bin, args, { timeout });
|
|
411
|
+
const files = fs.readdirSync(tmpDir);
|
|
412
|
+
for (const fname of files) {
|
|
413
|
+
const fpath = path.join(tmpDir, fname);
|
|
414
|
+
const ext = path.extname(fname).replace('.', '');
|
|
415
|
+
const data = fs.readFileSync(fpath);
|
|
416
|
+
const binaryData = await this.helpers.prepareBinaryData(data, fname, mimeForExt(ext));
|
|
417
|
+
returnData.push({
|
|
418
|
+
json: { filename: fname, size: data.length, mimeType: mimeForExt(ext) },
|
|
419
|
+
binary: { data: binaryData },
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
finally {
|
|
424
|
+
cleanupDir(tmpDir);
|
|
425
|
+
}
|
|
426
|
+
continue;
|
|
427
|
+
}
|
|
428
|
+
if (operation === 'extractAudio') {
|
|
429
|
+
// ── Extract Audio ─────────────────────────────────────────
|
|
430
|
+
const audioFormat = this.getNodeParameter('audioFormat', itemIndex);
|
|
431
|
+
const audioQuality = this.getNodeParameter('audioQuality', itemIndex);
|
|
432
|
+
const tmpDir = makeTempDir();
|
|
433
|
+
try {
|
|
434
|
+
const args = [
|
|
435
|
+
'--extract-audio',
|
|
436
|
+
'--audio-format', audioFormat,
|
|
437
|
+
'--audio-quality', audioQuality,
|
|
438
|
+
'-o', path.join(tmpDir, '%(title)s.%(ext)s'),
|
|
439
|
+
'--no-warnings',
|
|
440
|
+
'--no-playlist',
|
|
441
|
+
];
|
|
442
|
+
if (cookiesFile)
|
|
443
|
+
args.push('--cookies', cookiesFile);
|
|
444
|
+
if (proxy)
|
|
445
|
+
args.push('--proxy', proxy);
|
|
446
|
+
if (extraArgs)
|
|
447
|
+
args.push(...extraArgs.split(/\s+/).filter(Boolean));
|
|
448
|
+
args.push('--', url);
|
|
449
|
+
await execFileAsync(bin, args, { timeout });
|
|
450
|
+
const ext = audioFormat === 'vorbis' ? 'ogg' : audioFormat === 'best' ? 'm4a' : audioFormat;
|
|
451
|
+
const fpath = findOutputFile(tmpDir, [ext, 'm4a', 'mp3', 'opus', 'flac', 'wav', 'ogg']);
|
|
452
|
+
if (!fpath)
|
|
453
|
+
throw new Error('yt-dlp 未输出任何文件');
|
|
454
|
+
const fname = path.basename(fpath);
|
|
455
|
+
const fext = path.extname(fname).replace('.', '');
|
|
456
|
+
const data = fs.readFileSync(fpath);
|
|
457
|
+
const binaryData = await this.helpers.prepareBinaryData(data, fname, mimeForExt(fext));
|
|
458
|
+
returnData.push({
|
|
459
|
+
json: { filename: fname, size: data.length, mimeType: mimeForExt(fext) },
|
|
460
|
+
binary: { data: binaryData },
|
|
461
|
+
});
|
|
462
|
+
}
|
|
463
|
+
finally {
|
|
464
|
+
cleanupDir(tmpDir);
|
|
465
|
+
}
|
|
466
|
+
continue;
|
|
467
|
+
}
|
|
468
|
+
if (operation === 'getSubtitles') {
|
|
469
|
+
// ── Get Subtitles ─────────────────────────────────────────
|
|
470
|
+
const subtitleLang = this.getNodeParameter('subtitleLang', itemIndex);
|
|
471
|
+
const includeAutoSub = this.getNodeParameter('includeAutoSub', itemIndex);
|
|
472
|
+
const subtitleFormat = this.getNodeParameter('subtitleFormat', itemIndex);
|
|
473
|
+
const tmpDir = makeTempDir();
|
|
474
|
+
try {
|
|
475
|
+
const args = [
|
|
476
|
+
'--write-subs',
|
|
477
|
+
'--sub-langs', subtitleLang,
|
|
478
|
+
'--sub-format', subtitleFormat,
|
|
479
|
+
'--convert-subs', subtitleFormat === 'json3' ? 'json3' : subtitleFormat,
|
|
480
|
+
'--skip-download',
|
|
481
|
+
'-o', path.join(tmpDir, '%(title)s.%(ext)s'),
|
|
482
|
+
'--no-warnings',
|
|
483
|
+
'--no-playlist',
|
|
484
|
+
];
|
|
485
|
+
if (includeAutoSub)
|
|
486
|
+
args.push('--write-auto-subs');
|
|
487
|
+
if (cookiesFile)
|
|
488
|
+
args.push('--cookies', cookiesFile);
|
|
489
|
+
if (proxy)
|
|
490
|
+
args.push('--proxy', proxy);
|
|
491
|
+
if (extraArgs)
|
|
492
|
+
args.push(...extraArgs.split(/\s+/).filter(Boolean));
|
|
493
|
+
args.push('--', url);
|
|
494
|
+
await execFileAsync(bin, args, { timeout });
|
|
495
|
+
const files = fs.readdirSync(tmpDir).filter((f) => f.endsWith('.vtt') || f.endsWith('.srt') || f.endsWith('.ass') || f.endsWith('.json3'));
|
|
496
|
+
if (files.length === 0) {
|
|
497
|
+
returnData.push({ json: { warning: '未找到字幕文件,该视频可能没有字幕', url } });
|
|
498
|
+
}
|
|
499
|
+
for (const fname of files) {
|
|
500
|
+
const fpath = path.join(tmpDir, fname);
|
|
501
|
+
const content = fs.readFileSync(fpath, 'utf-8');
|
|
502
|
+
const ext = path.extname(fname).replace('.', '');
|
|
503
|
+
returnData.push({
|
|
504
|
+
json: {
|
|
505
|
+
filename: fname,
|
|
506
|
+
language: extractLangFromFilename(fname),
|
|
507
|
+
format: ext,
|
|
508
|
+
content,
|
|
509
|
+
size: content.length,
|
|
510
|
+
},
|
|
511
|
+
});
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
finally {
|
|
515
|
+
cleanupDir(tmpDir);
|
|
516
|
+
}
|
|
517
|
+
continue;
|
|
518
|
+
}
|
|
519
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `未知操作: ${operation}`);
|
|
520
|
+
}
|
|
521
|
+
catch (error) {
|
|
522
|
+
if (this.continueOnFail()) {
|
|
523
|
+
returnData.push({
|
|
524
|
+
json: { error: error.message },
|
|
525
|
+
pairedItem: { item: itemIndex },
|
|
526
|
+
});
|
|
527
|
+
continue;
|
|
528
|
+
}
|
|
529
|
+
// Wrap generic errors with node context
|
|
530
|
+
if (error instanceof n8n_workflow_1.NodeOperationError)
|
|
531
|
+
throw error;
|
|
532
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), error.message, {
|
|
533
|
+
itemIndex,
|
|
534
|
+
description: 'yt-dlp 执行失败,请检查 URL 是否有效,以及容器中是否已安装 yt-dlp',
|
|
535
|
+
});
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
return [returnData];
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
exports.YtDlp = YtDlp;
|
|
542
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
543
|
+
// Utility functions
|
|
544
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
545
|
+
/**
|
|
546
|
+
* Flatten yt-dlp info JSON to a simpler object with key fields.
|
|
547
|
+
* The full dump contains hundreds of keys; we surface the most useful ones.
|
|
548
|
+
*/
|
|
549
|
+
function flattenInfo(info) {
|
|
550
|
+
const pick = (keys) => {
|
|
551
|
+
const result = {};
|
|
552
|
+
for (const k of keys) {
|
|
553
|
+
if (info[k] !== undefined && info[k] !== null) {
|
|
554
|
+
result[k] = info[k];
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
return result;
|
|
558
|
+
};
|
|
559
|
+
const simplified = pick([
|
|
560
|
+
'id', 'title', 'description', 'uploader', 'uploader_id', 'uploader_url',
|
|
561
|
+
'channel', 'channel_id', 'channel_url',
|
|
562
|
+
'upload_date', 'timestamp', 'duration', 'duration_string',
|
|
563
|
+
'view_count', 'like_count', 'comment_count',
|
|
564
|
+
'webpage_url', 'original_url', 'extractor', 'extractor_key',
|
|
565
|
+
'thumbnail', 'thumbnails',
|
|
566
|
+
'tags', 'categories',
|
|
567
|
+
'age_limit', 'is_live', 'was_live',
|
|
568
|
+
'playlist', 'playlist_id', 'playlist_title', 'playlist_uploader',
|
|
569
|
+
'n_entries', 'playlist_index',
|
|
570
|
+
]);
|
|
571
|
+
// Summarize formats
|
|
572
|
+
if (Array.isArray(info['formats'])) {
|
|
573
|
+
simplified['formats_count'] = info['formats'].length;
|
|
574
|
+
simplified['formats_summary'] = info['formats'].map((f) => {
|
|
575
|
+
var _a, _b, _c;
|
|
576
|
+
return ({
|
|
577
|
+
format_id: f['format_id'],
|
|
578
|
+
ext: f['ext'],
|
|
579
|
+
resolution: (_a = f['resolution']) !== null && _a !== void 0 ? _a : `${(_b = f['width']) !== null && _b !== void 0 ? _b : '?'}x${(_c = f['height']) !== null && _c !== void 0 ? _c : '?'}`,
|
|
580
|
+
filesize: f['filesize'],
|
|
581
|
+
vcodec: f['vcodec'],
|
|
582
|
+
acodec: f['acodec'],
|
|
583
|
+
tbr: f['tbr'],
|
|
584
|
+
});
|
|
585
|
+
});
|
|
586
|
+
}
|
|
587
|
+
if (Array.isArray(info['subtitles'])) {
|
|
588
|
+
simplified['subtitle_languages'] = Object.keys(info['subtitles']);
|
|
589
|
+
}
|
|
590
|
+
return simplified;
|
|
591
|
+
}
|
|
592
|
+
/** Extract language code from subtitle filename like "video.zh-Hans.vtt" */
|
|
593
|
+
function extractLangFromFilename(fname) {
|
|
594
|
+
const parts = fname.split('.');
|
|
595
|
+
if (parts.length >= 3) {
|
|
596
|
+
return parts[parts.length - 2];
|
|
597
|
+
}
|
|
598
|
+
return 'unknown';
|
|
599
|
+
}
|
|
600
|
+
//# sourceMappingURL=YtDlp.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"YtDlp.node.js","sourceRoot":"","sources":["../../../nodes/YtDlp/YtDlp.node.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAQsB;AACtB,iDAAyC;AACzC,+BAAiC;AACjC,uCAAyB;AACzB,2CAA6B;AAC7B,uCAAyB;AAEzB,MAAM,aAAa,GAAG,IAAA,gBAAS,EAAC,wBAAQ,CAAC,CAAC;AAE1C,gFAAgF;AAChF,UAAU;AACV,gFAAgF;AAEhF;;;GAGG;AACH,SAAS,eAAe,CAAC,UAAmB;IACxC,IAAI,UAAU,IAAI,UAAU,CAAC,IAAI,EAAE,EAAE,CAAC;QAClC,OAAO,UAAU,CAAC,IAAI,EAAE,CAAC;IAC7B,CAAC;IACD,MAAM,UAAU,GAAG,CAAC,QAAQ,EAAE,uBAAuB,EAAE,iBAAiB,CAAC,CAAC;IAC1E,+FAA+F;IAC/F,OAAO,UA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M,GAAG,CAAC,CAAC,CAAC;IACnC,CAAC;IACD,OAAO,SAAS,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
|
2
|
+
<!-- Background circle -->
|
|
3
|
+
<circle cx="32" cy="32" r="32" fill="#FF0000"/>
|
|
4
|
+
<!-- Play button triangle (YouTube-style) -->
|
|
5
|
+
<polygon points="24,18 24,46 50,32" fill="#FFFFFF"/>
|
|
6
|
+
<!-- Download arrow -->
|
|
7
|
+
<g fill="#FFFFFF" transform="translate(6, 36)">
|
|
8
|
+
<rect x="0" y="10" width="20" height="3" rx="1.5"/>
|
|
9
|
+
<polygon points="10,0 4,8 16,8"/>
|
|
10
|
+
</g>
|
|
11
|
+
</svg>
|
package/package.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "n8n-nodes-wayne-ytdlp",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "n8n community node for yt-dlp — download videos and audio from 1000+ sites",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"n8n-community-node-package",
|
|
7
|
+
"yt-dlp",
|
|
8
|
+
"youtube-dl",
|
|
9
|
+
"video-downloader",
|
|
10
|
+
"audio-downloader",
|
|
11
|
+
"youtube",
|
|
12
|
+
"bilibili",
|
|
13
|
+
"tiktok"
|
|
14
|
+
],
|
|
15
|
+
"license": "Unlicense",
|
|
16
|
+
"homepage": "https://github.com/yt-dlp/yt-dlp",
|
|
17
|
+
"author": {
|
|
18
|
+
"name": "community"
|
|
19
|
+
},
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "https://github.com/yt-dlp/yt-dlp.git"
|
|
23
|
+
},
|
|
24
|
+
"main": "index.js",
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "tsc && npm run copy:icons",
|
|
27
|
+
"copy:icons": "copyfiles nodes/YtDlp/yt-dlp.svg dist/",
|
|
28
|
+
"dev": "tsc --watch",
|
|
29
|
+
"format": "prettier nodes --write",
|
|
30
|
+
"lint": "eslint nodes --ext .ts",
|
|
31
|
+
"lint:fix": "eslint nodes --ext .ts --fix",
|
|
32
|
+
"prepublishOnly": "npm run build && npm run lint"
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"dist"
|
|
36
|
+
],
|
|
37
|
+
"n8n": {
|
|
38
|
+
"n8nNodesApiVersion": 1,
|
|
39
|
+
"credentials": [],
|
|
40
|
+
"nodes": [
|
|
41
|
+
"dist/nodes/YtDlp/YtDlp.node.js"
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@types/node": "^18.16.0",
|
|
46
|
+
"@typescript-eslint/parser": "^6.0.0",
|
|
47
|
+
"copyfiles": "^2.4.1",
|
|
48
|
+
"eslint": "^8.45.0",
|
|
49
|
+
"n8n-workflow": "^1.0.0",
|
|
50
|
+
"prettier": "^3.0.0",
|
|
51
|
+
"typescript": "^5.1.6"
|
|
52
|
+
},
|
|
53
|
+
"peerDependencies": {
|
|
54
|
+
"n8n-workflow": "*"
|
|
55
|
+
}
|
|
56
|
+
}
|