[PR #4547] [MERGED] Add ability to auto-handle YT video URLs in uploader & chat #4670

Closed
opened 2026-02-22 18:36:18 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/4547
Author: @timothycarambat
Created: 10/15/2025
Status: Merged
Merged: 10/15/2025
Merged by: @timothycarambat

Base: masterHead: 4508-yt-auto-handler


📝 Commits (3)

  • 908efc2 Add ability to auto-handle YT video URLs in uploader & chat
  • 78a53c7 move YT validator to URL utils
  • fe69c62 update comment

📊 Changes

8 files changed (+299 additions, -128 deletions)

View changed files

📝 collector/__tests__/utils/extensions/YoutubeTranscript/YoutubeLoader/youtube-transcript.test.js (+1 -0)
📝 collector/__tests__/utils/url/index.test.js (+69 -1)
📝 collector/processLink/convert/generic.js (+23 -79)
📝 collector/processLink/helpers/index.js (+107 -1)
📝 collector/utils/extensions/YoutubeTranscript/YoutubeLoader/index.js (+5 -8)
📝 collector/utils/extensions/YoutubeTranscript/YoutubeLoader/youtube-transcript.js (+5 -7)
📝 collector/utils/extensions/YoutubeTranscript/index.js (+53 -32)
📝 collector/utils/url/index.js (+36 -0)

📄 Description

Pull Request Type

  • feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 🔨 chore
  • 📝 docs

Relevant Issues

resolves #4508
closes #4537

What is in this change?

This PR introduces two main changes:

  1. YouTube Transcript Support — Adds the ability to pull YouTube video transcripts using the scrapeGenericUrl function.
  2. Improved Introspection Logging — Refactors the scrape function in the web scraper agent tool to provide more specific introspection logs, detailing exactly what the scraper is doing for a given resource.

What These Changes Enable

YouTube Transcript Support

With these updates, chatting with an LLM using @agent can now automatically fetch a YouTube transcript when given a video URL via the web_scraper tool.

Example usage:

@agent Please summarize this video https://www.youtube.com/watch?v=B_H1DxOI6Xs

Additionally, users can now pass a YouTube video URL directly into the URL input field within the RAG document modal to create a document from that video, effectively bypassing the need for the dedicated YouTube data connector.

Improved Introspection Logging

When @agent calls the web_scraper tool and passes in a URL. The tool first verifies what kind of resource it is by analyzing the URL itself and making a HEAD call to retrieve its Content-Type header. Based on this information the introspection logs will inform the user whether the tools will begin to

  • Pull the transcript and metadata for the YouTube video (If the user provides a YouTube video URL)
  • Read the content of the file (If the user provides a URL that responds with a non HTML content type )
  • Scrape the content of the web page (If the user provides a URL that responds with HTML)

Additional Information

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated
  • I have tested my code functionality
  • Docker build succeeds locally

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Mintplex-Labs/anything-llm/pull/4547 **Author:** [@timothycarambat](https://github.com/timothycarambat) **Created:** 10/15/2025 **Status:** ✅ Merged **Merged:** 10/15/2025 **Merged by:** [@timothycarambat](https://github.com/timothycarambat) **Base:** `master` ← **Head:** `4508-yt-auto-handler` --- ### 📝 Commits (3) - [`908efc2`](https://github.com/Mintplex-Labs/anything-llm/commit/908efc2a2dffb4d509fbafa6aa20861bc633e52d) Add ability to auto-handle YT video URLs in uploader & chat - [`78a53c7`](https://github.com/Mintplex-Labs/anything-llm/commit/78a53c783a06a931b874b3901ead96a81faee327) move YT validator to URL utils - [`fe69c62`](https://github.com/Mintplex-Labs/anything-llm/commit/fe69c62b53e46b06d5b33b0516dc41f1dcb1856e) update comment ### 📊 Changes **8 files changed** (+299 additions, -128 deletions) <details> <summary>View changed files</summary> 📝 `collector/__tests__/utils/extensions/YoutubeTranscript/YoutubeLoader/youtube-transcript.test.js` (+1 -0) 📝 `collector/__tests__/utils/url/index.test.js` (+69 -1) 📝 `collector/processLink/convert/generic.js` (+23 -79) 📝 `collector/processLink/helpers/index.js` (+107 -1) 📝 `collector/utils/extensions/YoutubeTranscript/YoutubeLoader/index.js` (+5 -8) 📝 `collector/utils/extensions/YoutubeTranscript/YoutubeLoader/youtube-transcript.js` (+5 -7) 📝 `collector/utils/extensions/YoutubeTranscript/index.js` (+53 -32) 📝 `collector/utils/url/index.js` (+36 -0) </details> ### 📄 Description ### Pull Request Type <!-- For change type, change [ ] to [x]. --> - [x] ✨ feat - [ ] 🐛 fix - [ ] ♻️ refactor - [ ] 💄 style - [ ] 🔨 chore - [ ] 📝 docs ### Relevant Issues <!-- Use "resolves #xxx" to auto resolve on merge. Otherwise, please use "connect #xxx" --> resolves #4508 closes #4537 ### What is in this change? <!-- Describe the changes in this PR that are impactful to the repo. --> This PR introduces two main changes: 1. **YouTube Transcript Support** — Adds the ability to pull YouTube video transcripts using the `scrapeGenericUrl` function. 2. **Improved Introspection Logging** — Refactors the scrape function in the web scraper agent tool to provide more specific introspection logs, detailing exactly what the scraper is doing for a given resource. ____ ### What These Changes Enable #### YouTube Transcript Support With these updates, chatting with an LLM using `@agent` can now automatically fetch a YouTube transcript when given a video URL via the `web_scraper` tool. Example usage: `@agent Please summarize this video https://www.youtube.com/watch?v=B_H1DxOI6Xs` Additionally, users can now pass a YouTube video URL directly into the URL input field within the RAG document modal to create a document from that video, effectively bypassing the need for the dedicated YouTube data connector. #### Improved Introspection Logging When `@agent` calls the `web_scraper` tool and passes in a URL. The tool first verifies what kind of resource it is by analyzing the URL itself and making a HEAD call to retrieve its `Content-Type` header. Based on this information the introspection logs will inform the user whether the tools will begin to - Pull the transcript and metadata for the YouTube video (If the user provides a YouTube video URL) - Read the content of the file (If the user provides a URL that responds with a non HTML content type ) - Scrape the content of the web page (If the user provides a URL that responds with HTML) ### Additional Information <!-- Add any other context about the Pull Request here that was not captured above. --> ### Developer Validations <!-- All of the applicable items should be checked. --> - [x] I ran `yarn lint` from the root of the repo & committed changes - [x] Relevant documentation has been updated - [x] I have tested my code functionality - [x] Docker build succeeds locally --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-22 18:36:18 -05:00
yindo closed this issue 2026-02-22 18:36:18 -05:00
yindo changed title from [PR #4547] Add ability to auto-handle YT video URLs in uploader & chat to [PR #4547] [MERGED] Add ability to auto-handle YT video URLs in uploader & chat 2026-06-05 15:19:44 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#4670