youtube shorts in readability

This commit is contained in:
nkanaev
2025-10-06 14:25:46 +01:00
parent 0e11cec99a
commit 16a7f3409c
2 changed files with 3 additions and 0 deletions

View File

@@ -3,6 +3,7 @@
- (new) serve on unix socket (thanks to @rvighne) - (new) serve on unix socket (thanks to @rvighne)
- (new) more auto-refresh options: 12h & 24h (thanks to @aswerkljh for suggestion) - (new) more auto-refresh options: 12h & 24h (thanks to @aswerkljh for suggestion)
- (fix) smooth scrolling on iOS (thanks to gatheraled) - (fix) smooth scrolling on iOS (thanks to gatheraled)
- (fix) displaying youtube shorts in "Read Here" (thanks to @Dean-Corso for the report)
- (etc) theme-color support (thanks to @asimpson) - (etc) theme-color support (thanks to @asimpson)
- (etc) cookie security measures (thanks to Tom Fitzhenry) - (etc) cookie security measures (thanks to Tom Fitzhenry)
- (etc) restrict access to internal IPs for page crawler (thanks to Omar Kurt) - (etc) restrict access to internal IPs for page crawler (thanks to Omar Kurt)

View File

@@ -22,6 +22,8 @@ func VideoIFrame(link string) string {
youtubeID := "" youtubeID := ""
if l.Host == "www.youtube.com" && l.Path == "/watch" { if l.Host == "www.youtube.com" && l.Path == "/watch" {
youtubeID = l.Query().Get("v") youtubeID = l.Query().Get("v")
} else if l.Host == "www.youtube.com" && strings.HasPrefix(l.Path, "/shorts/") {
youtubeID = strings.TrimPrefix(l.Path, "/shorts/")
} else if l.Host == "youtu.be" { } else if l.Host == "youtu.be" {
youtubeID = strings.TrimLeft(l.Path, "/") youtubeID = strings.TrimLeft(l.Path, "/")
} }