Lurker News
yt-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 comments
bsnnkv1 reply#
This is great!

I 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.

bob_theslob646#
Is it as effective as what you did? Did you need an API key for yours to work? What was your cost per video?
vram221 reply#
Apropos of the post: sometime back I had wondered if it would be possible to search videos for content by text keywords, but not to match text occurring in the video title, chapter titles or comments. Instead, if an app or library could somehow search for the given keywords by matching them with the spoken words in the video. That would be a potentially cool and useful feature.

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.

vram22#
>somehow "internally" play the video,

Analogous to how headless browsers are used for automated testing or scraping of web apps.

dredmorbius1 reply#
Does this rely on an API key?

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>

philsnow1 reply#
It seems to just use yt-dlp, which supports fetching subtitles.
dredmorbius#
Thanks.

Load more comments