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

Show all comments

Showing thread 2 of 32

gorgoiler2 replies#
Very nice! FYI: sqlite ships with a full text search engine featuring a Boolean query language, highlight(), snippet() and scoring:

https://www.sqlite.org/fts5.html
I’ve not used it with enough content to know how much faster it is than LIKE ‘%my query%’ but it should be a lot quicker.
(Also, in most cases you don’t need to create an id column — every table has one already in the form of rowid.)

Boltgolt1 reply#
In what cases is it unwise to rely on rowid over a id field?
gorgoiler2 replies#
I don’t think there are any. They are one and the same — if you create an integer primary key named id it is aliased to rowid:

https://www.sqlite.org/rowidtable.html

Scaevolus#
This is safer-- relying on implicit rowids can break things if you use a plaintext database dump (those don't have rowids), and having a column "id integer primary key" is clearer in the schema.
eternauta3k#
I think the integer autoincrement primary key is more explicit / less mysterious than the implicit rowid. Even if most of us have run into that explanation in the sqlite manual.
lennxa#
Not sure if this includes fuzzy search, but having it will make this much more usable.