Skip to main content
Glama

YouTube MCP Server

by xue160709
test-ytdlp.ts921 B
// 测试脚本,用于直接测试YtDlpTool import { exec } from 'child_process'; import { promisify } from 'util'; import path from 'path'; const execPromise = promisify(exec); async function testYtDlp() { try { // 获取yt-dlp.exe的绝对路径 const ytDlpPath = path.resolve(process.cwd(), "yt-dlp.exe"); // 测试URL const url = "https://www.bilibili.com/video/BV1p2Q6YsEGk"; // 构建命令行参数 const args = [url, "--list-formats"]; // 执行命令 const command = `"${ytDlpPath}" ${args.join(" ")}`; console.log(`执行命令: ${command}`); const { stdout, stderr } = await execPromise(command); if (stderr) { console.warn(`警告: ${stderr}`); } console.log("输出结果:"); console.log(stdout); } catch (error) { console.error(`执行yt-dlp时出错:`, error); } } // 执行测试 testYtDlp();

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/xue160709/yt-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server