Downloads a video from the specified URL.
Parameters:
url: The URL of the video to downloadconfig: (Optional) Configuration objectresolution: (Optional) Preferred video resolution ('480p', '720p', '1080p', 'best')
Returns:
- Promise resolving to a success message with the downloaded file path
Example:
import { downloadVideo } from '@kevinwatt/yt-dlp-mcp';
// Download with default settings
const result = await downloadVideo('https://www.youtube.com/watch?v=jNQXAC9IVRw');
console.log(result);
// Download with specific resolution
const hdResult = await downloadVideo(
'https://www.youtube.com/watch?v=jNQXAC9IVRw',
undefined,
'1080p'
);
console.log(hdResult);Downloads audio from the specified URL in the best available quality.
Parameters:
url: The URL of the video to extract audio fromconfig: (Optional) Configuration object
Returns:
- Promise resolving to a success message with the downloaded file path
Example:
import { downloadAudio } from '@kevinwatt/yt-dlp-mcp';
const result = await downloadAudio('https://www.youtube.com/watch?v=jNQXAC9IVRw');
console.log(result);Lists all available subtitles for a video.
Parameters:
url: The URL of the video
Returns:
- Promise resolving to a string containing the list of available subtitles
Example:
import { listSubtitles } from '@kevinwatt/yt-dlp-mcp';
const subtitles = await listSubtitles('https://www.youtube.com/watch?v=jNQXAC9IVRw');
console.log(subtitles);Downloads subtitles for a video in the specified language.
Parameters:
url: The URL of the videolanguage: Language code (e.g., 'en', 'zh-Hant', 'ja')
Returns:
- Promise resolving to the subtitle content
Example:
import { downloadSubtitles } from '@kevinwatt/yt-dlp-mcp';
const subtitles = await downloadSubtitles(
'https://www.youtube.com/watch?v=jNQXAC9IVRw',
'en'
);
console.log(subtitles);interface Config {
file: {
maxFilenameLength: number;
downloadsDir: string;
tempDirPrefix: string;
sanitize: {
replaceChar: string;
truncateSuffix: string;
illegalChars: RegExp;
reservedNames: readonly string[];
};
};
tools: {
required: readonly string[];
};
download: {
defaultResolution: "480p" | "720p" | "1080p" | "best";
defaultAudioFormat: "m4a" | "mp3";
defaultSubtitleLanguage: string;
};
}For detailed configuration options, see Configuration Guide.