crewAI
crewAI copied to clipboard
fix: resolve YoutubeChannelSearchTool url parsing for issue #5429
fixes #5429
description
the YoutubeChannelSearchTool failed to process raw handle (@krishnaik06) and full URL (https://www.youtube.com/@...) inputs because it blindly prepended @ to the string regardless of input format.
this fix converts both shorthand handles and full channel URLs into a canonical URL so the adapter processes them correctly.
additionally added defensive shorthand URL normalization directly into YoutubeChannelLoader so the loader can flexibly resolve channel inputs if used directly, independent of the tool parsing.
changes made
youtube_channel_search_tool.py: updatedadd()to correctly handle and canonicalize fullhttps://URLs versus bare string shorthand handles.youtube_channel_loader.py: added base-level URL normalization immediately prior to URL validation regex matching.- testing: added parameterized validation tests covering bare handles,
@-prepended handles, and fully-qualified youtube/channel/and@URLs. also mocked a new loader test intercept.
This PR is stale because it has been open for 45 days with no activity.