[PR #4537] [CLOSED] Add YouTube Transcript Pulling to scrapeGenericUrl & Improve Web Scraper Tool Introspection #4664

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

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/4537
Author: @angelplusultra
Created: 10/13/2025
Status: Closed

Base: masterHead: 4508-agent-youtube-transcript-analysis


📝 Commits (9)

  • dd0613b feat: add YouTube video transcript processing to generic URL scraper
  • 1be21f4 Refactor agent introspection logs and
  • 8823bc1 Add timeout to head request in scrape func
  • 858faa5 remove log
  • c17121d Add more robust youtube url validation logic to both scrape fn and collector
  • 75ec5a6 Fix bug in path matching
  • 09df8e4 add tests for isYouTubeUrl
  • 5bcecb4 Rename isYouTubeUrl to isYouTubeVideoUrl for clarity and update related references in the generic URL scraper.
  • dfa79f1 Update tests to reflect renaming of isYouTubeUrl to isYouTubeVideoUrl, ensuring all references are consistent in the URL validation tests.

📊 Changes

4 files changed (+320 additions, -16 deletions)

View changed files

📝 collector/__tests__/utils/url/index.test.js (+67 -9)
📝 collector/processLink/convert/generic.js (+71 -3)
📝 collector/utils/url/index.js (+41 -0)
📝 server/utils/agents/aibitat/plugins/web-scraping.js (+141 -4)

📄 Description

Pull Request Type

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

Relevant Issues

resolves #4508

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/4537 **Author:** [@angelplusultra](https://github.com/angelplusultra) **Created:** 10/13/2025 **Status:** ❌ Closed **Base:** `master` ← **Head:** `4508-agent-youtube-transcript-analysis` --- ### 📝 Commits (9) - [`dd0613b`](https://github.com/Mintplex-Labs/anything-llm/commit/dd0613bcae913f8157650255fb8fa7b34350d3cc) feat: add YouTube video transcript processing to generic URL scraper - [`1be21f4`](https://github.com/Mintplex-Labs/anything-llm/commit/1be21f403390f7c59f7452b57631866513b8f93c) Refactor agent introspection logs and - [`8823bc1`](https://github.com/Mintplex-Labs/anything-llm/commit/8823bc1f62c3d9e88449738ce3f3c9a7be28d3e6) Add timeout to head request in scrape func - [`858faa5`](https://github.com/Mintplex-Labs/anything-llm/commit/858faa5967554c8cb027d95547acf085ce40f09a) remove log - [`c17121d`](https://github.com/Mintplex-Labs/anything-llm/commit/c17121dd764f0e10652d6ede52685bf5af97e937) Add more robust youtube url validation logic to both scrape fn and collector - [`75ec5a6`](https://github.com/Mintplex-Labs/anything-llm/commit/75ec5a6ef099f933858b9d9bde228d4cb15de639) Fix bug in path matching - [`09df8e4`](https://github.com/Mintplex-Labs/anything-llm/commit/09df8e4219e13088041de678175c38f73f517707) add tests for isYouTubeUrl - [`5bcecb4`](https://github.com/Mintplex-Labs/anything-llm/commit/5bcecb425535627522cb0a9590ad4bc7df481786) Rename isYouTubeUrl to isYouTubeVideoUrl for clarity and update related references in the generic URL scraper. - [`dfa79f1`](https://github.com/Mintplex-Labs/anything-llm/commit/dfa79f1db3c401b0607163ebcd2f5691b0cdf9a8) Update tests to reflect renaming of isYouTubeUrl to isYouTubeVideoUrl, ensuring all references are consistent in the URL validation tests. ### 📊 Changes **4 files changed** (+320 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `collector/__tests__/utils/url/index.test.js` (+67 -9) 📝 `collector/processLink/convert/generic.js` (+71 -3) 📝 `collector/utils/url/index.js` (+41 -0) 📝 `server/utils/agents/aibitat/plugins/web-scraping.js` (+141 -4) </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 ### 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:17 -05:00
yindo closed this issue 2026-02-22 18:36:17 -05:00
yindo changed title from [PR #4537] Add YouTube Transcript Pulling to `scrapeGenericUrl` & Improve Web Scraper Tool Introspection to [PR #4537] [CLOSED] Add YouTube Transcript Pulling to `scrapeGenericUrl` & Improve Web Scraper Tool Introspection 2026-06-05 15:19:42 -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#4664