Search: Add support for youtu.be and youtube.com URLs

This commit is contained in:
Samantaz Fox
2023-10-05 23:01:44 +02:00
parent eb0f651812
commit 4c0b5c314d
2 changed files with 27 additions and 6 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