-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EmbedThumbnail not working, error received #17
Comments
Sorry, I seem to be making tiny mistakes in my code lately. I should stop making commits in the middle of the night |
nswanberg
pushed a commit
to nswanberg/yt-dlp
that referenced
this issue
Jul 29, 2023
- made code from yt-dlp#17 work with everything. - db_scripts.py now uses the [sqlite_utils](https://sqlite-utils.datasette.io/en/stable/index.html) library to make tables with fts enabled - `search_channel()` now uses the following to run an fts search ```python return list(db["Subtitles"].search(text, where=f"video_id IN (SELECT video_id FROM Videos WHERE channel_id = '{channel_id}')")) ``` I ran some tests using my channel - Test Channel: https://www.youtube.com/@notjoemartinez4438 - Target Quote: "I started working on a script last year" - Expected output: ``` Video Title: "Exporting contacts from an iPhone with python - YouTube" Quote: "this I started working on a script last" Time Stamp: 00:08:52.550 Link: https://youtu.be/votEAwUz4jo?t=529 ``` - It performs extreamly well with incomplete phrases - It performs poorly keyword when testing partal words compared to `LIKE` ```bash yt-fts search UCV_E0QWJw1G3kmfifmLIgxA "I stArted WorKing oN a scrip" yt-fts search UCV_E0QWJw1G3kmfifmLIgxA "I working on script" yt-fts search UCV_E0QWJw1G3kmfifmLIgxA " i wOrkIng" yt-fts search UCV_E0QWJw1G3kmfifmLIgxA "I started working on a script last year" ``` - I'm sure theres a way to enable partial words with fts so this is a good start - Fixed title formatting previous title was actually nested in a tuple - Added semi colon to title when printing - Made varable name more discriptive in `search_to_csv()` and `get_quotes()` - schema of the database with fts: ```sql CREATE TABLE [Channels] ( [channel_id] TEXT PRIMARY KEY, [channel_name] TEXT NOT NULL, [channel_url] TEXT NOT NULL ); CREATE TABLE [Videos] ( [video_id] TEXT PRIMARY KEY, [video_title] TEXT NOT NULL, [video_url] TEXT NOT NULL, [channel_id] TEXT REFERENCES [Channels]([channel_id]) ); CREATE TABLE [Subtitles] ( [subtitle_id] INTEGER PRIMARY KEY, [video_id] TEXT REFERENCES [Videos]([video_id]), [timestamp] TEXT NOT NULL, [text] TEXT NOT NULL ); CREATE VIRTUAL TABLE [Subtitles_fts] USING FTS5 ( [text], content=[Subtitles] ) /* Subtitles_fts(text) */; CREATE TABLE IF NOT EXISTS 'Subtitles_fts_data'(id INTEGER PRIMARY KEY, block BLOB); CREATE TABLE IF NOT EXISTS 'Subtitles_fts_idx'(segid, term, pgno, PRIMARY KEY(segid, term)) WITHOUT ROWID; CREATE TABLE IF NOT EXISTS 'Subtitles_fts_docsize'(id INTEGER PRIMARY KEY, sz BLOB); CREATE TABLE IF NOT EXISTS 'Subtitles_fts_config'(k PRIMARY KEY, v) WITHOUT ROWID; CREATE TRIGGER [Subtitles_ai] AFTER INSERT ON [Subtitles] BEGIN INSERT INTO [Subtitles_fts] (rowid, [text]) VALUES (new.rowid, new.[text]); END; CREATE TRIGGER [Subtitles_ad] AFTER DELETE ON [Subtitles] BEGIN INSERT INTO [Subtitles_fts] ([Subtitles_fts], rowid, [text]) VALUES('delete', old.rowid, old.[text]); END; ```
11 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Checklist
Verbose log
Description
Receiving error
ERROR: 'EmbedThumbnailPP' object has no attribute 'verbose_message'
on every video downloaded. Possibly related to this commit where you standardized some functions.The text was updated successfully, but these errors were encountered: