mirror of
https://gitea.invidious.io/iv-org/invidious.git
synced 2024-08-15 00:53:41 +00:00
Add link for shortened youtube url
This commit is contained in:
parent
fd1bd35b42
commit
9886953fb6
1 changed files with 1 additions and 1 deletions
|
@ -351,7 +351,7 @@ def add_alt_links(html)
|
||||||
anchor = anchor.xpath_node("//a").not_nil!
|
anchor = anchor.xpath_node("//a").not_nil!
|
||||||
url = URI.parse(HTML.unescape(anchor["href"]))
|
url = URI.parse(HTML.unescape(anchor["href"]))
|
||||||
|
|
||||||
if ["www.youtube.com", "youtu.be", "m.youtube.com"].includes?(url.host) && url.path == "/watch"
|
if ["www.youtube.com", "m.youtube.com"].includes?(url.host) && url.path == "/watch" || url.host == "youtu.be"
|
||||||
alt_link = <<-END_HTML
|
alt_link = <<-END_HTML
|
||||||
<a href="#{url.full_path}">
|
<a href="#{url.full_path}">
|
||||||
<i class="fa fa-link" aria-hidden="true"></i>
|
<i class="fa fa-link" aria-hidden="true"></i>
|
||||||
|
|
Loading…
Reference in a new issue