Show HN: YouTube Full Text Search – Search all of a channel from the commandline (opens in a new tab)github.com
540 pointsyt-fts is a simple python script that uses yt-dlp to scrape all of a youtube channels subtitles and load them into an sqlite database that is searchable from the command line. It allows you to query a channel for specific key word or phrase and will generate time stamped youtube urls to the video containing the keyword.
Comments (165) 32 threads
Earlier commentsI had made something like this for my own use, but it was way more complicated. It took a user account, downloaded all the liked videos, ran it through some model and vectorized it, and then you could use natural language search to describe a scene in your history of liked videos and it would show you the timestamp and the thumbnail (with the link to start watching from the timestamp).
I ended up taking it offline because I didn't use it much, it was expensive and I couldn't see a path to monetization.
This solution being posted however, is really elegant, in particular because it is very resource-efficient.
I realize this may be technically impossible [1] or very difficult, but thought of mentioning the idea here.
[1] On further thought, speech recognition (as seen in mobile phones at least) has progressed to quite a good level (speaking as a layman for this part), so maybe the idea is not wholly infeasible. If an app or lib could somehow "internally" play the video, and speech-recognize the spoken words into text, then the problem would reduce to normal text pattern matching.
Putting the idea out here to see what devs think of it.
Analogous to how headless browsers are used for automated testing or scraping of web apps.
There have been earlier tools which permitted command-line / terminal access to Youtube, one of the best being mps-youtube:
<https://github.com/mps-youtube/mps-youtube>
That permitted searches for terms and channels (though not subtitle text within channel AFAIK), for music specifically, and compiliation of either temporary or saved playlists, with the option to play through a full selection of videos. It also offered either full-video or audio-only playback.
Google killed it by throttling API-key access.
Discussed previously: <https://news.ycombinator.com/item?id=32919545> <https://news.ycombinator.com/item?id=28571421>
All comments shown.
Couldn't load more comments. Check your connection and try again.