feat(sources): add managed RSS feeds (#41)

This commit is contained in:
2026-11-25 01:42:27 +01:00
parent 12acb36612
commit 136d9b3b59
38 changed files with 2103 additions and 67 deletions

View File

@ -0,0 +1,34 @@
package quanwenrss
import (
"golang.org/x/net/html"
"strings"
)
// Restriction evidence is inspected before presentation chrome is removed.
func bodyRestricted(raw string) bool {
t := html.NewTokenizer(strings.NewReader(raw))
for {
kind := t.Next()
if kind == html.ErrorToken {
return false
}
if kind != html.StartTagToken && kind != html.SelfClosingTagToken {
continue
}
token := t.Token()
for _, a := range token.Attr {
value := strings.ToLower(a.Val)
if (a.Key == "data-content-state" && (value == "partial" || value == "incomplete")) || (a.Key == "data-content-truncated" && value == "true") || (a.Key == "data-accessible" && value == "false") {
return true
}
if a.Key == "class" || a.Key == "id" || a.Key == "data-component" || a.Key == "data-testid" || a.Key == "data-test" || a.Key == "src" {
for _, marker := range []string{"paywall", "giftarticle", "captcha", "challenge", "cf-chl", "placeholder", "skeleton", "truncated", "partial"} {
if strings.Contains(value, marker) {
return true
}
}
}
}
}
}