kellenmace
Joined 4 years ago
Joined 4 years ago
* The user performs a search, reviews the matches, then closes the browser tab.
* The title or description for one or more of the videos on that YouTube channel are updated.
* 45 minutes later, the user remembers that they wanted to search for something else on that same YouTube channel. They return to VideoMentions Search to perform another search.
If I had sent cache-control headers in the first response telling the browser to cache the results of those HTTP requests, they would not be refetched for subsequent requests and the user would potentially be shown incorrect matches.
By fetching the data fresh whenever the user opens VideoMentions Search in a new browser tab, I guarantee that they're getting correct matches based on the titles, descriptions and spoken words that the videos have at the time the search is performed.
So as it's implemented currently, I'm choosing to take a performance hit in exchange for improved accuracy. And I'm comfortable with that tradeoff since searches seem decently speedy to me when I use the tool.
Thanks for your thoughts, and the alternative client-side caching idea!
Thanks for checking out my project!
That's why I built VideoMentions Search. It pulls in the transcript for every video within the channel and date range you selected and shows you any and all matches.
Also - even when a Google search does work to find a video based on spoken words, all you're given is a link to that video's page. You can't see all the times that keyword was mentioned within the video and click on one of those mentions to jump to that exact moment in the video, like you can with VideoMentions Search.
If Google/YouTube added those capabilities, then VideoMentions Search would be irrelevant. In the meantime though, I think it's a useful free tool for quickly finding spoken word matches within a specific channel.
Thanks for checking it out!
Thanks for checking out my project!
VideoMentions Search allows you to specify the channel URL, keywords and date range, then does all that hard work for you, quickly locating all videos that contain those keywords.
I hope that's helpful. Thanks for checking out my project!
Thanks for checking out my project!
Thanks for checking out my project!
Some requests can't be sent from the browser directly to YouTube due to the Content Security Policy directives that YouTube has in place, though.
For example, if you try to run this code to fetch a YouTube video page in the browser console from any non-YouTube site (like Hacker News or VideoMentions), you'll see the it errors out:
(async () => { const response = await fetch('https://www.youtube.com/watch?v=irjc1nJ1eJs'); console.log(response); })();
That's why my app uses serverless API endpoints as a middleman. It works like this:
1. Browser fires off a request to the API endpoint.
2. The serverless function Node.js process spins up, fetches the data from YouTube, returns the response, then spins back down.
3. My app takes the video data in the response, saves it in memory, searches it for matches, and re-renders the UI to show the matches, if any.
I built my app to do as much work as possible client-side, and to use serverless function API endpoints for anything that can't be done in-browser.
I replied to @lewisjoe's comment above this one with some more details about tricks I'm employing to make searches fast.
Thanks for checking out my project!
Thanks for checking out my project!
I replied to @lewisjoe's comment above this one with some more details about tricks I'm employing to make searches fast.
Thanks for checking out my project!