-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Search: Add support for Youtube URLs #4146
Conversation
Would it be possible to make this configurable (either in this PR or maybe after #2377)? Since this does prevent some search queries such as |
Searching However, searching for |
Oops I missed that. But my point still stands. In general this PR blocks certain search queries from going through to YouTube due to the URL redirection functionality.
etc all returns different search results on YouTube. And although this may be an edge case, it still does "block" certain search results from showing up on Invidious and that's something I'd like to avoid if possible. |
Is that edge case worth the added complexity of another config option? |
I think its worth it. Blocking search terms from going through to YouTube is something Invidious should never do imo edgecase or not. |
This is one of the few times where I disagree on doing something automatically for the sake of convenience. To give a personal anecdote, I've accidentally encountered the automatically redirection feature on Libreddit more than once when just trying to search for a subreddit name. Its way less of an issue on YouTube but it does exist. There are many popular videos titled with just the Never Gonna Give You Up link for example. This feature (without an toggle) would make it harder and perhaps impossible to locate those videos through the search function. |
What do you think of a DDG "bang" style trigger, instead? In essence, the URL search would trigger only if the search field contains exactly one valid URL, without any extra search terms, and preceded by |
Well, the probability that a user searches for an exact, valid Youtube URL, with a leading exclamation mark (that seem to be ignored by youtube anyway?) without any other search terms, is very thin, if not to say null. I like the idea of a smart search thing, but I don't know how to integrate that nicely with the rest (a search button, for sure, and maybe a toggle for suggestions). I'm worried it'll clutter the search bar... |
True. I'd just rather not add an option that restricts certain search results in Invidious no matter how much of an edge case it is.
I can take care of that in another PR. Could you just add a smart search url parameter for now? I don't believe it will clutter the search bar that much if its well designed. Google for instance has four buttons (five when its focused) in their search bar. |
Actually now that I think about it, I'll be fine with a bang system as long as the |
@syeopite As you requested, I added some logic to bypass this feature. By default, if the search query is a valid youtube URL, it redirects to that page. If the query starts with an excalmation mark ( Is that good for you? |
Yeah that's fine by me. |
821a818
to
b83f9a0
Compare
src/invidious/search/query.cr
Outdated
if @raw_query.starts_with?('!') | ||
@inhibit_ssf = true | ||
@raw_query = @raw_query[1..] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using !
as an inhibitor seems a bit odd to me, especially when it functions as an escape. What do you think of using a backslash instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm neutral on this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it doesn't make parsing more difficult then I'm in favor of using a backslash instead of an exclamation mark. Since usually an !
is to use a special smart functionality rather than negate it
d61710a
to
85deea5
Compare
Introduced in iv-org#4146
Closes #3300