Search: Add support for Youtube URLs (#4146)

Closes issue 3300
This commit is contained in:
Samantaz Fox
2024-08-24 19:44:59 +02:00
3 changed files with 160 additions and 5 deletions

View File

@@ -51,6 +51,12 @@ module Invidious::Routes::Search
else
user = env.get? "user"
# An URL was copy/pasted in the search box.
# Redirect the user to the appropriate page.
if query.is_url?
return env.redirect UrlSanitizer.process(query.text).to_s
end
begin
items = query.process
rescue ex : ChannelSearchException