yt-fts - YouTube Full Text Search
yt-fts
is an innovative command line tool designed to enhance how users interact with YouTube's vast libraries of video content. It leverages yt-dlp
to extract subtitles from a YouTube channel and stores this information in a searchable sqlite
database. The main purpose of this tool is to allow users to search for specific keywords or phrases across the entirety of a channel and return time-stamped URLs linking directly to the moments those words were spoken.
Key Features
-
Subtitles Download: It allows users to download subtitles from any YouTube channel using a few simple commands. This is achieved by specifying the desired channel URL, and users can manage download speed and efficiency with options for parallel job processing and browser cookies integration.
-
Search Capabilities:
- Full Text Search: Users can conduct searches across saved channel data for specific strings or keywords. The tool supports advanced search syntax allowing complex queries to be constructed using boolean logic and wildcard characters.
- Semantic Search: By enabling semantic search, yt-fts can perform more nuanced searches based on meaning using the OpenAI embeddings API. This feature requires setting an API key, and it enables similarity-based sorting of results.
-
Interactive Features and Utilities:
- Chat Bot:
yt-fts
provides an innovative chat feature that uses the semantic search results to answer questions intelligently. This feature enriches interaction by constantly updating its contextual database as the conversation evolves. - Summarization: The tool can summarize video transcripts, highlighting key points in a concise format with time-stamped URLs for easy access.
- Chat Bot:
-
Data Management:
- Users can list downloaded data, export search results to CSV, and manage channel data within their database.
- Options for updating and deleting channel data are also available, ensuring the information remains pertinent and organized.
How to Get Started
-
Installation: To start using yt-fts, simply install it via pip:
pip install yt-fts
-
Example Usage:
- Download subtitles for a specific channel:
yt-fts download --jobs 5 "https://www.youtube.com/@3blue1brown"
- Search for a word or phrase across all saved channels:
yt-fts search "[search query]"
- Enable semantic search for nuanced queries:
yt-fts embeddings --channel "3Blue1Brown"
- Download subtitles for a specific channel:
Conclusion
In essence, yt-fts
is designed for users who need a powerful tool to streamline their access to spoken content across YouTube channels. By integrating both full text and semantic search capabilities, it caters to a broad spectrum of user needs, from straightforward keyword hunting to sophisticated semantic queries. Its easy-to-use installation and command guide make it an accessible choice for anyone looking to improve their search efficiency on YouTube.