$ python yt_fts.py download 'https://www.youtube.com/@ycombinator/videos' [...] File "/app/yt_fts.py", line 176, in get_channel_id channel_id = re.search('channelId":"(.{24})"', html).group(1) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'group' $ python yt_fts.py download 'https://www.youtube.com/@ycombinator/videos' --channel-id UCj089h5WsDdh1q8t54K3ZCw [...] File…
Show HN: YouTube Full Text Search – Search all of a channel from the commandline
141–150 of 172 posts
Re: Show HN: YouTube Full Text Search – Search all of a channel from the commandline
#142Earlier quoted context omitted.
I mean this: "Tell HN: YouTube's web UI just got even worse" - https://news.ycombinator.com/item?id=33371268 They used to have a drop down box, for oldest or most recent, when you clicked on the tab Videos for a YouTube channel. Now you will notice, it has now a "Latest" and "Popular", something that of course the algorithm will decide upon...
We seem to be locked into an ever more blatant "cycle of addiction". As with (other) drugs, the addict and the dealer are something like "two sides of the same coin". Briefly, new tech / markets / apps ... i.e., 'innovation' ... often 'creates' tremendous 'value'*. Money (aka capital) rushes in - there's a boom, everyone's excited: consumers are getting new products, services, conveniences, improved prices; engineers…
"Here is how platforms die: first, they are good to their users; then they abuse their users to make things better for their business customers; finally, they abuse those business customers to claw back all the value for themselves. Then, they die."
-- Corey Doctorow, https://pluralistic.net/2023/01/21/potemkin-ai/#hey-guys
Re: Show HN: YouTube Full Text Search – Search all of a channel from the commandline
#143I love that a third party is stepping up here, but it's incomprehensible to me that Google doesn't do this themselves. They're a search company, and they own YouTube. The YouTube data — including the subtitle files — is already sitting there on their servers; they don't have to scrape it, they just have to index it. What are they even doing? Fun thing to try: do a Google search with "site:youtube.com" in it. You get…
Google already does this themselves. If you search for rare words (e.g. try "indubitably") it will absolutely pull up videos that have the word in the auto-generated transcript and nowhere else (not in descriptions, not in comments). Also, using "site:youtube.com" on Google works perfectly for me. If I look up "site:youtube.com david letterman" it gives me the David Letterman channel, followed by a seemingly infinite…
"having a distribution that's both radially symmetric" site:youtube.com
would return 3b1b's "Why π is in the normal distribution" video, which has that in subtitles at 22:28.
Even without the site: term, all I get is an allreadable.com page that's scraped the subtitles for that video. Allreadable appears at first glance to be a site owned by someone in China and hosted on liquidweb.
Re: Show HN: YouTube Full Text Search – Search all of a channel from the commandline
#144Earlier quoted context omitted.
I’m pretty sure google uses the captions in search. As long as you search from within YouTube. I regularly search for keywords and find hourlong videos where it’s mentioned somewhere in the middle and nowhere in the description.
I suspect what you see is the search "learning" from the users -- someone is looking for a specific video that they've seen before but need to refine the search terms a few times before they find it. Thereafter, Google remembers the entire sequence of search terms and associates them with the video even though none of those terms might actually exist in the indexed video metadata. I've noticed that Google Search at l…
Re: Show HN: YouTube Full Text Search – Search all of a channel from the commandline
#145Earlier quoted context omitted.
This is exactly what I’ve built. Nothing fancy just ytdlp + whisper + ripgrep + fzf and I’ve got a pretty interesting way to ctrl+f my YT history.
Mind to share? I'd like to try this out
from pytube import Channel
import whisper
channel_yt = Channel(channel_url)
video_yt = channel_yt.videos[0]
video_yt_stream = video_yt.streams.filter(mime_type="video/mp4").filter(res="720p").first()
video_yt_video_file_path = video_yt_stream.download()
audio = whisper.load_audio(video_yt_video_file_path)
model = whisper.load_model("tiny")
transcript = model.transcribe(audio)
Re: Show HN: YouTube Full Text Search – Search all of a channel from the commandline
#146Earlier quoted context omitted.
Google already does this themselves. If you search for rare words (e.g. try "indubitably") it will absolutely pull up videos that have the word in the auto-generated transcript and nowhere else (not in descriptions, not in comments). Also, using "site:youtube.com" on Google works perfectly for me. If I look up "site:youtube.com david letterman" it gives me the David Letterman channel, followed by a seemingly infinite…
What I'd expect is that "having a distribution that's both radially symmetric" site:youtube.com would return 3b1b's "Why π is in the normal distribution" video, which has that in subtitles at 22:28. Even without the site: term, all I get is an allreadable.com page that's scraped the subtitles for that video. Allreadable appears at first glance to be a site owned by someone in China and hosted on liquidweb.
I wonder why YouTube indexes the transcripts for YouTube search, but Google chooses not to include them in its index for Google search? Seems like an intentional decision since it's the same company after all.
Re: Show HN: YouTube Full Text Search – Search all of a channel from the commandline
#147Very 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 .)
Re: Show HN: YouTube Full Text Search – Search all of a channel from the commandline
#148I hate being the poo pooer who says that subtitles are available via the API and wish the tool went that route. I'm all for stuff being archivable with tools like youtube-dl, but I much prefer to see tools like this use the API despite its quotas because it goes beyond archiving a copy for reference. Tools that (ab)use scraping only justify anti-scraping efforts that journalists and the like use and escalate that arm…
Re: Show HN: YouTube Full Text Search – Search all of a channel from the commandline
#149SQLite has a really power full-text search mechanism built in - FTS5. It can handle things like stemming and stop words and relevance ranking.
My sqlite-utils Python library includes helper methods for setting that up: https://sqlite-utils.datasette.io/en/stable/python-api.html#...
Re: Show HN: YouTube Full Text Search – Search all of a channel from the commandline
#150Earlier quoted context omitted.
I’m pretty sure google uses the captions in search. As long as you search from within YouTube. I regularly search for keywords and find hourlong videos where it’s mentioned somewhere in the middle and nowhere in the description.
I still have doubts. Google uses anchors heavily in search, so it's hard to prove if a result is due to matches in captions or in a website linking to the video. Would be good to find proof one way or another.