diff --git a/doc/changelog.md b/doc/changelog.md index 8b573f0..f2b2c58 100644 --- a/doc/changelog.md +++ b/doc/changelog.md @@ -3,6 +3,7 @@ - (new) serve on unix socket (thanks to @rvighne) - (new) more auto-refresh options: 12h & 24h (thanks to @aswerkljh for suggestion) - (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) cookie security measures (thanks to Tom Fitzhenry) - (etc) restrict access to internal IPs for page crawler (thanks to Omar Kurt) diff --git a/src/content/silo/iframe.go b/src/content/silo/iframe.go index af1770d..540ccc8 100644 --- a/src/content/silo/iframe.go +++ b/src/content/silo/iframe.go @@ -22,6 +22,8 @@ func VideoIFrame(link string) string { youtubeID := "" if l.Host == "www.youtube.com" && l.Path == "/watch" { 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" { youtubeID = strings.TrimLeft(l.Path, "/") }