83 Commits

Author SHA1 Message Date
kevinwatt
0e5a30d10c fix: prevent server hang and output corruption in spawn handling (#23)
- Add process 'error' event handler to catch spawn failures (e.g., yt-dlp not installed)
- Separate stdout/stderr to prevent yt-dlp warnings from corrupting parsed output
- Add try-catch for RegExp construction from YTDLP_SANITIZE_ILLEGAL_CHARS env var
- Add NaN validation for YTDLP_MAX_FILENAME_LENGTH env var
- Sync VERSION constant with package.json (0.8.4)
- Update tests for new output format and null handling
- Add version sync guidance to CLAUDE.md
2026-01-05 01:47:59 +08:00
kevinwatt
47da207c57 docs(cookies): add deno requirement warning for cookie authentication
When using cookie authentication, YouTube uses authenticated API endpoints
that require JavaScript challenge solving. Without deno installed, downloads
will fail with "n challenge solving failed" error.
2025-12-25 04:31:33 +08:00
kevinwatt
910133f382 chore(release): v0.8.3 v0.8.3 2025-12-25 04:10:12 +08:00
kevinwatt
7a8fb5f6ff chore(release): v0.8.2 2025-12-25 03:49:13 +08:00
kevinwatt
5e098dfaf1 docs(readme): add uploadDateFilter parameter to search tool 2025-12-25 03:41:14 +08:00
kevinwatt
af0137b2bd feat(search): add uploadDateFilter parameter for date-based filtering
Add optional uploadDateFilter parameter to ytdlp_search_videos tool
that allows filtering search results by upload date using YouTube's
native date filtering (sp parameter).

Options: hour, today, week, month, year
Default: no filter (all dates)

Closes #21
2025-12-25 03:41:14 +08:00
kevinwatt
020c57d40c fix(validation): check validateUrl return value before proceeding
Previously validateUrl() was called but its boolean return value was
ignored in audio.ts, metadata.ts, and video.ts. Invalid URLs would
pass through and only fail later during yt-dlp execution.

Now properly throw 'Invalid or unsupported URL format' error early.
2025-12-25 03:41:14 +08:00
Peter Keffer
bbda4d2857 fix(tests): improve comments test stability and CI compatibility
- Use delete for Python env vars instead of empty string assignment
- Make integration tests opt-in via RUN_INTEGRATION_TESTS=1 env var
- Fix regex null coalescing for author matching in tests
2025-12-25 03:41:14 +08:00
Peter Keffer
2e2888cccc feat(comments): add YouTube video comments extraction tools
Add two new MCP tools for extracting video comments:
- ytdlp_get_video_comments: Extract comments as structured JSON with
  author info, likes, timestamps, and reply threading
- ytdlp_get_video_comments_summary: Get human-readable summary of top comments

Features:
- Support for sorting by "top" (most liked) or "new" (newest first)
- Configurable comment limit (1-100 comments)
- Includes author verification status, pinned comments, and uploader replies
- Comprehensive error handling for disabled comments, private videos, etc.
- Comprehensive test suite
2025-12-25 03:41:14 +08:00
kevinwatt
d7f5ec0f62 refactor: move integration tests to tests/ directory
- Create tests/ directory for integration/manual test scripts
- Move test-mcp.mjs, test-real-video.mjs, test-bilibili.mjs to tests/
- Keep unit tests in src/__tests__/ (Jest convention)
- Update CHANGELOG.md
2025-12-16 04:36:55 +08:00
kevinwatt
6fa13c1204 chore: add Claude Code settings to gitignore and update guidelines
- Add .claude/ directory and CLAUDE.md to .gitignore
- Add development guideline to always update CHANGELOG.md
- Update CHANGELOG.md with unreleased changes
2025-12-16 04:33:53 +08:00
kevinwatt
748255fe01 docs(readme): add MCP client configuration section
Add comprehensive setup instructions for multiple MCP clients:
- Dive (featured at top)
- Claude Code, Claude Desktop
- Cursor, VS Code/Copilot, Windsurf
- Cline, Warp, JetBrains AI Assistant

Use @latest tag for consistent auto-updates.
2025-12-16 03:29:29 +08:00
kevinwatt
11464c6c24 fix(schema): use z.coerce.number() for MCP string serialization
MCP protocol serializes numeric parameters as strings during transport.
Using z.coerce.number() instead of z.number() to handle this gracefully.

Fixes #20
v0.8.1
2025-12-08 04:32:35 +08:00
kevinwatt
87ba2f8494 feat(cookies): add cookie support for authenticated access
- Add YTDLP_COOKIES_FILE and YTDLP_COOKIES_FROM_BROWSER env vars
- Support all yt-dlp cookie methods (file, browser extraction)
- Validate browser names (brave, chrome, chromium, edge, firefox, opera, safari, vivaldi, whale)
- Cookie file takes precedence over browser extraction
- Add getCookieArgs() helper function
- Integrate cookie args into all modules (video, audio, subtitle, search, metadata)
- Add comprehensive cookie documentation (docs/cookies.md)
- Add 12 unit tests for cookie configuration
- Fix search.test.ts function signature issue

Closes #19
v0.8.0
2025-12-06 18:42:25 +08:00
kevinwatt
26b2137751 chore: release v0.7.0 - MCP Best Practices & Quality Improvements
Major release with comprehensive MCP best practices implementation:

 Added:
- Tool name prefixes (ytdlp_) for all 8 tools to avoid naming conflicts
- Zod schema validation with runtime input validation
- Tool annotations (readOnlyHint, destructiveHint, idempotentHint, openWorldHint)
- Response format options (JSON/Markdown) for search tools
- Pagination support with offset parameter
- Character limits (25K standard, 50K for transcripts) with smart truncation
- Actionable error messages with platform-specific guidance

🔧 Improved:
- Comprehensive tool descriptions with usage examples
- Enhanced configuration system with limits
- Better TypeScript type safety
- Professional README with badges and tables

🐛 Fixed:
- JSON parsing issue in metadata truncation
- Maintained valid JSON structure when truncated

🧪 Tested:
-  YouTube platform (Rick Astley video)
-  Bilibili platform (Chinese content)
-  Multi-language support verified
-  All 8 tools tested with real API calls

📖 Documentation:
- Created comprehensive CHANGELOG.md
- Redesigned README.md with professional formatting
- Added migration guide for v0.6.x users

🌍 Platform Support:
- Verified: YouTube, Bilibili
- Theory: 1000+ platforms via yt-dlp
v0.7.0
2025-10-19 01:52:22 +08:00
kevinwatt
c5e84c326e chore: release v0.6.28 v0.6.28 2025-08-13 15:49:49 +08:00
kevinwatt
b19dbb67a5 feat(metadata): add get_video_metadata & get_video_metadata_summary; docs(api); tests(metadata) 2025-08-13 15:49:43 +08:00
kevinwatt
9d14f6bc01 remove unused test-utils.ts 2025-08-03 00:47:53 +08:00
kevinwatt
fa879ab9ab fix: update prepare script to skip lib check
- Replace shx with standard chmod command
- Add --skipLibCheck flag to resolve type dependencies issue
- Ensure smooth npm publish process
2025-07-28 04:46:20 +08:00
kevinwatt
5aecaa3b20 feat: add video search functionality
- Add new search_videos tool for YouTube video search
- Support configurable search result count (1-50)
- Return formatted results with title, channel, duration, and URL
- Add comprehensive test coverage with real yt-dlp integration
- Update documentation with search examples
- Fix dependency security vulnerabilities
- Bump version to 0.6.27

Resolves: kevinwatt/yt-dlp-mcp#14
2025-07-28 04:45:37 +08:00
Kevin Watt
9ba39128aa
Merge pull request #15 from seszele64/implement-trimmed-download
Implement trimmed download

Thanks for the great work on this PR! 🙌

The trimmed download feature looks solid - good implementation with proper tests and documentation. This will be really useful for users who need to download video segments.

Appreciate the contribution!

LGTM 👍
2025-07-28 04:21:22 +08:00
seszele64
353bc8fd22 feat(api): add start and end time docs and examples 2025-07-22 19:14:18 +02:00
seszele64
53437dc472 feat(readme): add start and end time params for trimming 2025-07-22 19:13:25 +02:00
seszele64
cc2b9ec8b6 feat(video): add start and end time params for trimming 2025-07-22 19:13:13 +02:00
seszele64
7278b672f4 test(video): add tests for video download trimming 2025-07-22 19:12:49 +02:00
seszele64
83a2eb9bb8 feat(video): add support for trimming video downloads 2025-07-22 19:12:38 +02:00
Kevin Watt
bbc0e6aa93
Merge pull request #11 from hesreallyhim/fix/add-ignore-config
fix: add `--ignore-config` flag

Seems good, Thanks.
2025-07-16 00:29:56 +08:00
Really Him
8cf7b3f5dc fix: fix contributing doc 2025-06-17 21:08:38 -04:00
Really Him
01709a778b fix: add ignore-config flag 2025-06-17 21:06:25 -04:00
Kevin Watt
da7e4666ed
Merge pull request #9 from kevinwatt/revert-8-revert-7-feature/transcript-download
Revert "Revert "feat: add transcript download functionality""
2025-05-30 12:03:50 +08:00
Kevin Watt
f27d22eb81
Revert "Revert "feat: add transcript download functionality"" 2025-05-30 12:03:04 +08:00
Kevin Watt
0de9308a41
Merge pull request #8 from kevinwatt/revert-7-feature/transcript-download
Revert "feat: add transcript download functionality"
2025-05-30 11:59:39 +08:00
Kevin Watt
c79766c241
Revert "feat: add transcript download functionality" 2025-05-30 11:57:52 +08:00
Kevin Watt
4171abc6d0
Merge pull request #7 from msuch/feature/transcript-download
Looks great to me. Thanks for the commit.

feat: add transcript download functionality
2025-05-30 11:56:47 +08:00
m
7900a9b4e1 feat: add transcript download functionality
- Add cleanSubtitleToTranscript utility to strip SRT formatting, timestamps, and HTML tags
- Implement downloadTranscript function using yt-dlp with subtitle cleaning
- Add download_transcript MCP tool with language support (defaults to English)
- Include comprehensive tests for both utility and download functionality
- Update README documentation with tool description and usage examples

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-27 12:00:31 +02:00
kevinwatt
944b0211c6 feat: add random filename fallback when filename cannot be retrieved - Add generateRandomFilename utility function - Modify downloadVideo to use random filename when yt-dlp fails to get filename - Update version to 0.6.26 v0.6.26 2025-02-23 05:53:58 +08:00
kevinwatt
c39fd8785c update README.md v0.6.25 2025-02-22 03:24:44 +08:00
kevinwatt
e9a0e55762 feat: major improvements and version bump to 0.6.24 - Remove prompts functionality (prompts.ts and tests) - Improve error handling with VideoDownloadError class - Move configuration to dedicated file - Add URL validation and security checks - Reorganize code into modules - Add comprehensive unit tests - Enhance documentation with JSDoc and examples v0.6.24 2025-02-22 00:43:15 +08:00
kevinwatt
21689391bd add download_audio tool to README.md 2025-02-21 17:43:33 +08:00
kevinwatt
5152ad4d17 fix yt-dlp error handling for audio download 2025-02-21 17:40:35 +08:00
kevinwatt
c4dcc0eda2 v0.6.23 v0.6.23 2025-02-21 17:22:47 +08:00
kevin
12fa5dbffe v0.6.22 2025-02-21 17:19:13 +08:00
kevin
b3e8ed5f58 feat: improve audio download support
- Add support for various audio formats (m4a/mp3)
- Update audio download format selection logic
- Improve error handling and filename display
- Bump version to 0.6.22
v0.6.22
2025-02-21 17:14:28 +08:00
kevin
576549bc2c update description in README.md 2025-02-21 16:56:45 +08:00
kevin
9c25179fab more descriptive description 2025-02-21 16:55:31 +08:00
kevin
7710184faf fix: update description 2025-02-21 16:54:25 +08:00
kevin
adf1b7178c new description for package.json 2025-02-21 16:52:56 +08:00
kevin
58384bb1a2 fix: improve subtitle handling and tool names
- Rename list_video_subtitles to list_subtitle_languages for clarity
- Update tool descriptions to better reflect functionality
- Improve subtitle listing output format
- Simplify subtitle download parameters
- Add verbose logging for better debugging
- Bump version to 0.6.21
v0.6.21
2025-02-21 16:42:12 +08:00
kevin
5523b1dedd fix: improve subtitle download reliability
- Use --write-sub --write-auto-sub combination for better subtitle support
- Simplify subtitle download logic to handle both regular and auto-generated subtitles
- Add debug logging for better troubleshooting
- Filter only .srt files as final output
- Bump version to 0.6.20
v0.6.20
2025-02-21 15:54:11 +08:00
kevin
5b96dff785 fix: update version 2025-02-21 15:52:42 +08:00