1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-07-22 17:18:37 +00:00

Make Invidious instance configurable

This commit is contained in:
Romain de Laage 2022-01-06 05:43:03 +01:00 committed by GitHub
parent 5879404fd2
commit 8329e9b46c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 26 additions and 4 deletions

View file

@ -12,6 +12,7 @@ import (
"strconv"
"strings"
"miniflux.app/config"
"miniflux.app/url"
"golang.org/x/net/html"
@ -308,7 +309,6 @@ func isBlockedResource(src string) bool {
func isValidIframeSource(baseURL, src string) bool {
whitelist := []string{
"https://invidio.us",
"//www.youtube.com",
"http://www.youtube.com",
"https://www.youtube.com",
@ -334,6 +334,11 @@ func isValidIframeSource(baseURL, src string) bool {
return true
}
// allow iframe from custom invidious instance
if config.Opts != nil && config.Opts.InvidiousInstance() == url.Domain(src) {
return true
}
for _, prefix := range whitelist {
if strings.HasPrefix(src, prefix) {
return true