crewai - ✅(Solved) Fix [ Bug]: YoutubeChannelSearchTool Fails for Valid Channel Inputs [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
crewAIInc/crewAI#5429Fetched 2026-04-14 05:40:51
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Participants
Timeline (top)
cross-referenced ×1labeled ×1mentioned ×1referenced ×1

The YoutubeChannelSearchTool is failing to process valid YouTube channel inputs, including both channel handles and full URLs.

Root Cause

The YoutubeChannelSearchTool is failing to process valid YouTube channel inputs, including both channel handles and full URLs.

Fix Action

Fixed

PR fix notes

PR #5442: fix: resolve YoutubeChannelSearchTool url parsing for issue #5429

Description (problem / solution / changelog)

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: updated add() to correctly handle and canonicalize full https:// 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.

Changed files

  • lib/crewai-tools/src/crewai_tools/rag/loaders/youtube_channel_loader.py (modified, +3/-0)
  • lib/crewai-tools/src/crewai_tools/tools/youtube_channel_search_tool/youtube_channel_search_tool.py (modified, +6/-3)
  • lib/crewai-tools/tests/tools/test_search_tools.py (modified, +67/-28)
RAW_BUFFERClick to expand / collapse

Description

The YoutubeChannelSearchTool is failing to process valid YouTube channel inputs, including both channel handles and full URLs.

Steps to Reproduce

from crewai_tools import YoutubeChannelSearchTool

yt_tool = YoutubeChannelSearchTool( youtube_channel_handle="@krishnaik06" )

OR

from crewai_tools import YoutubeChannelSearchTool yt_tool = YoutubeChannelSearchTool( youtube_channel_handle="https://www.youtube.com/@krishnaik06" )

Expected behavior

The tool should accept a valid YouTube Channel URL or handle and successfully load channel data.

Screenshots/Code snippets

File "D:\DATA Scientist\GenAI Projects\venv\lib\site-packages\crewai_tools\rag\loaders\youtube_channel_loader.py", line 44, in load raise ValueError(f"Invalid YouTube channel URL: {channel_url}") ValueError: Invalid YouTube channel URL: D:\DATA Scientist\GenAI Projects\BLOG Writer Agent@https:\www.youtube.com@krishnaik06

Operating System

Windows 11

Python Version

3.10

crewAI Version

1.14.1

crewAI Tools Version

1.14.1

Virtual Environment

Venv

Evidence

<img width="421" height="382" alt="Image" src="https://github.com/user-attachments/assets/57a3d0fd-8729-4b6f-a1fc-7bee451587fc" />

Possible Solution

None

Additional context

None

extent analysis

TL;DR

The issue can be resolved by properly handling the YouTube channel URL or handle in the YoutubeChannelSearchTool to prevent incorrect path concatenation.

Guidance

  • Verify that the youtube_channel_handle parameter is correctly formatted and does not include any unnecessary characters or paths.
  • Check the load method in youtube_channel_loader.py to ensure it correctly handles both channel handles and full URLs.
  • Inspect the channel_url variable in the load method to see how the URL is being constructed and identify any potential issues with path concatenation.
  • Consider adding input validation to the YoutubeChannelSearchTool to ensure that only valid YouTube channel URLs or handles are accepted.

Example

# Example of how to correctly format the youtube_channel_handle
yt_tool = YoutubeChannelSearchTool(
    youtube_channel_handle="https://www.youtube.com/@krishnaik06"
)
# or
yt_tool = YoutubeChannelSearchTool(
    youtube_channel_handle="@krishnaik06"
)

Notes

The issue seems to be related to how the youtube_channel_handle is being processed and concatenated with other paths. The error message suggests that the load method is receiving an invalid URL, which is likely due to incorrect path concatenation.

Recommendation

Apply workaround: The issue can be resolved by modifying the load method in youtube_channel_loader.py to correctly handle both channel handles and full URLs, and by adding input validation to the YoutubeChannelSearchTool to ensure that only valid YouTube channel URLs or handles are accepted.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

The tool should accept a valid YouTube Channel URL or handle and successfully load channel data.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

crewai - ✅(Solved) Fix [ Bug]: YoutubeChannelSearchTool Fails for Valid Channel Inputs [1 pull requests, 1 participants]