mirror of
https://github.com/miniflux/v2.git
synced 2025-09-15 18:57:04 +00:00
Proxify video poster attribute
This commit is contained in:
parent
c595c80356
commit
1da65d97d8
2 changed files with 64 additions and 0 deletions
|
@ -61,6 +61,14 @@ func genericProxyRewriter(router *mux.Router, proxifyFunction urlProxyRewriter,
|
|||
}
|
||||
})
|
||||
|
||||
doc.Find("video").Each(func(i int, video *goquery.Selection) {
|
||||
if posterAttrValue, ok := video.Attr("poster"); ok {
|
||||
if !isDataURL(posterAttrValue) && (proxyOption == "all" || !urllib.IsHTTPS(posterAttrValue)) {
|
||||
video.SetAttr("poster", proxifyFunction(router, posterAttrValue))
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
case "audio":
|
||||
doc.Find("audio").Each(func(i int, audio *goquery.Selection) {
|
||||
if srcAttrValue, ok := audio.Attr("src"); ok {
|
||||
|
@ -85,6 +93,12 @@ func genericProxyRewriter(router *mux.Router, proxifyFunction urlProxyRewriter,
|
|||
video.SetAttr("src", proxifyFunction(router, srcAttrValue))
|
||||
}
|
||||
}
|
||||
|
||||
if posterAttrValue, ok := video.Attr("poster"); ok {
|
||||
if !isDataURL(posterAttrValue) && (proxyOption == "all" || !urllib.IsHTTPS(posterAttrValue)) {
|
||||
video.SetAttr("poster", proxifyFunction(router, posterAttrValue))
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
doc.Find("video source").Each(func(i int, sourceElement *goquery.Selection) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue