feat(tools): added additional youtube search params, get channel playlists videos and related videos tools#1814
Merged
Merged
Conversation
…lists videos and related videos tools
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Greptile Overview
Greptile Summary
This PR enhances the YouTube integration with advanced filtering capabilities and three new tools, directly addressing issue #1793.
Key Changes:
- Enhanced
youtube_searchwith 11 new filtering parameters: channel ID, date range (publishedAfter/Before), video duration, sort order, category ID, video quality, captions, region code, language, and safe search - Added
youtube_channel_videostool to retrieve all videos from a specific channel with sorting options - Added
youtube_channel_playliststool to get all playlists from a channel - Added
youtube_related_videostool to find videos related to a specific video - Updated all type definitions and block configurations to support new functionality
- Comprehensive documentation updates with clear parameter descriptions and examples
Implementation Quality:
- All new tools follow established patterns in the codebase (URL construction, response transformation, error handling)
- Proper TypeScript typing throughout with comprehensive interfaces
- Consistent use of optional chaining and fallback values for robust data handling
- Block configuration uses conditional fields appropriately to show relevant inputs per operation
- All API parameters properly URL-encoded
- Pagination support included via
pageTokenandnextPageToken
Testing Considerations:
- Verify YouTube API quota limits with the additional parameters
- Test edge cases: empty results, invalid channel IDs, malformed date strings
- Confirm RFC 3339 date format validation for
publishedAfter/publishedBeforeparameters
Confidence Score: 5/5
- This PR is safe to merge with no critical issues found
- The implementation is solid and follows all established patterns in the codebase. All new tools properly handle edge cases with fallback values, use consistent error handling patterns, and include proper TypeScript typing. The changes are additive (no breaking changes), well-documented, and address the feature request comprehensively.
- No files require special attention
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| apps/sim/tools/youtube/search.ts | 5/5 | Enhanced with 11 new filtering parameters (channel, date range, duration, category, quality, captions, region, language, safe search). All parameters properly encoded and passed to YouTube API. |
| apps/sim/tools/youtube/channel_videos.ts | 5/5 | New tool to get all videos from a channel using search API with type=video filter. Properly handles pagination and sorting options. |
| apps/sim/tools/youtube/channel_playlists.ts | 5/5 | New tool to retrieve channel playlists with proper error handling for empty results. Includes itemCount from contentDetails. |
| apps/sim/tools/youtube/related_videos.ts | 5/5 | New tool using relatedToVideoId parameter. Implementation follows established patterns with proper thumbnail fallback logic. |
| apps/sim/blocks/blocks/youtube.ts | 5/5 | Added 3 new operations with properly conditioned input fields. Each operation has appropriate UI controls (dropdowns, sliders, text inputs) with sensible defaults. |
Sequence Diagram
sequenceDiagram
participant User
participant YouTubeBlock
participant Tool
participant YouTubeAPI
alt Search Videos (Enhanced)
User->>YouTubeBlock: Select youtube_search operation
User->>YouTubeBlock: Enter query + filters (channel, dates, duration, etc.)
YouTubeBlock->>Tool: youtube_search(query, filters, apiKey)
Tool->>YouTubeAPI: GET /search?q=query&channelId=...&publishedAfter=...
YouTubeAPI-->>Tool: Search results
Tool-->>YouTubeBlock: {items[], totalResults, nextPageToken}
end
alt Get Channel Videos (New)
User->>YouTubeBlock: Select youtube_channel_videos operation
User->>YouTubeBlock: Enter channelId + sort order
YouTubeBlock->>Tool: youtube_channel_videos(channelId, order, apiKey)
Tool->>YouTubeAPI: GET /search?channelId=...&type=video&order=...
YouTubeAPI-->>Tool: Channel videos
Tool-->>YouTubeBlock: {items[], totalResults, nextPageToken}
end
alt Get Channel Playlists (New)
User->>YouTubeBlock: Select youtube_channel_playlists operation
User->>YouTubeBlock: Enter channelId
YouTubeBlock->>Tool: youtube_channel_playlists(channelId, apiKey)
Tool->>YouTubeAPI: GET /playlists?channelId=...&part=snippet,contentDetails
YouTubeAPI-->>Tool: Channel playlists
Tool-->>YouTubeBlock: {items[], totalResults, nextPageToken}
end
alt Get Related Videos (New)
User->>YouTubeBlock: Select youtube_related_videos operation
User->>YouTubeBlock: Enter videoId
YouTubeBlock->>Tool: youtube_related_videos(videoId, apiKey)
Tool->>YouTubeAPI: GET /search?relatedToVideoId=...&type=video
YouTubeAPI-->>Tool: Related videos
Tool-->>YouTubeBlock: {items[], totalResults, nextPageToken}
end
9 files reviewed, no comments
10 tasks
waleedlatif1
added a commit
that referenced
this pull request
Nov 12, 2025
…lists videos and related videos tools (#1814)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1793
Type of Change
Testing
Tested manually
Checklist