From a44d758ca69a67a87a8fec30ae8acf596985335c Mon Sep 17 00:00:00 2001 From: kevinwatt Date: Tue, 11 Feb 2025 03:19:33 +0800 Subject: [PATCH] fix: limit filename length to avoid system errors --- package.json | 2 +- src/index.mts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 54a2b53..f7ed28a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kevinwatt/yt-dlp-mcp", - "version": "0.6.2", + "version": "0.6.3", "description": "YouTube yt-dlp MCP Server - Download YouTube content via Model Context Protocol", "keywords": [ "mcp", diff --git a/src/index.mts b/src/index.mts index 5be85e2..ef98737 100644 --- a/src/index.mts +++ b/src/index.mts @@ -17,7 +17,7 @@ import { rimraf } from "rimraf"; const server = new Server( { name: "yt-dlp-mcp", - version: "0.6.2", + version: "0.6.3", }, { capabilities: { @@ -117,7 +117,8 @@ async function downloadVideo(url: string): Promise { const outputTemplate = path.join( userDownloadsDir, - `%(title)s [%(id)s] ${timestamp}.%(ext)s` + // Limit title length to 50 characters to avoid filename too long error + `%(title).50s [%(id)s] ${timestamp}.%(ext)s` ); // Get expected filename